Home

Installing Portainer for Docker and Docker Swarm

What is Portainer?

Portainer is a web GUI for managing Docker and Docker Swarm clusters. The Docker CLI is great when you're just running a couple of containers, but once you're juggling multiple containers, services, stacks and networks, the CLI gets tiring fast. Portainer gives you a clean dashboard for inspecting and managing everything, plus monitoring on top.

In this post we'll spin up a Docker Swarm cluster on play-with-docker, install Portainer on it, and walk through the menus.

Spin up a Swarm cluster

Hop over to play-with-docker and start a fresh template-based Swarm cluster.

I'll use 3 managers + 2 workers.

On any manager node, list the cluster:

bash
docker node ls

Installing Portainer

With the cluster up, we can install Portainer. Pick a manager node and download the stack file:

bash
curl -L https://downloads.portainer.io/portainer-agent-stack.yml -o portainer-agent-stack.yml

Deploy the stack:

bash
docker stack deploy --compose-file=portainer-agent-stack.yml portainer

Portainer is now listening on port 9000. Open it, set the admin password, and log in.

That's it.

A tour of the menus

Dashboard — what you'd expect: a high-level view of the cluster — running containers, active services, pulled images, networks, volumes.

App Templates — one-click installers for common stacks. Spin up something like WordPress + MySQL with a couple of clicks.

Stacks — list, inspect, edit, or create stacks running on the Swarm. (A stack is a group of services deployed together.)

Services — same idea but for services. (A service is one or more replicas of a container.)

Containers — the individual running containers across the cluster.

Images, Networks, Volumes, Configs, Secrets — same pattern: list, inspect, edit, create.

Swarm — info on each node in the cluster plus the aggregate CPU and RAM pool.

This is just the tour. Once it's installed on your own cluster, the menus speak for themselves. For day-to-day Docker work I find it a useful complement to the CLI rather than a full replacement — quick visual checks where the CLI would need a few flags chained together.