Portainer

Install protainer via docker-compose

Docker-compose

  1. Make folder for portainer

    mkdir portainer && cd portainer
    
  2. docker-compose.yml

    version: '3.8'
    
    services:
     portainer:
       image: portainer/portainer-ce:latest
       container_name: portainer
       restart: always
       security_opt:
         - no-new-privileges:true
       volumes:
         - /etc/localtime:/etc/localtime:ro
         - /var/run/docker.sock:/var/run/docker.sock:ro
         - ./portainer-data:/data
       ports:
         - 9443:9443
    

Nginx

  1. Create nginx config

    sudo vim /etc/nginx/sites-available/portainer.example.com
    
  2. Content of portainer.example.com

    server {
     listen 80;
     listen [::]:80;
    
     server_name portainer.example.com;
    
     location / {
         proxy_pass https://127.0.0.1:9443;
         proxy_http_version 1.1;
         proxy_set_header Host $host;
     }
    }
    
  3. Create symbolic link

    sudo ln -s /etc/nginx/sites-available/portainer.example.com /etc/nginx/sites-enabled/
    
  4. Check nginx config

    sudo nginx -t
    
  5. Reload nginx config

    sudo systemctl reload nginx
    

results matching ""

    No results matching ""