Image: portainer-logo.png

Portainer Stacks

by on
1 minute read

Install Docker containers using docker-compose files with Portainer Stacks.

Installling Portainer

There are a few ways of running docker containers, it should not matter which way your prefer most. Here are some examples

via Terminal, open the terminal and enter:

docker volume create portainer_data; \
docker run -d \
-p 8000:8000 \
-p 9000:9000 \
--name=portainer \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
--labels com.centurylinklabs.watchtower.enable=true \
--network_mode=bridge \
portainer/portainer-ce:latest



via docker-compose.yml file Create docker-compose.yml file, eg: nano ~/docker/docker-compose.yml and paste:

---
version: "3.8"
services:
  portainer:
    container_name: "portainer"
    image: "portainer/portainer-ce:latest"
    restart: "always"
    network_mode: "bridge"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
      - "portainer_data:/data"
    port:
      - "8000:8000"
      - "9000:9000"
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

volumes:
    portainer_data:
        external: false


Portainer WebUI

Portainer should now be available at: http://IP:9000.

  1. Configure Username and Password to Create user.
  2. Select Docker and Connect.
  3. Click in local to access your instance.
  4. Navigate to Endpoints on the left-side menu and click on local to edit.
  5. In Public IP put the IP address of Portainer. Bonus you can name it differently if you want. After Public IP configured press Update Endpoint.
  6. Navigate to Stacks on the left-side menu.
  7. Here you can paste most docker-compose.yml files or create your own.
  8. For example:
  9. Here you can upload Stacks directly from Github, Gitea and many others.
  10. Here is a example using this personal Gitea server.
  11. Stack running
  12. Inside the Stack
  13. Updating/Editing the Stack locally.
  14. Stack file can also be edited on Git and pushed again to assume the changes.
comments powered by Disqus