Self-Host Portainer: Manage All Your Docker Containers in 15 Minutes
Tired of typing docker ps and docker logs every time you need to check a container? Portainer gives you a clean web UI to manage Docker containers, networks, volumes, and even full Docker Swarm clusters — all from your browser. In this guide, you’ll deploy Portainer CE on a fresh VPS and have a production-ready container management dashboard running in under 15 minutes.
Why Self-Host Portainer?
- Visual container management — Start, stop, inspect, and delete containers without touching the CLI
- Multi-environment support — Manage local Docker, remote nodes, and Kubernetes from one UI
- Stack deployments — Deploy full docker-compose stacks directly through the UI
- User access control — Built-in authentication and team management
- Zero vendor lock-in — It’s your infrastructure, your rules
Prerequisites
- A VPS or server with Docker & Docker Compose installed
- Minimum specs: 1 CPU, 1GB RAM, 10GB disk
- A domain or subdomain pointed to your server (optional but recommended for HTTPS)
- Ports 8000 and 9443 available (or 9000 for HTTP)
Step 1: Create the Docker Volume
Portainer needs persistent storage for its database and configuration:
docker volume create portainer_dataStep 2: Deploy Portainer with Docker Compose
Create a docker-compose.yml file:
version: '3.8'services: portainer: image: portainer/portainer-ce:latest container_name: portainer restart: unless-stopped ports: - "8000:8000" - "9443:9443" volumes: - /var/run/docker.sock:/var/run/docker.sock - portainer_data:/data command: -H unix:///var/run/docker.sockvolumes: portainer_data: external: trueDeploy it:
docker compose up -dNote: Port 8000 is for Edge Agent communication (optional). Port 9443 serves the HTTPS UI. If you prefer HTTP on port 9000, replace 9443:9443 with 9000:9000 and access via http://your-server:9000.
Step 3: Complete the Initial Setup
- Navigate to
https://your-server-ip:9443 - Create your admin user (do this immediately — there’s a brief window before it opens to anyone)
- Select "Get Started" to manage your local Docker environment
- You’ll land on the dashboard showing running containers, images, volumes, and networks
Step 4: Add Your First Container (Nginx Example)
Click Containers → Add Container:
- Name:
nginx-demo - Image:
nginx:alpine - Port mapping:
8080 → 80
Click Deploy the container. Visit http://your-server:8080 — you should see the Nginx welcome page. No CLI required.
Step 5: Deploy a Stack (Docker Compose via UI)
Go to Stacks → Add Stack. Name it whoami and paste this:
version: '3.8'services: whoami: image: traefik/whoami ports: - "8081:80"Click Deploy the stack. Portainer handles the compose logic for you. Check http://your-server:8081 to verify.
Verification Checklist
- [ ] Portainer dashboard loads at
https://your-server:9443 - [ ] Admin user created successfully
- [ ] Local Docker environment is connected
- [ ] Nginx demo container runs and responds on port 8080
- [ ] Whoami stack deploys and responds on port 8081
Production Hardening
- Reverse proxy with HTTPS — Put Portainer behind Traefik or Nginx Proxy Manager with a valid SSL certificate
- Disable port 9000/9443 externally — Only expose through your reverse proxy
- Enable LDAP or OAuth — Portainer CE supports external authentication
- Regular backups — Backup the
portainer_datavolume:docker run --rm -v portainer_data:/data -v $(pwd):/backup alpine tar czf /backup/portainer-backup.tar.gz -C /data .
Next Steps
- Add remote Docker hosts via the Portainer Agent
- Deploy a full application stack (e.g., Nextcloud + PostgreSQL + Redis)
- Set up Docker Swarm and manage it from Portainer
- Explore Portainer’s built-in registry management for private images
Self-hosting isn’t just about saving money — it’s about owning your tools. Portainer turns Docker from a CLI-only experience into something your whole team can use.
Related guides: Self-Host Traefik | Self-Host Uptime Kuma | Self-Host n8n