Choosing a reverse proxy for self-hosting affects how easily you publish Docker apps, automate TLS, apply access rules, and troubleshoot failures. This guide compares Traefik and Nginx Proxy Manager, provides practical Compose starting points, and gives you a repeatable checklist for deployment, maintenance, backups, certificate rotation, and migration.
Overview
Traefik and Nginx Proxy Manager can both sit in front of self-hosted applications and route requests such as https://cloud.example.com to an internal Docker service. The important difference is how they are configured.
Traefik is designed for configuration discovered from Docker labels, files, and other providers. It is a strong fit for teams that deploy frequently, manage infrastructure as code, or want routing rules to travel with each application. Nginx Proxy Manager provides a web interface for creating proxy hosts, certificates, redirects, and access lists. It is often easier to operate interactively, especially for a smaller home server or a stack managed by more than one person.
Neither tool removes the need for DNS, firewall rules, backups, updates, and application-level security. A reverse proxy should be treated as a critical infrastructure component: if it fails, several otherwise healthy applications may become unreachable.
| Area | Traefik | Nginx Proxy Manager |
|---|---|---|
| Primary configuration | Docker labels, static configuration, and dynamic files | Web interface backed by persistent application data |
| Resource usage | Typically a small container footprint; exact usage depends on providers and logging | Includes the proxy and management application components; plan for its database and persistent data |
| TLS automation | ACME resolvers, including HTTP, TLS-ALPN, and DNS challenge options depending on configuration | Certificate management through the web interface, with supported challenge options depending on the release |
| Dynamic routing | Excellent for labels and frequently changing Docker services | Straightforward for manually managed hosts; changes are made in the interface |
| Middleware and extensions | Rich routing middleware and file-based rules; verify plugin compatibility before use | Common proxy controls are exposed in the UI; advanced customization may require deeper Nginx knowledge |
| DNS provider support | DNS challenge support depends on the configured provider and credentials | DNS challenge support and provider workflows depend on the installed release and setup |
| Learning curve | Higher initially, especially for entry points, routers, services, resolvers, and providers | Lower for common proxy-host and certificate tasks; less infrastructure-as-code oriented |
Choose Traefik when repeatable, label-driven deployments matter. Choose Nginx Proxy Manager when a clear administrative UI and quick manual setup are more valuable. If most services should remain private, consider a VPN or mesh network rather than publishing them. The WireGuard, Tailscale, and Headscale guide covers that access pattern.
Checklist by scenario
Scenario 1: Start with Traefik and Docker Compose
The following is an illustrative Traefik v2-style arrangement. Pin an image tag that you have tested rather than relying on an unreviewed floating tag, and check the syntax before using it with another major release.
version: "3.9"
services:
traefik:
image: traefik:v2.11
command:
- --api.dashboard=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.file.filename=/etc/traefik/dynamic.yml
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --certificatesresolvers.dns.acme.dnschallenge=true
- --certificatesresolvers.dns.acme.dnschallenge.provider=cloudflare
- --certificatesresolvers.dns.acme.email=${LETSENCRYPT_EMAIL}
- --certificatesresolvers.dns.acme.storage=/letsencrypt/acme.json
ports:
- "80:80"
- "443:443"
environment:
- CF_DNS_API_TOKEN=${CF_DNS_API_TOKEN}
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/etc/traefik/dynamic.yml:ro
- ./letsencrypt:/letsencrypt
networks: [proxy]
networks:
proxy:
external: true
Create the external network before starting the stack with docker network create proxy. Replace the DNS provider and environment variable with the provider supported by your chosen Traefik build. Store CF_DNS_API_TOKEN in a protected environment file, restrict the token to the required DNS zone where possible, and set restrictive permissions on letsencrypt/acme.json.
A minimal dynamic file might define a security header middleware:
http:
middlewares:
basic-security:
headers:
contentTypeNosniff: true
frameDeny: true
browserXssFilter: true
Attach applications with labels. For example, a service on the shared network could include traefik.enable=true, a router rule for its host name, the websecure entry point, the dns certificate resolver, and the internal service port. Confirm the application listens on the same Docker network as Traefik and that the declared port matches the container, not necessarily the host port.
Scenario 2: Start with Nginx Proxy Manager
Nginx Proxy Manager keeps its configuration in persistent volumes. This Compose example is a starting point; review the image tag, database compatibility, and release documentation before upgrading.
version: "3.8"
services:
app:
image: jc21/nginx-proxy-manager:latest
restart: unless-stopped
ports:
- "80:80"
- "81:81"
- "443:443"
environment:
DB_MYSQL_HOST: db
DB_MYSQL_PORT: 3306
DB_MYSQL_USER: npm
DB_MYSQL_PASSWORD: ${NPM_DB_PASSWORD}
DB_MYSQL_NAME: npm
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
depends_on:
- db
networks: [proxy]
db:
image: jc21/mariadb-aria:latest
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${NPM_DB_ROOT_PASSWORD}
MYSQL_DATABASE: npm
MYSQL_USER: npm
MYSQL_PASSWORD: ${NPM_DB_PASSWORD}
volumes:
- ./mysql:/var/lib/mysql
networks: [proxy]
networks:
proxy:
external: true
After startup, complete the initial administrator setup, change default credentials if applicable, and create a proxy host for each application. Enter the domain, internal Docker hostname, and container port; request a certificate through the certificate section; then enable HTTPS redirect only after the certificate works. Do not expose the management port broadly. Restrict it with a firewall, VPN, or trusted source network.
Scenario 3: Add a new application
- Create the DNS record and confirm it points to the proxy's public address, or create the required tunnel route.
- Join the application to the proxy network. Avoid publishing its application port directly unless there is a specific reason.
- Confirm the app's expected base URL, trusted proxy settings, and WebSocket requirements.
- Add the route in Traefik labels or in the Nginx Proxy Manager interface.
- Request or attach a certificate, then test HTTP-to-HTTPS redirection.
- Test login, uploads, WebSockets, large requests, and any callback URLs from outside the server.
What to double-check
- DNS: Check A, AAAA, wildcard, and split-DNS records. An incorrect IPv6 record can make a site appear intermittently broken.
- Ports: Confirm that ports 80 and 443 reach the intended proxy, and that another service is not already bound to them.
- ACME credentials: Use a narrowly scoped DNS API token where supported. Never place secrets in labels, public repositories, or copied screenshots.
- ACME storage: Back up certificate storage securely and preserve file permissions. Certificate files and account data are sensitive.
- Docker networks: The proxy and target container must share a network. The proxy's service name is usually preferable to a changing container IP.
- Forwarded headers: Configure trusted proxy behavior in the application only for networks you control. Incorrect settings can create insecure redirects or misleading client IPs.
- Backups: Back up Traefik's dynamic and static files, Compose files, environment files through a secure process, and Nginx Proxy Manager's data, database, and certificate directories.
- Observability: Keep access and error logs useful but avoid storing unnecessary personal data. Add proxy checks to a monitoring system such as the stack described in the self-hosted monitoring guide.
For a broader deployment plan, compare this checklist with the Docker Compose app stack planning guide and the server hardening checklist.
Common mistakes
- Using the wrong internal port: A container may listen on 8080 even when a host mapping uses another port. Route to the container's listening port on the shared network.
- Publishing every backend: Directly exposing application ports bypasses proxy controls and makes later auditing harder.
- Opening the dashboard to the internet: Keep Traefik's dashboard and Nginx Proxy Manager's management interface behind authentication and a restricted network.
- Starting with a production wildcard: Test with one hostname and the appropriate ACME staging option where available before requesting many certificates.
- Ignoring renewal logs: Automatic renewal is not a substitute for checking that certificates renew and that applications reload them correctly.
- Changing proxy platforms without a rollback: Export configuration, record DNS and firewall changes, and preserve the old proxy's data until the replacement has passed external tests.
- Trusting container health alone: A healthy container can still route to a stopped backend, serve the wrong certificate, or return application errors.
When to revisit
Use this checklist whenever you add a domain, publish a new Docker app, change DNS, rotate an API token, or restore a proxy after a server failure. Schedule a small maintenance review before seasonal planning cycles or other periods when a home server or VPS will be difficult to access.
Recheck the Compose examples and security guidance after a major Traefik or Nginx Proxy Manager release, especially when moving between Traefik major versions. Review ACME instructions when certificate authority behavior, rate limits, or DNS-provider APIs change. Apply security fixes promptly after a public advisory rather than waiting for a planned content or maintenance cycle.
For a practical migration, create an inventory containing domains, backend ports, Docker networks, middleware, certificates, DNS records, firewall rules, and secrets. Deploy the replacement on an isolated port or host, test each route externally, then switch DNS or ports during a controlled window. Keep the original configuration and a verified restore copy until the new proxy has operated successfully through certificate renewal and a reboot.
If your access model does not require public exposure, revisit whether a VPN or a Cloudflare Tunnel is a better fit. The Cloudflare Tunnel self-hosting guide explains the alternative pattern. Whichever proxy you choose, document the decision, test restoration, and keep the configuration understandable enough that you can recover it without guessing.