Manage Docker with Portainer
A visual dashboard for Docker — deploy containers, manage stacks, monitor resources, and control multiple servers from one place.
What is Portainer?
Portainer is a web-based UI for managing Docker. Instead of typing docker ps or docker-compose up in the terminal, you get a visual dashboard showing all your containers, images, volumes, and networks — with buttons to start, stop, view logs, and deploy new services.
Portainer Community Edition (CE) is free and open-source. It can manage a single Docker host, or entire clusters of servers through Docker Swarm — all from one unified dashboard.
- •Visual container management — start, stop, restart, and inspect containers with clicks instead of commands
- •Built-in log viewer and console access for every container
- •App templates for one-click deployments — WordPress, Nginx, MySQL, and many more
- •Multi-server management — control Docker hosts on different machines from one dashboard
Step 1. Install Portainer
Portainer runs as a Docker container itself — you use Docker to deploy the tool that manages Docker. Here's the simplest way to get it running:
docker volume create portainer_data
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
This command does a few things:
- •Creates a named volume for Portainer's data so your settings survive container restarts.
- •Mounts the Docker socket so Portainer can control the host's Docker engine.
- •Exposes port 9443 for HTTPS access and port 8000 for agent connections.
- •Sets
--restart=alwaysso Portainer starts automatically if your server reboots.
After the container starts, open your browser and go to:
https://your-server-ip:9443
You'll see a setup screen. Create an admin username and password, then click "Get Started" to connect to the local Docker environment. The dashboard opens immediately.
- •If you prefer docker-compose, check our Docker Compose guide for the equivalent YAML file.
- •The browser will show a certificate warning because Portainer uses a self-signed certificate. This is normal for local access — click "Advanced" and proceed.
Step 2. Manage Containers Visually
Click "Containers" in the sidebar. You'll see every container on your system with its status, CPU and RAM usage, and quick action buttons. No more docker ps | grep something needed.
- •Click any container name to open a detailed view with real-time logs, resource usage graphs, environment variables, mounted volumes, and network settings.
- •Use the "Console" button to open an interactive terminal inside any running container — great for debugging or running one-off commands.
- •Stop, start, restart, pause, or remove containers with a single click from the action buttons on each row.
- •The "Stats" tab shows live CPU, memory, network, and disk I/O graphs for each container — spot resource hogs instantly.
You can also duplicate a container with different settings by clicking "Duplicate/Edit" — Portainer copies the configuration and lets you tweak ports, volumes, or environment variables before launching the copy.
Step 3. Deploy with Stacks and App Templates
Portainer's "Stacks" feature is a visual docker-compose editor. You paste a compose file, hit deploy, and Portainer creates all the containers, networks, and volumes automatically. This is how most people deploy multi-container applications through Portainer.
- •Go to Stacks → Add Stack, give it a name, and paste your docker-compose.yml content into the web editor.
- •Portainer can also pull compose files directly from a Git repository — great for keeping deployments in sync with version control.
- •After deploying, the stack shows all its containers grouped together. You can update the compose file and redeploy without losing data volumes.
For quick setups, check the "App Templates" section. Portainer ships with 40+ pre-configured templates for popular services like WordPress, Nginx, MySQL, Redis, and MongoDB. Community templates add even more. One click deploys the entire service with sensible defaults.
Step 4. Manage Multiple Servers
Portainer shines when you have Docker running on more than one machine. You can add multiple Docker hosts — a home server, a cloud VPS, and a Raspberry Pi — and manage them all from a single Portainer dashboard.
- •Go to Settings → Environments → Add Environment. Choose "Docker Standalone" for individual servers or "Docker Swarm" for clusters.
- •For remote servers, install the Portainer Agent (a lightweight companion container) on the target machine. The agent handles communication securely without exposing the Docker socket.
- •Once connected, switch between environments using the dropdown at the top of the dashboard. Each environment shows its own containers, stacks, and resource usage independently.
This is ideal if your media server lives on a NAS, your web apps run on a VPS, and your home automation runs on a Raspberry Pi — one dashboard to rule them all.
Step 5. Security Hardening
Portainer has powerful control over your entire Docker environment, so locking it down is critical. Take these steps before exposing it to anything beyond your local network:
- •Enable 2FA. Go to Settings → Authentication and turn on two-factor authentication for all admin accounts. This protects your dashboard even if a password is compromised.
- •Use HTTPS. Portainer defaults to port 9443 with a self-signed certificate. For production, put it behind a reverse proxy like Nginx or Traefik with a proper Let's Encrypt certificate.
- •Restrict access by IP. If you're the only person managing your servers, limit Portainer access to your local network or specific IP ranges.
- •Use role-based access control (RBAC). If multiple people use Portainer, create non-admin accounts with limited permissions. A teammate who only needs to view logs doesn't need the ability to delete containers.
- •Never expose Portainer directly to the internet. Always put it behind a VPN like Tailscale or a reverse proxy with strong authentication. The Docker socket it controls is essentially root access to your server.
Step 6. Manage Images, Volumes, and Networks
Containers are just one part of the Docker ecosystem. Portainer gives you full visibility into the other pieces too:
- •Images — see all downloaded Docker images, how much disk space each uses, and pull new ones from Docker Hub or private registries. Clean up unused images with the "Remove unused" button to reclaim disk space.
- •Volumes — browse all persistent volumes, see which containers are using them, and inspect their contents. This is where your app data lives — databases, config files, uploaded media. Back these up regularly.
- •Networks — view all Docker networks and which containers are connected to each. Create custom bridge networks to isolate groups of services from each other for better security.
Portainer also shows you orphaned resources — volumes not attached to any container, unused networks, and dangling images — so you can clean up and keep your system tidy.
Quick Tips
- •Use Portainer's backup feature (Settings → Backup) to export your configuration regularly. If your Portainer container gets deleted, you can restore everything.
- •Create custom app templates for your own frequently-deployed stacks. Save your compose files as templates and deploy them in two clicks.
- •Use the "Events" view to see a timeline of what happened on your Docker host — container starts, stops, errors, and image pulls.
- •Portainer's "Host" view shows overall server health — disk usage, CPU load, memory, and running Docker version. Check it first when something seems off.
Continue Reading
Ready to LEVEL UP?
Take control of your Docker environment. Portainer turns command-line complexity into a dashboard you'll actually enjoy using.
Browse All How-To Guides