Portainer: Docker Management via Web

Portainer is a web GUI for Docker that lets you manage containers, images, volumes, networks and docker-compose stacks without using the terminal. Ideal for those who don't want to memorize Docker commands.

02

Installation

bash
# Create a volume for Portainer data
docker volume create portainer_data

# Start Portainer (Community Edition - free)
docker run -d \
  --name portainer \
  --restart always \
  -p 9000:9000 \
  -p 9443:9443 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v portainer_data:/data \
  portainer/portainer-ce:latest

Access at http://SERVER_IP:9000: on first run create the admin user.

Don't expose port 9000 on the internet without protection. Use a reverse proxy Nginx with SSL or access via SSH tunnel: ssh -L 9000:localhost:9000 root@SERVER_IP

03

With docker-compose

yaml
# portainer/docker-compose.yml
services:
  portainer:
    image: portainer/portainer-ce:latest
    container_name: portainer
    restart: always
    ports:
      - "9000:9000"
      - "9443:9443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data

volumes:
  portainer_data:
bash
docker compose up -d
04

Nginx reverse proxy with SSL

nginx
server {
    listen 443 ssl;
    server_name portainer.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/portainer.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/portainer.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://localhost:9000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
05

Main features

Containers: start, stop, restart, remove, view logs and interactive console.

Stacks: load a docker-compose.yml directly from the web interface and run it.

Images: download, remove, inspect Docker images.

Volumes: create, remove, view volumes.

Networks: manage Docker networks.

Environment: connect multiple remote Docker servers from a single Portainer instance.

06

Update Portainer

bash
docker stop portainer
docker rm portainer
docker pull portainer/portainer-ce:latest
# Re-run the installation command: data is in the volume
docker run -d \
  --name portainer \
  --restart always \
  -p 9000:9000 -p 9443:9443 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v portainer_data:/data \
  portainer/portainer-ce:latest

DeluxHost, fondata nel 2023, offre soluzioni di hosting di alta qualità per diverse esigenze digitali. Forniamo hosting condiviso, VPS e server dedicati con sicurezza avanzata e datacenter globali.

© DeluxHost, Tutti i diritti riservati. | Partita IVA: IT17734661006
Tutti i sistemi operativi