cheat-sheets

Portainer

Easily deploy, configure and secure containers in minutes on Docker, Kubernetes, Swarm and Nomad in any cloud, datacenter or device.

Project Homepage: Portainer Documentation: Portainer Docs


Install (Docker, Community Edition) #

bash
docker volume create portainer_data
docker run -d --name portainer --restart=always \
  -p 9443:9443 -p 8000:8000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v portainer_data:/data \
  portainer/portainer-ce:lts

Open https://<HOST>:9443 and create the admin user straight away. The setup window closes after about 5 minutes and Portainer must be restarted if you miss it.

Mounting docker.sock gives Portainer root-equivalent control of the host. Do not expose it to the internet without TLS and strong authentication.

Agent (Manage Another Host) #

bash
docker run -d --name portainer_agent --restart=always \
  -p 9001:9001 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /var/lib/docker/volumes:/var/lib/docker/volumes \
  portainer/agent:lts

Then add an Environment of type Docker Standalone > Agent pointing at <HOST>:9001.

Operations #

COMMANDDESCRIPTION
docker logs portainerCheck start-up and errors
docker pull portainer/portainer-ce:lts && docker rm -f portainer then re-run the install commandUpgrade (data lives in portainer_data)
docker run --rm -v portainer_data:/data portainer/helper-reset-passwordReset the admin password
docker run --rm -v portainer_data:/data -v $(pwd):/backup busybox tar czf /backup/portainer.tgz /dataBack up the data volume

Features Worth Knowing #

  • Stacks: deploy Compose files (see Docker-Compose) from the UI or straight from a Git repository with auto-update.
  • Templates: one-click app deployments.
  • Users and teams: role-based access to environments.
  • Kubernetes: manage namespaces, deployments and apply manifests.

Portainer vs Dockhand #

  • Portainer: manages Docker, Swarm, Kubernetes and Nomad; mature, with Community and paid Business editions and RBAC in Business.
  • Dockhand: Docker only, newer and lighter; Git stacks with webhooks, built-in Grype/Trivy scanning, Hawser agents; BSL 1.1 licence (free for personal and non-production use).
  • Choose Portainer for Kubernetes/Swarm or a long-established tool, Dockhand for a simple Docker-only UI. Full table in Dockhand.
Search all sheets

Tip: / or Ctrl/Cmd+K to open, Esc to close.