Self-hosting homelab applications like Immich, Vaultwarden, and Open WebUI in Docker offers total data privacy, but exposing multiple internal services to the web introduces significant security hazards. Memorizing arbitrary port numbers like 8080, 3000, and 8096 is tedious, while exposing unencrypted HTTP traffic across the public internet leaves sensitive authentication tokens vulnerable to interception. Managing manual Nginx configuration files and Certbot renewal cron jobs often leads to broken routing and expired TLS certificates.
Nginx Proxy Manager (jc21/nginx-proxy-manager) provides an elegant, production-ready solution by packaging a high-performance OpenResty reverse proxy with an intuitive web administrative dashboard. It automates free Let’s Encrypt SSL certificate provisioning, provides one-click Cloudflare DNS-01 wildcard certificates, handles WebSocket upgrade headers, and enforces IP access control lists. In this comprehensive 2026 deployment guide, we build a hardened Docker Compose stack using pinned version 2.16.0 on Ubuntu 24.04 LTS, secure the admin console, and route internal containers over an isolated Docker network bridge.
jc21/nginx-proxy-manager:2.16.0Key Takeaways
- Automated Zero-Touch SSL: Direct Let’s Encrypt certificate issuance supporting HTTP-01 challenges and Cloudflare API DNS-01 verification for wildcard domain certificates (
*.yourdomain.com) with automated 60-day renewal. - Container Network Isolation: Eliminates the need to publish internal application ports (like
8080:8080) to the host interface. All inter-container traffic routes privately across a user-defined Docker bridge network (npm-network). - Universal Protocol Support: Native handling of WebSocket proxying, HTTP/2 and HTTP/3 QUIC termination, advanced custom Nginx headers, and upstream proxying to services like Immich, Vaultwarden, and Nextcloud AIO.
Reverse Proxy Architecture: How Nginx Proxy Manager Secures Homelabs
A reverse proxy sits between incoming internet requests and your backend container services, acting as a single secure gateway for your homelab. Instead of opening dozens of router ports, you expose only ports 80 and 443 to handle SSL termination, authentication filtering, and internal DNS resolution.
- Single Ingress Point: By routing external requests through ports
80(HTTP) and443(HTTPS), your router firewall only needs two open ports. Nginx Proxy Manager analyzes incoming Server Name Indication (SNI) headers and routes traffic to the appropriate internal container based on subdomain. - Centralized TLS Termination: SSL handshakes terminate at the proxy layer, offloading CPU cryptographic overhead from backend applications like Ollama or Nextcloud. Internal traffic between the proxy and backend containers flows over encrypted private subnets.
- Access Control Lists (ACLs): Enforce strict HTTP Basic Authentication or restrict sensitive internal services (like admin panels and databases) to local LAN subnets (
192.168.1.0/24) or private WireGuard mesh IPs from Headscale.
Homelab Reverse Proxy Comparison Matrix: NPM vs Traefik vs Caddy
Selecting the optimal reverse proxy depends on your technical workflow, deployment scale, and administrative preference. This comparison evaluates the top four homelab routing solutions across configuration complexity, graphical interface capabilities, and container auto-discovery.
| Solution / Feature | Nginx Proxy Manager | Traefik v3 | Caddy 2 | Cloudflare Tunnel |
|---|---|---|---|---|
| Web Admin GUI | Yes (Intuitive Dashboard) | Read-Only Dashboard | No (CLI / API Only) | Cloudflare Zero Trust Portal |
| Automated SSL | Let’s Encrypt / Cloudflare DNS | ACME / DNS Challenge | Automated Internal & Public | Cloudflare Edge Managed |
| Config Format | Web GUI & SQLite/MySQL | Docker Labels & YAML | Caddyfile Syntax | Cloudflare Dashboard / YAML |
| Learning Curve | Low (Beginner Friendly) | High (Label Syntax) | Medium (Declarative) | Low to Medium |
| Docker Network Isolation | Full Bridge Network Support | Native Docker Socket | Manual Network Joining | Outbound Agent Proxy |
| Port Forwarding Required | Yes (Port 80 & 443) | Yes (Port 80 & 443) | Yes (Port 80 & 443) | No (Outbound Tunnel) |
Step 1: Production Docker Compose Configuration
Deploying Nginx Proxy Manager begins with preparing an isolated directory structure on your server and defining a production-grade Docker Compose file. Pinning image versions ensures operational stability. This locks dependency versions and prevents unexpected upstream schema changes from breaking live routing.
| Nginx Proxy Manager Deployment Specifications | |
|---|---|
| Container Image | jc21/nginx-proxy-manager:2.16.0 |
| Latest Verified Release | v2.16.0 (September 2026) |
| Underlying Proxy Engine | OpenResty (Nginx 1.25.x / Lua Engine) |
| Database Backend | SQLite (Embedded) / MariaDB (Optional) |
| Required Ingress Ports | Port 80 (HTTP) • Port 443 (HTTPS) • Port 81 (Admin Dashboard) |
| License & Source | MIT License • Official GitHub Repository |
First, connect to your Ubuntu server via SSH following our hardened Ubuntu server security guide. Create a dedicated homelab directory structure with persistent storage folders for proxy database configurations and Let’s Encrypt certificates, then navigate into it:
mkdir -p ~/homelab/npm/{data,letsencrypt} && cd ~/homelab/npm
Next, create a dedicated external Docker bridge network. This allows other application containers to communicate privately with Nginx Proxy Manager across an isolated bridge without exposing raw container ports to the host interface:
docker network create npm-network
Now create your docker-compose.yml deployment manifest using your preferred text editor:
services:
npm:
image: jc21/nginx-proxy-manager:2.16.0
container_name: nginx-proxy-manager
restart: unless-stopped
ports:
- "80:80" # Public HTTP Traffic
- "443:443" # Public HTTPS Traffic
- "81:81" # Web Administration Dashboard
environment:
- DISABLE_IPV6=true
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
networks:
- npm-network
networks:
npm-network:
external: true
Start the container stack in detached mode by executing:
docker compose up -d
Verify that all services initialize cleanly by monitoring startup logs with docker compose logs -f.
Step 2: Initial Login & Admin Dashboard Hardening
Securing the administrative dashboard immediately after startup is paramount to prevent unauthorized access to your proxy configurations. Default credentials must be changed upon first login, and management port 81 should be restricted to local network access only.
Open your web browser and navigate to http://<SERVER-LOCAL-IP>:81. Log in using the default administrative credentials:
- Email:
[email protected] - Password:
changeme
You will be prompted immediately to enter an administrator name, nickname, and valid email address. Enter your real email address to receive automated Let’s Encrypt expiration warnings.
Change the default password to a strong, randomized 20-character passphrase generated in your self-hosted Vaultwarden instance.
For firewall hardening, never expose port 81 publicly on your router. On your Ubuntu host, configure UFW to allow port 81 strictly from your trusted local subnet:
sudo ufw allow from 192.168.1.0/24 to any port 81 proto tcp
Step 3: Configuring Free Wildcard SSL with Cloudflare DNS
Setting up wildcard SSL certificates using Cloudflare DNS-01 verification allows you to secure unlimited subdomains without opening router port 80 for HTTP challenges. This approach prevents certificate rate-limiting and issues valid TLS certificates for services hidden behind private VPNs.
- Log in to your Cloudflare Dashboard, navigate to My Profile > API Tokens, and click Create Token.
- Select the Edit zone DNS template. Under Zone Resources, select Include > Specific zone > yourdomain.com. Complete token creation and copy the API token string.
- In the Nginx Proxy Manager dashboard, click SSL Certificates > Add SSL Certificate > Let’s Encrypt.
- In the Domain Names field, enter your root domain and wildcard pattern:
yourdomain.com, *.yourdomain.com. - Toggle Use a DNS Challenge to enabled, and select Cloudflare as the DNS Provider.
- In the credentials box, replace
dns_cloudflare_api_token = ...with your actual Cloudflare API token. - Agree to the Let’s Encrypt Terms of Service and click Save. Nginx Proxy Manager will execute the DNS challenge and issue a valid wildcard certificate within 45 seconds.
Step 4: Adding Proxy Hosts & Connecting Backend Containers
Connecting backend Docker applications to your domain requires creating Proxy Host entries within the Nginx Proxy Manager interface. Utilizing internal Docker network hostnames eliminates IP address dependencies and preserves clean separation between containers.
To route traffic to any backend container without publishing its port to the host network interface, attach the container to the external npm-network inside its compose manifest. For example, a target service like Open WebUI or Immich joins the proxy bridge with the following block:
services:
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
restart: unless-stopped
networks:
- npm-network
networks:
npm-network:
external: true
Once your backend container is connected to npm-network, configure the proxy rule in NPM:
- In NPM, click Hosts > Proxy Hosts > Add Proxy Host.
- Domain Names: Enter the target subdomain, such as
ai.yourdomain.comorphotos.yourdomain.com. - Scheme: Select
http. - Forward Hostname / IP: Enter the exact container name (e.g.,
open-webui). Do not uselocalhostor127.0.0.1, as those resolve to the NPM container itself. - Forward Port: Enter the container internal service port (e.g.,
8080for Open WebUI,2283for Immich). - Toggle Block Common Exploits and Websockets Support to enabled. WebSockets are mandatory for interactive streaming responses in LLM frontends and real-time telemetry dashboards like our Beszel Docker server monitoring stack.
- Switch to the SSL tab, select your Cloudflare Wildcard certificate, toggle Force SSL and HTTP/2 Support, and click Save.
Step 5: Access Lists & Security Hardening
Protecting administrative panels and sensitive backends from public internet exposure requires configuring Access Control Lists in Nginx Proxy Manager. Access Lists allow you to enforce HTTP basic authentication or restrict traffic strictly to local and VPN subnets.
To configure your access rules, navigate to Access Lists > Add Access List. In the Details tab, provide a descriptive label like LAN & WireGuard Only and set the satisfaction condition to Satisfy Any.
Switch to the Access tab and define your trusted CIDR subnet ranges to block unauthorized public access:
192.168.1.0/24 allow
100.64.0.0/10 allow
all deny
This rule permits traffic originating from your physical local area network (192.168.1.0/24) and private mesh VPN clients from Headscale (100.64.0.0/10) while dropping all other requests at the proxy edge.
Optionally, navigate to the Authorization tab and create a secondary username and password prompt for defense-in-depth protection. Save the list. Open any Proxy Host configuration, switch to the Details tab, and select this Access List from the dropdown menu to apply instant zero-trust network perimeter defense.
How to Update Nginx Proxy Manager via Docker Compose
Updating Nginx Proxy Manager requires pulling the latest verified image and recreating the container while preserving your persistent volume data. Because certificates and host configurations reside inside the external ./data and ./letsencrypt directory mounts, updates execute with zero data loss.
To safely upgrade your running deployment, navigate to your compose directory and execute:
cd ~/homelab/npm
docker compose pull
docker compose up -d --remove-orphans
Check container status with docker compose ps to confirm the new image layer is active and routing healthy.
Frequently Asked Questions (FAQ)
These concise technical answers address the most frequent deployment and troubleshooting challenges encountered when self-hosting Nginx Proxy Manager in Docker.
Why does Nginx Proxy Manager return a 502 Bad Gateway error?
A 502 Bad Gateway error indicates that Nginx Proxy Manager cannot establish a network connection to your target container. Verify that both NPM and the destination application share the same Docker bridge network (e.g., npm-network), and ensure you are using the container name as the forward hostname rather than localhost.
Should I use SQLite or MariaDB for Nginx Proxy Manager?
For standard homelab deployments managing fewer than 50 proxy hosts, SQLite is recommended because it embeds directly inside the local data volume. This setup eliminates the memory overhead of a separate database container while preventing database corruption during unexpected host power loss. For high-traffic enterprise environments with hundreds of hosts, MariaDB provides better concurrent write locking.
Do Let’s Encrypt certificates renew automatically in NPM?
Yes, Nginx Proxy Manager runs an automated background cron daemon that checks certificate validity daily. Certificates are renewed automatically 30 days before expiration, requiring zero manual sysadmin intervention when Cloudflare DNS-01 tokens are configured.
How do I fix the 413 Request Entity Too Large error for file uploads?
By default, Nginx enforces a 1 MB file upload limit. When proxying photo and video backends like Immich or Nextcloud AIO, open the Proxy Host in NPM, switch to the Advanced tab, and paste client_max_body_size 5000M; to permit multi-gigabyte uploads.
How do I monitor proxy host uptime and SSL expiration?
To verify proxy health and catch expiring SSL certificates before users encounter warnings, pair Nginx Proxy Manager with an automated heartbeat monitor. Follow our complete tutorial on how to self-host Uptime Kuma in Docker to configure real-time HTTP checks and instant Telegram push alerts.

Leave a Reply