DEV Community

Cover image for Managing Docker Containers with Portainer
Teddy Zugana
Teddy Zugana

Posted on

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_data
Enter fullscreen mode Exit fullscreen mode

Create 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:latest
Enter fullscreen mode Exit fullscreen mode

Checking whether the Portainer Server container is running.

docker ps
Enter fullscreen mode Exit fullscreen mode

Example 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 portainer

Enter fullscreen mode Exit fullscreen mode

Initial 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 portainer
Enter fullscreen mode Exit fullscreen mode

Portainer dashboard after login.

Top comments (0)