Portainer Complete Setup Guide 2026: Docker Management for Home Labs
Published on January 12, 2026
1. Introduction
1.1 What is Portainer?
Portainer is an open-source, lightweight management UI that simplifies the management of Docker, Docker Swarm, and Kubernetes environments. It provides an intuitive web-based graphical interface that allows users to deploy, manage, and troubleshoot containerized applications without extensive command-line knowledge.
Key Features:
- Container Management: Deploy, start, stop, restart, and remove containers with a click
- Stack Deployment: Deploy multi-container applications using Docker Compose (YAML) files
- Image Management: Pull, push, and manage Docker images from registries
- Volume & Network Management: Create and configure persistent storage and networking
- User Access Control: Role-based access control (RBAC) for team environments
- Multi-Environment Support: Manage Docker standalone, Swarm, and Kubernetes from one UI
- App Templates: One-click deployment of popular applications
- Real-time Monitoring: View logs, stats, and container console access
1.2 Portainer Versions (January 2026)
As of January 2026, the latest stable releases are Portainer Core v2.33.6 LTS and v2.38 STS. Always check the official GitHub releases for the most current version before installation.
| Version | Type | Release Date | Support Until |
|---|---|---|---|
| 2.33.6 LTS | Long Term Support | December 2025 | July 2026 |
| 2.38 STS | Short Term Support | January 2026 | Next STS release |
| 2.39 LTS | Long Term Support | February 2026 (Planned) | โ |
[!NOTE] This guide uses Portainer CE (Community Edition) with the LTS (Long Term Support) tag for maximum stability. The LTS version is recommended for production and home lab environments.
1.3 Portainer Editions Comparison
| Feature | Community Edition (CE) | Business Edition (BE) |
|---|---|---|
| Price | Free, Open Source | Paid (3 nodes free) |
| Docker Management | โ Full | โ Full |
| Kubernetes Management | โ Full | โ Full |
| Docker Swarm | โ Full | โ Full |
| App Templates | โ Basic | โ Enhanced |
| RBAC | โ Basic | โ Advanced |
| External Auth (LDAP/OAuth) | โ Basic | โ Enhanced |
| Registry Management | โ Basic | โ Private registries |
| Activity Logging | โ | โ Full audit logs |
| Kubernetes-as-a-Service | โ | โ Cloud provisioning |
| SSO (Single Sign-On) | โ | โ Full support |
| Support | Community forums | Professional SLA |
[!TIP] Home Lab Recommendation: Portainer CE is perfect for home labs and personal use. Business Edition offers a โHome & Studentโ license (up to 15 nodes) for non-commercial use and a โ3 Nodes Freeโ program for trying BE features.
1.4 Why Use Portainer for Home Labs?
| Benefit | Description |
|---|---|
| Simplified Management | Visual interface eliminates complex CLI commands |
| Centralized Control | Manage all Docker hosts from one dashboard |
| Learning Friendly | Great for beginners learning containerization |
| Low Resource Usage | Lightweight (~20MB container) runs on Raspberry Pi |
| GitOps Support | Deploy stacks directly from Git repositories |
| Community Templates | 500+ pre-made templates for popular apps |
1.5 What This Guide Covers
This comprehensive guide will walk you through:
- Understanding Portainer โ Architecture and core concepts
- System Requirements โ Hardware and software prerequisites
- Installation Methods โ Docker, Docker Swarm, Kubernetes, NAS devices
- Platform-Specific Setup โ Windows, macOS, Linux, Raspberry Pi
- Initial Configuration โ First-time setup and user management
- Container Management โ Deploying and managing containers
- Stack Deployment โ Using Docker Compose with Portainer
- App Templates โ Using and creating custom templates
- Reverse Proxy Integration โ Traefik, Nginx Proxy Manager, Caddy
- Monitoring Integration โ Grafana, Prometheus, cAdvisor
- Edge Agent Deployment โ Managing remote/IoT devices
- Home Lab Use Cases โ Practical deployment examples
- Backup & Restore โ Protecting your Portainer configuration
- Troubleshooting โ Common issues and solutions
2. System Requirements
2.1 Hardware Requirements
Portainer Server (Minimum)
| Component | Minimum | Recommended |
|---|---|---|
| CPU | 1 core | 2+ cores |
| RAM | 1 GB | 2+ GB |
| Storage | 1 GB | 10+ GB |
| Network | 10 Mbps | 100+ Mbps |
[!NOTE] Portainer itself is very lightweight (~50MB). The requirements above include headroom for the Docker engine and a few containers. Your actual needs depend on the containers you run.
Recommended Home Lab Configurations
| Use Case | Hardware Suggestion |
|---|---|
| Beginner/Light | Raspberry Pi 4 (4GB RAM) |
| Standard Home Lab | Intel NUC / Mini PC (8GB RAM, 256GB SSD) |
| Media Server | Custom PC (16GB RAM, Large HDDs) |
| Advanced/VM Host | Server-grade (32GB+ RAM, RAID storage) |
2.2 Supported Operating Systems
For Docker Host (Server)
| Platform | Supported Versions |
|---|---|
| Linux | Ubuntu 20.04+, Debian 11+, Fedora 38+, CentOS/RHEL 8+, openSUSE |
| Windows | Windows 10/11 Pro/Enterprise with WSL2, Windows Server 2019+ |
| macOS | macOS 12 (Monterey) or later |
| ARM Devices | Raspberry Pi OS (64-bit), Ubuntu for ARM |
| NAS | Synology DSM 7+, QNAP QTS 5+, TrueNAS Scale |
2.3 Network Requirements
| Port | Protocol | Purpose | Required |
|---|---|---|---|
| 9443 | TCP/HTTPS | Portainer Web UI (Secure) | Yes |
| 9000 | TCP/HTTP | Portainer Web UI (Legacy) | Optional |
| 8000 | TCP | Edge Agent Tunnel Server | For Edge features |
[!IMPORTANT] Portainer 2.x defaults to HTTPS on port 9443 with a self-signed certificate. Port 9000 (HTTP) can be enabled for legacy compatibility but is not recommended for security.
2.4 Docker Version Compatibility
| Portainer Version | Docker Engine | Docker Compose |
|---|---|---|
| 2.33 LTS | 23.x - 27.x | v2.20+ |
| 2.37 STS | 24.x - 27.x | v2.20+ |
3. Installing Docker
Portainer runs as a Docker container, so Docker must be installed first. Follow the instructions for your operating system.
3.1 Linux (Debian/Ubuntu)
These commands work for Debian 11+, Ubuntu 20.04+, and derivatives like Linux Mint.
Step 1: Update System Packages
# Update package lists and upgrade existing packages
sudo apt update && sudo apt upgrade -y What this does: Ensures your system has the latest security patches before installing new software.
Step 2: Install Prerequisites
# Install packages required for Docker's repository
sudo apt install -y ca-certificates curl gnupg lsb-release Step 3: Add Dockerโs Official GPG Key
# Create directory for apt keyrings
sudo install -m 0755 -d /etc/apt/keyrings
# Download and add Docker's GPG key
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release && echo "$ID")/gpg |
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Set correct permissions
sudo chmod a+r /etc/apt/keyrings/docker.gpg Step 4: Add Docker Repository
# Add Docker's official apt repository
echo
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$(. /etc/os-release && echo "$ID") $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update package lists with new repository
sudo apt update Step 5: Install Docker Engine
# Install Docker and all required components
sudo apt install -y docker-ce docker-ce-cli containerd.io
docker-buildx-plugin docker-compose-plugin Step 6: Add User to Docker Group
# Add current user to docker group (avoids needing sudo)
sudo usermod -aG docker $USER
# Apply group changes (or log out and back in)
newgrp docker [!WARNING] You must log out and log back in for group changes to take effect.
Step 7: Verify Installation
# Check Docker version
docker --version
# Check Docker Compose version
docker compose version
# Run test container
docker run hello-world 3.2 Linux (RHEL/Fedora/CentOS)
Fedora
# Install Docker
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Start and enable Docker
sudo systemctl start docker
sudo systemctl enable docker
# Add user to docker group
sudo usermod -aG docker $USER
newgrp docker RHEL/CentOS/Rocky Linux/AlmaLinux
# Install prerequisites
sudo yum install -y yum-utils
# Add Docker repository
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# Install Docker
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Start and enable Docker
sudo systemctl start docker
sudo systemctl enable docker
# Add user to docker group
sudo usermod -aG docker $USER
newgrp docker 3.3 Windows (Docker Desktop with WSL2)
Prerequisites
- Windows 10 version 2004+ (Build 19041+) or Windows 11
- 64-bit processor with virtualization support
- Hardware virtualization enabled in BIOS/UEFI
- Minimum 4 GB RAM (8 GB+ recommended)
Step 1: Enable WSL2
Open PowerShell as Administrator:
# Enable WSL feature
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# Enable Virtual Machine Platform
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart Restart your computer after these commands.
Step 2: Set WSL2 as Default
After restart, open PowerShell as Administrator:
# Set WSL2 as the default version
wsl --set-default-version 2
# Update WSL to latest version
wsl --update
# Verify WSL version
wsl --version Step 3: Install a Linux Distribution (Recommended)
# List available distributions
wsl --list --online
# Install Ubuntu (recommended)
wsl --install -d Ubuntu Step 4: Download and Install Docker Desktop
- Download from docker.com/products/docker-desktop
- Run the installer (
Docker Desktop Installer.exe) - Ensure โUse WSL 2 instead of Hyper-Vโ is checked
- Complete installation and restart if prompted
Step 5: Configure Docker Desktop
- Launch Docker Desktop
- Go to Settings โ General: Enable โUse the WSL 2 based engineโ
- Go to Settings โ Resources โ WSL Integration: Enable for your Linux distro
- Click Apply & Restart
Step 6: Verify Installation
# Check Docker version
docker --version
# Check Docker Compose version
docker compose version
# Run test container
docker run hello-world 3.4 macOS (Docker Desktop)
Prerequisites
- macOS 12 (Monterey) or later
- Apple Silicon (M1/M2/M3/M4) or Intel processor
- Minimum 4 GB RAM (8 GB+ recommended)
Step 1: Download Docker Desktop
- Go to docker.com/products/docker-desktop
- Select the correct version:
- Apple Silicon for M1/M2/M3/M4 Macs
- Intel for older Intel-based Macs
Step 2: Install Docker Desktop
- Open the downloaded
.dmgfile - Drag Docker to Applications
- Launch Docker from Applications
- Accept the license agreement
Step 3: Install Rosetta 2 (Apple Silicon Only)
# Install Rosetta 2 for x86 emulation
softwareupdate --install-rosetta Step 4: Verify Installation
# Check Docker version
docker --version
# Check Docker Compose version
docker compose version
# Run test container
docker run hello-world Alternative: Install via Homebrew
# Install Docker Desktop using Homebrew
brew install --cask docker
# Launch Docker Desktop
open /Applications/Docker.app 3.5 Raspberry Pi (64-bit OS)
Prerequisites
- Raspberry Pi 4 (4GB+ RAM recommended) or Raspberry Pi 5
- Raspberry Pi OS (64-bit) Lite or Full
- microSD card (32GB+) or SSD via USB
Step 1: Update System
# Update and upgrade packages
sudo apt update && sudo apt full-upgrade -y
# Reboot if kernel was updated
sudo reboot Step 2: Install Docker
# Install Docker using convenience script
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Add user to docker group
sudo usermod -aG docker $USER
# Apply changes (or reboot)
newgrp docker Step 3: Verify Installation
# Check Docker version
docker --version
# Check architecture (should show arm64)
docker info | grep Architecture
# Run test container
docker run hello-world [!TIP] For better performance on Raspberry Pi, use an SSD connected via USB instead of a microSD card. This significantly improves I/O performance for databases and Docker volumes.
4. Installing Portainer
Now that Docker is installed, letโs deploy Portainer. Choose the method that matches your environment.
4.1 Docker Standalone (Single Host)
This is the most common installation for home labs managing a single Docker host.
Method 1: Using Docker Run (Quick Start)
Linux/macOS:
# Create a volume for Portainer data
docker volume create portainer_data
# Deploy Portainer CE with LTS tag
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:lts Windows (PowerShell):
# Create a volume for Portainer data
docker volume create portainer_data
# Deploy Portainer CE with LTS tag
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:lts Command Breakdown:
| Flag | Purpose |
|---|---|
-d | Run container in detached (background) mode |
-p 8000:8000 | Map Edge Agent tunnel port |
-p 9443:9443 | Map HTTPS web UI port |
--name portainer | Assign container name |
--restart=always | Auto-restart on reboot/crash |
-v /var/run/docker.sock:... | Allow Portainer to manage Docker |
-v portainer_data:/data | Persist Portainer configuration |
portainer/portainer-ce:lts | Use LTS (stable) image |
Method 2: Using Docker Compose (Recommended)
Create a directory for your Portainer stack:
Linux/macOS:
mkdir -p ~/docker/portainer && cd ~/docker/portainer Windows (PowerShell):
New-Item -ItemType Directory -Force -Path "$env:USERPROFILEdockerportainer"
Set-Location "$env:USERPROFILEdockerportainer" Create docker-compose.yml:
services:
portainer:
image: portainer/portainer-ce:lts
container_name: portainer
restart: always
ports:
- "8000:8000" # Edge Agent tunnel
- "9443:9443" # HTTPS Web UI
# - "9000:9000" # HTTP Web UI (optional, not recommended)
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
environment:
- TZ=UTC # Set your timezone
volumes:
portainer_data:
name: portainer_data
networks:
default:
name: portainer_network Deploy the stack:
# Deploy Portainer
docker compose up -d
# View logs
docker compose logs -f portainer Verify Portainer is Running
# Check container status
docker ps | grep portainer
# Expected output:
# CONTAINER ID IMAGE ... PORTS NAMES
# abc123... portainer/portainer-ce:lts ... 0.0.0.0:9443->9443/tcp portainer 4.2 Docker Swarm Deployment
For managing a Docker Swarm cluster with Portainer.
Prerequisites
- A running Docker Swarm cluster (at least one manager node)
- SSH access to the Swarm manager
Step 1: Initialize Swarm (If Not Already Done)
On your manager node:
# Initialize Docker Swarm
docker swarm init --advertise-addr <MANAGER_IP>
# Note the join token for worker nodes
docker swarm join-token worker Step 2: Deploy Portainer Agent Stack
Download and deploy the official stack file:
# Download the Portainer Agent stack file
curl -L https://downloads.portainer.io/ce-lts/portainer-agent-stack.yml
-o portainer-agent-stack.yml
# Deploy the stack
docker stack deploy -c portainer-agent-stack.yml portainer Or create the stack file manually:
# portainer-agent-stack.yml
version: '3.8'
services:
agent:
image: portainer/agent:lts
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
networks:
- agent_network
deploy:
mode: global
placement:
constraints: [node.platform.os == linux]
portainer:
image: portainer/portainer-ce:lts
command: -H tcp://tasks.agent:9001 --tlsskipverify
ports:
- "9443:9443"
- "9000:9000"
- "8000:8000"
volumes:
- portainer_data:/data
networks:
- agent_network
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
networks:
agent_network:
driver: overlay
attachable: true
volumes:
portainer_data: Step 3: Verify Deployment
# Check stack status
docker stack services portainer
# Check Portainer service
docker service logs portainer_portainer 4.3 Kubernetes Deployment
For managing Kubernetes clusters with Portainer.
Method 1: Using Helm (Recommended)
# Add Portainer Helm repository
helm repo add portainer https://portainer.github.io/k8s/
helm repo update
# Install Portainer (with NodePort)
helm install --create-namespace -n portainer portainer portainer/portainer
# Install with LoadBalancer (for cloud providers)
helm install --create-namespace -n portainer portainer portainer/portainer
--set service.type=LoadBalancer Method 2: Using YAML Manifests
# Deploy using official manifests (NodePort)
kubectl apply -n portainer -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml
# Create namespace first if needed
kubectl create namespace portainer Access Portainer
# Get the NodePort
kubectl get svc -n portainer
# Access via: https://<NODE_IP>:<NODEPORT> 5. Initial Configuration
5.1 First-Time Setup
Access Portainer: Open your browser and navigate to:
https://localhost:9443(local access)https://<SERVER_IP>:9443(remote access)
Accept Security Warning: Portainer uses a self-signed certificate by default. Click โAdvancedโ โ โProceedโ to continue.
Create Admin User:
- Username: Choose a username (default:
admin) - Password: Must be at least 12 characters
- Click Create user
- Username: Choose a username (default:
[!IMPORTANT] Choose a strong password for the admin account. This is your primary security layer. Use a password manager to generate and store a complex password.
5.2 Connect Your Environment
After creating your admin account, youโll see the Environment Wizard.
For Docker Standalone (Local Docker Socket)
- Select Docker โ Connect
- Choose Socket connection
- Click Connect
- Portainer will automatically detect your local Docker engine
For Remote Docker Host (TCP)
- Select Docker โ Connect
- Choose API connection
- Enter the Docker API URL:
tcp://<DOCKER_HOST_IP>:2375 - Configure TLS if enabled
- Click Connect
[!WARNING] Exposing the Docker API over TCP without TLS is a security risk. Always use TLS certificates for remote Docker connections or use Portainer Agent instead.
5.3 Portainer Agent (Recommended for Remote Hosts)
The Portainer Agent is a lightweight container that provides secure communication between Portainer Server and remote Docker hosts.
Deploy Agent on Remote Host
# On the REMOTE Docker host, run:
docker run -d
-p 9001:9001
--name portainer_agent
--restart=always
-v /var/run/docker.sock:/var/run/docker.sock
-v /var/lib/docker/volumes:/var/lib/docker/volumes
portainer/agent:lts Connect Agent in Portainer
- Go to Environments โ Add environment
- Select Docker โ Agent
- Enter:
- Name: Descriptive name for this environment
- Environment URL:
<REMOTE_HOST_IP>:9001
- Click Connect
6. Managing Containers
6.1 Container Dashboard Overview
The Containers view shows all running and stopped containers with key information:
| Column | Description |
|---|---|
| Name | Container name (clickable for details) |
| State | Running, Stopped, Paused, etc. |
| Quick Actions | Logs, Inspect, Stats, Console, Restart |
| Stack | Associated Docker Compose stack |
| Image | Container image and tag |
| Created | When the container was created |
| IP Address | Containerโs network IP |
| Published Ports | Host:Container port mappings |
6.2 Deploying a Container
Method 1: Using the Web Form
- Go to Containers โ Add container
- Fill in the form:
- Name: Container name
- Image: Docker image (e.g.,
nginx:latest) - Port mapping: Host port โ Container port
- Volumes: Bind mounts or volumes
- Environment variables: Key-value pairs
- Configure advanced options:
- Restart policy: Always, Unless-stopped, On-failure
- Runtime & Resources: CPU/Memory limits
- Labels: Metadata for organization
- Click Deploy the container
Method 2: From Docker Hub
- Go to App Templates or search Docker Hub in the image field
- Pull the image: Enter the full image name and tag
- Configure as above
6.3 Container Operations
| Action | Description |
|---|---|
| Start | Start a stopped container |
| Stop | Gracefully stop a running container |
| Kill | Force stop a container |
| Restart | Stop and start a container |
| Pause | Freeze container processes |
| Resume | Unfreeze paused container |
| Remove | Delete the container |
| Duplicate | Create a copy with same settings |
| Recreate | Remove and recreate with same settings |
6.4 Viewing Logs
- Click the Logs icon or go to Container โ Logs
- Options:
- Auto-refresh: Real-time log streaming
- Wrap lines: Wrap long lines
- Timestamps: Show log timestamps
- Since: Filter logs by time
- Search: Filter logs by keyword
6.5 Console Access
- Click the Console icon or go to Container โ Console
- Select the shell:
/bin/bash(most Linux containers)/bin/sh(Alpine-based containers)- Custom command
- Click Connect
7. Stack Deployment (Docker Compose)
Stacks are the Portainer equivalent of Docker Compose deployments.
7.1 Creating a Stack
Method 1: Web Editor
- Go to Stacks โ Add stack
- Enter a Name for your stack
- Choose Web editor
- Paste your Docker Compose YAML content
- (Optional) Add environment variables
- Click Deploy the stack
Method 2: Upload Compose File
- Go to Stacks โ Add stack
- Enter a Name
- Choose Upload
- Select your
docker-compose.ymlfile - Click Deploy the stack
Method 3: Git Repository (GitOps)
- Go to Stacks โ Add stack
- Enter a Name
- Choose Repository
- Enter:
- Repository URL: Git repo URL
- Reference: Branch or tag
- Compose path: Path to docker-compose.yml
- Authentication: If private repo
- Enable Automatic updates for GitOps workflow
- Click Deploy the stack
7.2 Example: Deploying a Media Stack
# Media Server Stack Example
services:
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
restart: unless-stopped
ports:
- "8096:8096"
volumes:
- jellyfin_config:/config
- jellyfin_cache:/cache
- /path/to/media:/media:ro
environment:
- TZ=UTC
radarr:
image: linuxserver/radarr:latest
container_name: radarr
restart: unless-stopped
ports:
- "7878:7878"
volumes:
- radarr_config:/config
- /path/to/downloads:/downloads
- /path/to/movies:/movies
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
sonarr:
image: linuxserver/sonarr:latest
container_name: sonarr
restart: unless-stopped
ports:
- "8989:8989"
volumes:
- sonarr_config:/config
- /path/to/downloads:/downloads
- /path/to/tv:/tv
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
volumes:
jellyfin_config:
jellyfin_cache:
radarr_config:
sonarr_config: 7.3 Managing Stacks
| Action | Description |
|---|---|
| Start | Start all containers in the stack |
| Stop | Stop all containers in the stack |
| Delete | Remove the stack and all containers |
| Edit | Modify the compose file and redeploy |
| Migrate | Move stack between environments |
| Pull and Redeploy | Update images and recreate containers |
8. App Templates
8.1 Using Built-in Templates
- Go to App Templates
- Browse or search for an application
- Click on the template
- Configure options (name, ports, volumes)
- Click Deploy the container
8.2 Adding Custom Template Sources
Portainer supports external template sources from the community.
- Go to Settings โ App Templates
- Enable Use external templates
- Enter the template URL:
- Official Portainer Templates:
https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json - Self-Hosted Templates by Lissy93:
https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
- Official Portainer Templates:
- Click Save settings
- Refresh the App Templates page
8.3 Popular Community Template Sources
| Source | URL | Description |
|---|---|---|
| Portainer Official | https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json | Official templates |
| Lissy93 Templates | https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json | 500+ self-hosted app templates |
| Homelab Templates | https://raw.githubusercontent.com/SelfhostedPro/selfhosted_templates/master/Template/portainer-v2.json | Curated homelab templates |
8.4 Creating Custom Templates
You can create custom templates from existing containers or stacks.
From Container
- Go to Containers
- Select a container
- Click Duplicate/Edit
- Configure as needed
- Click Actions โ Create template
From Stack
- Go to Stacks โ select a stack
- Click Template โ Create
- Enter template details:
- Title: Template name
- Description: What it does
- Logo: Optional icon URL
- Categories: For organization
- Save the template
9. NAS Device Installation
9.1 Synology NAS (DSM 7+)
Prerequisites
- Synology NAS with DSM 7.0 or later
- Container Manager package installed
Method 1: Using Container Manager UI
- Open Container Manager from DSM
- Go to Registry โ Search for
portainer/portainer-ce - Download the
ltstag - Go to Image โ Select portainer-ce โ Run
- Configure container:
- Container Name: portainer
- Enable auto-restart: Yes
- Port Settings:
- Local: 9443, Container: 9443 (HTTPS)
- Local: 8000, Container: 8000 (Edge)
- Volume Settings:
- Add file:
/var/run/docker.sockโ/var/run/docker.sock - Add folder:
/docker/portainerโ/data
- Add file:
- Click Done โ Apply
Method 2: Using SSH (Recommended)
- Enable SSH in Control Panel โ Terminal & SNMP
- Connect via SSH:
ssh username@synology-ip - Run Portainer:
# Create data directory
sudo mkdir -p /volume1/docker/portainer
# Deploy Portainer
sudo docker run -d
--name portainer
--restart=always
-p 8000:8000
-p 9443:9443
-v /var/run/docker.sock:/var/run/docker.sock
-v /volume1/docker/portainer:/data
portainer/portainer-ce:lts 9.2 QNAP NAS (QTS 5+)
Prerequisites
- QNAP NAS with QTS 5.0 or later
- Container Station installed
Method 1: Using Container Station
- Open Container Station
- Go to Create โ Create Application
- Give it a name (e.g.,
portainer) - Paste the following YAML:
version: "3"
services:
portainer:
image: portainer/portainer-ce:lts
container_name: portainer
restart: always
ports:
- "8000:8000"
- "9443:9443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /share/Container/portainer:/data - Click Create
Method 2: Using SSH
# SSH into QNAP
ssh admin@qnap-ip
# Create data directory
mkdir -p /share/Container/portainer
# Deploy Portainer
docker run -d
--name portainer
--restart=always
-p 8000:8000
-p 9443:9443
-v /var/run/docker.sock:/var/run/docker.sock
-v /share/Container/portainer:/data
portainer/portainer-ce:lts 9.3 TrueNAS Scale
TrueNAS Scale has native Docker support but requires specific configuration for Portainer.
Method 1: Using a VM or Jail
The recommended approach is to run Portainer inside a VM or jail for full control.
- Create a Ubuntu VM in TrueNAS
- Install Docker in the VM (see Section 3.1)
- Deploy Portainer normally
Method 2: Native Docker (Advanced)
[!WARNING] TrueNAS Scaleโs native Docker integration may conflict with Portainer. This method requires disabling TrueNASโs application management.
- SSH into TrueNAS Scale
- Unset the Application Pool (removes ix-applications dataset management)
- Deploy Portainer:
docker run -d
--name portainer
--restart=always
-p 8000:8000
-p 9443:9443
-v /var/run/docker.sock:/var/run/docker.sock
-v /mnt/pool/portainer_data:/data
portainer/portainer-ce:lts 10. Reverse Proxy Integration
10.1 Nginx Proxy Manager
Nginx Proxy Manager (NPM) provides a user-friendly UI for setting up reverse proxies with automatic SSL.
Step 1: Ensure Both Are on Same Network
Create a shared Docker network:
docker network create proxy_network Update Portainer to use this network:
# docker-compose.yml for Portainer
services:
portainer:
image: portainer/portainer-ce:lts
container_name: portainer
restart: always
ports:
- "9443:9443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
networks:
- proxy_network
volumes:
portainer_data:
networks:
proxy_network:
external: true Step 2: Configure NPM Proxy Host
- Open Nginx Proxy Manager (usually port 81)
- Go to Proxy Hosts โ Add Proxy Host
- Configure:
- Domain Names:
portainer.yourdomain.com - Scheme:
https - Forward Hostname/IP:
portainer - Forward Port:
9443 - Block Common Exploits: Enable
- Websockets Support: Enable
- Domain Names:
- SSL Tab:
- Request a new SSL certificate
- Force SSL: Enable
- HTTP/2 Support: Enable
- Click Save
10.2 Traefik
Traefik provides dynamic Docker-aware reverse proxying with automatic SSL.
Docker Compose with Traefik Labels
services:
portainer:
image: portainer/portainer-ce:lts
container_name: portainer
restart: always
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
labels:
- "traefik.enable=true"
- "traefik.http.routers.portainer.rule=Host(`portainer.yourdomain.com`)"
- "traefik.http.routers.portainer.entrypoints=websecure"
- "traefik.http.routers.portainer.tls.certresolver=letsencrypt"
- "traefik.http.services.portainer.loadbalancer.server.port=9000"
networks:
- traefik_network
volumes:
portainer_data:
networks:
traefik_network:
external: true [!NOTE] When using Traefik, Portainer should use HTTP internally (port 9000) as Traefik handles SSL termination.
10.3 Caddy
Caddy provides automatic HTTPS with minimal configuration.
Caddyfile Example
portainer.yourdomain.com {
reverse_proxy portainer:9443 {
transport http {
tls_insecure_skip_verify
}
}
} Or for HTTP backend (recommended):
portainer.yourdomain.com {
reverse_proxy portainer:9000
} 11. Monitoring Integration
11.1 Prometheus and Grafana Stack
Deploy a complete monitoring stack alongside Portainer.
Docker Compose Monitoring Stack
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.enable-lifecycle'
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
ports:
- "9100:9100"
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
privileged: true
volumes:
prometheus_data:
grafana_data: Prometheus Configuration
Create prometheus.yml:
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'node-exporter'
static_configs:
- targets: ['node-exporter:9100']
- job_name: 'cadvisor'
static_configs:
- targets: ['cadvisor:8080'] Connect Grafana to Prometheus
- Access Grafana at
http://server-ip:3000 - Login (default: admin/admin)
- Go to Configuration โ Data Sources โ Add data source
- Select Prometheus
- URL:
http://prometheus:9090 - Click Save & Test
Import Dashboards
Popular dashboards for Docker monitoring:
| Dashboard ID | Name | Description |
|---|---|---|
| 1860 | Node Exporter Full | Complete host metrics |
| 893 | Docker Container | Container-specific metrics |
| 179 | Docker Overview | Summary of all containers |
To import: Go to Dashboards โ Import โ Enter Dashboard ID โ Load
12. Edge Agent for Remote Management
The Edge Agent allows managing remote Docker environments that may be behind firewalls or NAT.
12.1 How Edge Agent Works
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Home Lab Server โ
โ (Portainer Server) โ
โ Ports: 9443 (UI), 8000 (Tunnel) โ
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Outbound TLS Tunnel
โโโโโโโโโโโโโดโโโโโโโโโโโโ
โ โ
โโโโโโโผโโโโโโ โโโโโโโผโโโโโโ
โ Remote โ โ IoT โ
โ Server โ โ Device โ
โ (Edge) โ โ (Edge) โ
โโโโโโโโโโโโโ โโโโโโโโโโโโโ Key Points:
- Edge Agent initiates outbound connection to Portainer Server
- No inbound ports needed on remote devices
- Works through NAT and firewalls
- Encrypted TLS tunnel
12.2 Deploying Edge Agent
Step 1: Prepare Portainer Server
Ensure port 8000 is accessible on your Portainer Server:
# Verify port 8000 is exposed
docker ps | grep portainer
# Should show: 0.0.0.0:8000->8000/tcp Step 2: Add Edge Environment in Portainer
- Go to Environments โ Add environment
- Select Docker โ Edge Agent
- Configure:
- Name: Remote device name
- Portainer API server URL:
https://your-portainer-server:9443
- Click Create
- Copy the generated deployment command
Step 3: Run Edge Agent on Remote Device
Run the command provided by Portainer on your remote device:
docker run -d
-v /var/run/docker.sock:/var/run/docker.sock
-v /var/lib/docker/volumes:/var/lib/docker/volumes
-v /:/host
-v portainer_agent_data:/data
--restart always
-e EDGE=1
-e EDGE_ID=<unique_edge_id>
-e EDGE_KEY=<edge_key>
-e EDGE_INSECURE_POLL=1
--name portainer_edge_agent
portainer/agent:lts [!NOTE] The
EDGE_INSECURE_POLL=1flag is required if your Portainer Server uses a self-signed certificate.
12.3 Use Cases for Edge Agent
| Use Case | Description |
|---|---|
| Remote Servers | Manage VPS or cloud instances from home lab |
| Branch Offices | Centralized management of distributed sites |
| IoT Gateways | Deploy and update containerized IoT applications |
| Raspberry Pi Fleet | Manage multiple Pis from one dashboard |
| Home Automation | Remote management of Home Assistant, etc. |
13. Home Lab Use Cases
13.1 Media Server Stack
A complete media automation stack managed through Portainer.
Components
| Application | Purpose | Port |
|---|---|---|
| Jellyfin | Media streaming | 8096 |
| Radarr | Movie management | 7878 |
| Sonarr | TV show management | 8989 |
| Prowlarr | Indexer management | 9696 |
| qBittorrent | Download client | 8080 |
| Bazarr | Subtitle management | 6767 |
Deployment Tips
- Create a dedicated stack in Portainer
- Use shared volumes for media library
- Configure proper user/group IDs (PUID/PGID)
- Set up reverse proxy for external access
13.2 Privacy & Security Stack
Self-hosted privacy tools.
| Application | Purpose | Port |
|---|---|---|
| Pi-hole | DNS ad blocking | 53, 80 |
| Vaultwarden | Password manager | 80 |
| WireGuard | VPN server | 51820 |
| Authelia | SSO/2FA | 9091 |
13.3 Productivity Stack
Self-hosted productivity suite.
| Application | Purpose | Port |
|---|---|---|
| Nextcloud | File sync & office | 80 |
| Paperless-ngx | Document management | 8000 |
| Gitea | Git repositories | 3000 |
| Uptime Kuma | Status monitoring | 3001 |
| Homepage | Dashboard | 3000 |
13.4 Home Automation Stack
| Application | Purpose | Port |
|---|---|---|
| Home Assistant | Smart home hub | 8123 |
| Mosquitto | MQTT broker | 1883 |
| Node-RED | Automation flows | 1880 |
| Zigbee2MQTT | Zigbee bridge | 8080 |
14. Backup and Restore
14.1 What to Back Up
| Component | Location | Priority |
|---|---|---|
| Portainer data | /data volume | Critical |
| Stack definitions | Export from UI or Git | High |
| Container configurations | Documented in Compose files | High |
| Persistent volumes | Various locations | Critical |
14.2 Manual Backup
Portainer Data Volume
# Create backup directory
mkdir -p ~/backups/portainer
# Backup Portainer data volume
docker run --rm
-v portainer_data:/data
-v ~/backups/portainer:/backup
alpine tar czf /backup/portainer_data_$(date +%Y%m%d).tar.gz -C /data . Export Stack Definitions
- Go to Stacks in Portainer
- Click on each stack
- Copy the compose file content
- Save to version control (Git)
14.3 Automated Backup with Docker
Create a backup container that runs on schedule:
services:
backup:
image: offen/docker-volume-backup:latest
container_name: backup
restart: unless-stopped
volumes:
- portainer_data:/backup/portainer:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ~/backups:/archive
environment:
- BACKUP_CRON_EXPRESSION=0 2 * * * # Daily at 2 AM
- BACKUP_FILENAME=portainer-%Y%m%d.tar.gz
- BACKUP_RETENTION_DAYS=7 14.4 Restore Procedure
Restore Portainer Data
# Stop Portainer
docker stop portainer
# Restore data
docker run --rm
-v portainer_data:/data
-v ~/backups/portainer:/backup
alpine sh -c "rm -rf /data/* && tar xzf /backup/portainer_data_YYYYMMDD.tar.gz -C /data"
# Start Portainer
docker start portainer 15. Updating Portainer
15.1 Update Using Docker CLI
# Stop and remove current container
docker stop portainer
docker rm portainer
# Pull latest LTS image
docker pull portainer/portainer-ce:lts
# Recreate container (same command as installation)
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:lts 15.2 Update Using Docker Compose
# Navigate to stack directory
cd ~/docker/portainer
# Pull new image
docker compose pull
# Recreate container with new image
docker compose up -d 15.3 Update Using Portainer (Recreate)
- Go to Containers โ portainer
- Click Recreate
- Enable Pull latest image
- Click Recreate
[!WARNING] Always backup your Portainer data before updating. While updates are generally smooth, having a backup ensures you can recover if something goes wrong.
16. Security Best Practices
16.1 Access Control
| Practice | Implementation |
|---|---|
| Strong admin password | 16+ characters, mixed case, numbers, symbols |
| Limit admin accounts | Only create admin users when necessary |
| Use RBAC | Create roles with minimal required permissions |
| Regular audits | Review user access periodically |
16.2 Network Security
| Practice | Implementation |
|---|---|
| Use HTTPS only | Disable HTTP port 9000 |
| Valid SSL certificates | Use Letโs Encrypt via reverse proxy |
| Firewall rules | Only expose necessary ports |
| VPN access | Use Tailscale or WireGuard for remote access |
16.3 Container Security
| Practice | Implementation |
|---|---|
| Use official images | Stick to trusted sources |
| Pin image versions | Avoid latest tag in production |
| Regular updates | Keep containers updated |
| Resource limits | Set CPU/memory limits |
16.4 Portainer-Specific Settings
- Disable unused features: Settings โ Authentication โ Disable options you donโt use
- Set session timeout: Settings โ Authentication โ Set appropriate timeout
- Enable webhooks cautiously: Only if needed, with proper authentication
- Regular backups: Automate backups of Portainer data
17. Troubleshooting
17.1 Common Issues
Cannot Access Portainer Web UI
Symptoms: Browser shows connection refused or timeout
Solutions:
# Check if container is running
docker ps | grep portainer
# Check container logs
docker logs portainer
# Verify port is listening
netstat -tlnp | grep 9443 # Linux
netstat -an | findstr 9443 # Windows
# Check firewall
sudo ufw status # Linux Portainer Cannot Connect to Docker
Symptoms: โUnable to connect to Dockerโ error
Solutions:
# Verify Docker socket permissions
ls -la /var/run/docker.sock
# Should show: srw-rw---- 1 root docker
# Restart Portainer
docker restart portainer
# Recreate with socket mount
docker rm -f portainer
docker run -d ... -v /var/run/docker.sock:/var/run/docker.sock ... Stacks Wonโt Deploy
Symptoms: Stack deployment fails with errors
Solutions:
- Validate YAML syntax at yamlvalidator.com
- Check for port conflicts with existing containers
- Ensure all referenced images exist
- Verify volume paths are correct
Edge Agent Wonโt Connect
Symptoms: Edge environment shows disconnected
Solutions:
# On remote device, check agent status
docker logs portainer_edge_agent
# Verify connectivity to Portainer server
curl -k https://portainer-server:9443
# Check if port 8000 is accessible
nc -zv portainer-server 8000 17.2 Performance Issues
| Issue | Solution |
|---|---|
| Slow UI | Increase container memory limit |
| High CPU | Check for container restart loops |
| Database errors | Backup and recreate data volume |
17.3 Getting Help
- Official Documentation: docs.portainer.io
- GitHub Issues: github.com/portainer/portainer
- Community Forum: community.portainer.io
- Discord: Portainer Discord server
- Reddit: r/portainer, r/selfhosted, r/homelab
18. Quick Reference Commands
18.1 Installation Commands Summary
Linux
# Create volume and run Portainer
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:lts Windows (PowerShell)
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:lts macOS
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:lts 18.2 Common Management Commands
# View Portainer logs
docker logs portainer
# Restart Portainer
docker restart portainer
# Stop Portainer
docker stop portainer
# Update Portainer
docker stop portainer && docker rm portainer
docker pull portainer/portainer-ce:lts
# Then run the installation command again
# Backup Portainer data
docker run --rm -v portainer_data:/data -v $(pwd):/backup
alpine tar czf /backup/portainer_backup.tar.gz -C /data . 18.3 Useful Portainer URLs
| URL | Purpose |
|---|---|
https://localhost:9443 | Local Portainer access |
https://server-ip:9443 | Remote Portainer access |
https://localhost:9443/api/system/status | API health check |
19. Conclusion
Portainer transforms Docker management from a command-line endeavor into an intuitive, visual experience. Whether youโre managing a single Raspberry Pi or a fleet of edge devices, Portainer provides the tools to deploy, monitor, and maintain your containerized applications with ease.
Key Takeaways
- Start Simple: Begin with Docker Standalone installation
- Use LTS: The LTS tag provides stability for home labs
- Embrace Stacks: Docker Compose via Portainer is powerful
- Secure Access: Use reverse proxies and VPNs for remote access
- Backup Regularly: Protect your Portainer configuration
- Explore Templates: Community templates speed up deployments
- Monitor Everything: Integrate with Prometheus/Grafana
Next Steps
- Explore the Portainer Documentation
- Join the Portainer Community
- Try deploying a media stack or home automation platform
- Set up monitoring with Prometheus and Grafana
- Configure Edge Agents for remote device management
[!NOTE] Last Updated: January 2026 | Portainer Version: 2.33 LTS
This guide is based on validated January 2026 information. For updates, visit docs.portainer.io.
Comments
Sign in to join the discussion!
Your comments help others in the community.