Managing Docker Containers with Portainer
Portainer is a web-based container management platform that supports Docker, Swarm, Nomad, and Kubernetes. Portainer is available in two versions, Community Edition (CE) and Business Edition (BE).
Tutorial Environment
Environment used in this tutorial:
VPS Ubuntu 20.04
Docker v20.10
Portainer CE v2.13
Install Portainer Server
Before installing Portainer Server, install Docker first.
Create a volume to store the database.
docker volume create portainer_dataCreate a container named portainer from the docker volume create portainer_data image.
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latestChecking whether the Portainer Server container is running.
docker psExample of the command results above.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
11f1ae8a0d4a portainer/portainer-ce:latest "/portainer" About a minute ago Up About a minute 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp, 9000/tcp portainerInitial Setup
Browse Portainer Server at https://ServerIP:9443. Enter Username and Password for administrator.
If Portainer times out when first accessed, restart the Portainer container. Timeouts occur because the wait time runs out, Portainer is not immediately accessed when the container is finished being created.
docker stop portainer
docker start portainerPortainer dashboard after login.
