01Introduction
A reverse proxy is essential for running multiple services on a single server. It routes traffic based on domain names, handles SSL certificates, and provides a single entry point. The three most popular options for Docker are Traefik, Nginx Proxy Manager, and Caddy. Each has distinct strengths.
02Traefik: Docker-Native and Automatic
Traefik was built for containers. It automatically discovers services via Docker labels, handles SSL with Let's Encrypt, and updates routing without restarts. It's the most 'set and forget' option but has a steeper initial learning curve.
1# Traefik with automatic HTTPS2services: 3 traefik: 4 image: traefik:v3.05 command: 6 - "--providers.docker=true"7 - "--providers.docker.exposedbydefault=false"8 - "--entrypoints.web.address=:80"9 - "--entrypoints.websecure.address=:443"10 - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"11 - "--certificatesresolvers.letsencrypt.acme.email=you@example.com"12 - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"13 ports: 14 - "80:80"15 - "443:443"16 volumes: 17 - /var/run/docker.sock:/var/run/docker.sock:ro18 - letsencrypt:/letsencrypt1920 whoami: 21 image: traefik/whoami22 labels: 23 - "traefik.enable=true"24 - "traefik.http.routers.whoami.rule=Host(`whoami.example.com`)"25 - "traefik.http.routers.whoami.tls.certresolver=letsencrypt"2627volumes: 28 letsencrypt: Traefik's dashboard (enabled with --api.dashboard=true) provides real-time visibility into routes and services.
03Nginx Proxy Manager: GUI-Driven Simplicity
Nginx Proxy Manager (NPM) wraps Nginx in a user-friendly web interface. No YAML labels or config files—just point and click. Perfect for those who prefer GUIs or are new to reverse proxies.
1# Nginx Proxy Manager setup2services: 3 npm: 4 image: jc21/nginx-proxy-manager:latest5 ports: 6 - "80:80"7 - "443:443"8 - "81:81" # Admin interface9 volumes: 10 - npm_data:/data11 - npm_letsencrypt:/etc/letsencrypt1213volumes: 14 npm_data: 15 npm_letsencrypt: 1617# After starting:18# 1. Access http://your-server:8119# 2. Login with admin@example.com / changeme20# 3. Add proxy hosts through the GUINPM stores all configuration in a SQLite database. The GUI makes it easy to add SSL certificates with one click.
04Caddy: Simple Config, Automatic HTTPS
Caddy pioneered automatic HTTPS and offers the simplest configuration syntax. It's not Docker-native like Traefik, but its Caddyfile format is incredibly readable. Great for those who want config files but hate complexity.
1# Caddy with simple Caddyfile2services: 3 caddy: 4 image: caddy:2-alpine5 ports: 6 - "80:80"7 - "443:443"8 volumes: 9 - ./Caddyfile:/etc/caddy/Caddyfile10 - caddy_data:/data11 - caddy_config:/config1213 app: 14 image: myapp:latest15 # No port exposure needed - Caddy connects via Docker network1617volumes: 18 caddy_data: 19 caddy_config: 05Caddyfile Example
The Caddyfile syntax is remarkably simple. Each site block defines a domain and its backend. HTTPS is automatic—no configuration needed.
1# Caddyfile - clean and simple2app.example.com {3 reverse_proxy app:804}56api.example.com {7 reverse_proxy api:30008}910files.example.com {11 root * /srv/files12 file_server browse13}1415# That's it. HTTPS certificates are automatic.06Detailed Comparison
**Traefik**
- Pros: True Docker integration, automatic service discovery, no config file changes when adding services
- Cons: Complex initial setup, verbose label syntax, dashboard needs securing
**Nginx Proxy Manager**
- Pros: Beautiful GUI, easy SSL management, familiar Nginx under the hood
- Cons: GUI-dependent (no GitOps), separate database to maintain, can't be fully configured via compose
**Caddy**
- Pros: Simplest config syntax, automatic HTTPS, excellent documentation
- Cons: No native Docker discovery (manual Caddyfile updates), less middleware options than Traefik
07Which Should You Choose?
**Choose Traefik if**: You want true Docker integration and don't mind learning labels. Best for larger setups where you frequently add/remove services.
**Choose Nginx Proxy Manager if**: You prefer GUIs, are new to reverse proxies, or manage infrastructure for non-technical users.
**Choose Caddy if**: You want simple config files, appreciate clean syntax, and don't need automatic Docker discovery.
All three are ready. Pick based on your preference for GUI vs config files vs Docker labels. You can't go wrong.