Portainer: managing Docker via a web interface
Portainer: Managing Docker via a web interface
This article explains how to install and use Portainer to manage Docker environments via a graphical web interface, intended for developers and administrators who want to manage Docker containers more efficiently.
Requirements
- A Linux or Windows server with Docker installed (Docker Engine 20.10.0 or newer) - Access to the terminal with sudo rights - Port 9443 free for HTTPS traffic - Port 8000 free for the TCP tunnel server - Docker Compose (optional, for more advanced installations)
Steps
1. Download the Portainer image
Pull the official Portainer image from Docker Hub. The Enterprise Edition with long-term support (LTS) is recommended for production environments.
docker pull portainer/portainer-ee:lts
For the Community Edition, use:
docker pull portainer/portainer-ce:latest
2. Create a persistent volume
Portainer stores configuration and status data in a Docker volume. This ensures that settings are retained after a restart of the container.
docker volume create portainer_data
3. Start the Portainer container
The installation uses two volumes: `/var/run/docker.sock` for access to the Docker daemon and `portainer_data` for persistent storage. The container listens on port 9443 for HTTPS and port 8000 for the TCP tunnel server.
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:/portainer_data portainer/portainer-ee:lts4. Open the web interface
Navigate to `https://localhost:9443` in your browser. Replace `localhost` with the IP address or FQDN of your server if you manage Portainer remotely.
5. Create an admin account
On first login, you must set a username and password for the admin account. This account has full control over the Portainer environment.
6. Connect a Docker environment
Portainer asks you to connect an environment. Choose "Docker Standalone" if you manage a single Docker host, or "Docker Swarm" for a cluster environment.
7. Manage containers via the interface
After connecting, you will see an overview of all active and stopped containers, images, volumes, and networks. You can start, stop, restart, pause, or remove containers via the interface without having to remember Docker CLI commands.
8. Use advanced features
Portainer also offers support for Kubernetes and Azure Container Instances (ACI). Via the interface, you can add and manage these environments with the same graphical tools.
Verification
Check whether Portainer is running correctly with:
docker ps | grep portainer
The output shows a container named `portainer`, with status `Up` and the ports `0.0.0.0:8000->8000/tcp` and `0.0.0.0:9443->9443/tcp`.
Frequently asked problems
1. Cannot connect to https://localhost:9443
Check whether the container is running with `docker ps`. If the container is not active, view the logs with `docker logs portainer`. The most common cause is a firewall blocking port 9443.
2. Portainer loses configuration after a restart
This happens when the volume is not correctly attached. Remove the container and start again with the full `docker run` command from step 3, including the `-v portainer_data:/portainer_data` parameter.
3. No access to the Docker daemon
The container needs access to the Docker daemon via `/var/run/docker.sock`. Check whether the file exists on your host with `ls -la /var/run/docker.sock`. If it is missing, you must reinstall Docker or mount the socket from a different location.
Portainer does not change how Docker works, but places a management layer on top of the existing functionality. The interface translates actions into the same Docker commands that you would run via the CLI, such as `docker container restart` or `docker container rm -f`. For organizations that manage multiple Docker hosts or advanced orchestration, one central interface offers a way to reduce operational complexity and decrease the chance of errors. The question is not whether you need a graphical layer, but when the number of containers and environments exceeds the CLI-only workflow.