docker.recipes

Portainer Container Management

beginner

Portainer for Docker container management with web UI.

Overview

Portainer is a lightweight, universal container management platform that transforms Docker administration through an intuitive web-based interface. Originally created to simplify Docker operations for users who prefer visual management over command-line tools, Portainer has evolved into a comprehensive solution supporting Docker, Docker Swarm, Kubernetes, and Azure Container Instances. The platform eliminates the complexity of memorizing Docker commands while providing advanced features like role-based access control, template deployment, and GitOps integration. This Portainer deployment connects directly to your local Docker daemon through the Docker socket, creating a centralized management hub for all container operations on your system. The configuration includes both HTTP and HTTPS endpoints, persistent data storage for configurations and user settings, and an isolated network environment. Portainer transforms raw Docker functionality into an accessible dashboard where you can visualize container relationships, monitor resource usage, deploy complex applications through stack templates, and manage multiple Docker environments from a single interface. This setup is ideal for DevOps teams transitioning from manual Docker commands to visual management, homelab enthusiasts managing multiple services, small development teams needing collaborative container oversight, and anyone learning containerization concepts. Portainer bridges the gap between Docker's powerful capabilities and user-friendly operation, making container management accessible without sacrificing advanced functionality. The web interface approach means team members can manage containers without SSH access to the host system.

Key Features

  • Web-based container lifecycle management with real-time status monitoring and resource usage visualization
  • Docker Compose stack deployment through file upload or integrated editor with syntax validation
  • Multi-environment support allowing management of remote Docker hosts, Swarm clusters, and Kubernetes from one interface
  • Application template marketplace with pre-configured popular services and custom template creation
  • Role-based access control with team management and granular permissions for enterprise environments
  • Registry management supporting Docker Hub, private registries, and Azure Container Registry integration
  • GitOps workflow support for automated deployments from Git repositories with webhook triggers
  • Container console access and log streaming directly through the web browser without SSH requirements

Common Use Cases

  • 1Homelab container management where multiple self-hosted services need centralized oversight and maintenance
  • 2Small development teams requiring collaborative Docker management without sharing SSH credentials or CLI training
  • 3Educational environments teaching containerization concepts through visual interface before CLI mastery
  • 4Remote Docker host administration where web access is more practical than command-line SSH sessions
  • 5Container deployment pipelines using Portainer's API for automated stack updates and environment promotion
  • 6Multi-tenant Docker environments where different teams need isolated access to specific containers and resources
  • 7Rapid prototyping scenarios requiring quick container deployment and testing without complex orchestration setup

Prerequisites

  • Docker Engine installed and running on the host system with daemon accessible
  • Minimum 256MB RAM available for Portainer container and 1GB recommended for optimal performance
  • Ports 9000 (HTTP) and 9443 (HTTPS) available and not conflicting with existing services
  • Docker socket access permissions configured correctly for container management operations
  • Basic understanding of Docker concepts like containers, images, volumes, and networks
  • Web browser with JavaScript enabled for full dashboard functionality and real-time updates

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 portainer:
3 image: portainer/portainer-ce:latest
4 container_name: portainer
5 restart: unless-stopped
6 ports:
7 - "${PORTAINER_PORT:-9000}:9000"
8 - "9443:9443"
9 volumes:
10 - /var/run/docker.sock:/var/run/docker.sock
11 - portainer_data:/data
12 networks:
13 - portainer-network
14
15volumes:
16 portainer_data:
17
18networks:
19 portainer-network:
20 driver: bridge

.env Template

.env
1# Portainer
2PORTAINER_PORT=9000

Usage Notes

  1. 1Portainer at http://localhost:9000
  2. 2Create admin on first run
  3. 3Connect to local Docker
  4. 4Manage containers, images, networks

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 portainer:
5 image: portainer/portainer-ce:latest
6 container_name: portainer
7 restart: unless-stopped
8 ports:
9 - "${PORTAINER_PORT:-9000}:9000"
10 - "9443:9443"
11 volumes:
12 - /var/run/docker.sock:/var/run/docker.sock
13 - portainer_data:/data
14 networks:
15 - portainer-network
16
17volumes:
18 portainer_data:
19
20networks:
21 portainer-network:
22 driver: bridge
23EOF
24
25# 2. Create the .env file
26cat > .env << 'EOF'
27# Portainer
28PORTAINER_PORT=9000
29EOF
30
31# 3. Start the services
32docker compose up -d
33
34# 4. View logs
35docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/portainer-management/run | bash

Troubleshooting

  • Cannot connect to Docker endpoint: Verify Docker daemon is running and /var/run/docker.sock is accessible with correct permissions
  • Portainer shows 'Endpoint is down' after startup: Restart the Portainer container and check Docker socket mounting in the compose file
  • Web interface loads but shows no containers: Ensure the Docker socket volume mount is correct and Portainer has read/write access
  • Port 9000 connection refused: Check if another service is using port 9000 or modify PORTAINER_PORT environment variable
  • SSL certificate warnings on port 9443: Portainer generates self-signed certificates; add security exception or configure custom certificates
  • Lost admin password access: Stop Portainer, delete the portainer_data volume, and restart to trigger initial setup wizard again

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space