1. What is Docker?

In the dynamic world of software production, Docker has emerged as a revolutionary tool, allowing developers to package applications into containers—standardized executable components combining application source code with the operating system (OS) libraries and dependencies required to run that code in any environment. While Docker simplifies the deployment of applications, managing multiple containers and their lifecycles can become cumbersome without the right tools. Enter Portainer, a powerful platform designed to simplify Docker container management. It offers a visual interface that helps both novice and experienced users manage their Docker environments efficiently, bridging the gap between complexity and usability.

 

2. What is Portainer?

Portainer is an open-source management tool that helps users orchestrate their Docker environments. It is designed to manage individual Docker containers, Docker Swarm clusters, and even Kubernetes clusters, providing a single interface to manage all these environments seamlessly. Portainer reduces the complexity of Docker commands by providing a user-friendly dashboard that allows for the quick deployment, monitoring, and management of containers. Whether you’re running Docker on your local machine, a network of virtual machines, or a cloud-based server, Portainer simplifies the process, making container management accessible to those who may not be command-line experts.

 

3. Installing Portainer

Prerequisites

The following instructions assume that you have already created a dedicated user (called “docker”). The paths shown here are from a installation I did on a Synology Drive. Please adjust these for your needs. In this setup Portainer will be deployed behind a reverse proxy that handles ssl termination. Therefore we can ignore setting this up directly in Portainer.

We move to the working directory, create two folders and transfer ownership to the Docker user:

cd /volume1/docker
mkdir portainer
cd portainer
mkdir config data
cd ..
sudo chown -R docker:docker portainer

Installation

We pull the last image and let the process run separately. It is particularly important that we map the non-default port 9000, as we do not access the internal network via SSL encryption, but only via standard http:

sudo docker run -d -p 8000:8000 -p 9443:9443 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /volume1/docker/portainer:/data portainer/portainer-ce:latest

4. Updating Portainer

To update Portainer to the latest version, we first stop the container:

sudo docker stop portainer

Then we remove the existing container:

sudo docker remove portainer

Now we can recreate the container as with the original installation. All persistent data is saved in the bind mount and is therefore available again after the update.

sudo docker run -d -p 8000:8000 -p 9443:9443 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /volume1/docker/portainer:/data portainer/portainer-ce:latest