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.
- 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: - 9001:9000 volumes: - /var/run/docker.sock:/var/run/docker.sock - portainer_data:/data volumes: portainer_data:
- Run protainer with docker-compose
docker-compose up -d
- Go to your host on port 9001 . For example
- Enter admin user name and password. This should be done within 15 minutes of starting the container.
- Voila! now you have portainer setup.