Quick Portainer installation with docker-compose

Note Statistics

Note Statistics

  • Viewed 153 times
  • Bookmarked 1 times
  • 1 Grateful readers
Sun, 09/06/2020 - 15:19

This is a short tutorial on how to install Portainer using docker-compose.

Prerequisites: An initial requirement is that you have must have both Docker and docker-compose installed.

Steps

  1. Create a docker-compose file with the content below
version: '3.2'

services:
  portainer:
    image: portainer/portainer
    command: -H unix:///var/run/docker.sock
    restart: always
    ports:
      - 9000:9000

    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data

volumes:
  portainer_data:
  1. Run protainer with docker-compose
docker-compose up -d
  1. Go to your host on port 9001 . For example localhost:9001.
  2. Enter admin user name and password. This should be done within 15 minutes of starting the container.
  3. Voila! now you have portainer setup.
Authored by