How to run Portainer CE as a container using Docker-Compose
Steps:
- Create a file named compose.yml in the host machine
- Copy and paste the YAML code in the below line and save the file
version: '3.3'
services:
portainer-ce:
image: 'portainer/portainer-ce:latest'
hostname: portainer
container_name: portainer
ports:
- '8000:8000'
- '9443:9443'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- 'portainer_data:/data'
restart: always
- Run the command to launch the container
docker compose up -d
- now open the Portainer web UI console by the host IP of the docker-machine https://192.168.10.200:9443