docker.recipes
Networking12 min read

Traefik vs Nginx Proxy Manager vs Caddy for Docker

Compare the three most popular reverse proxies for Docker and find the best fit for your self-hosted setup.

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 HTTPS
2services:
3 traefik:
4 image: traefik:v3.0
5 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:ro
18 - letsencrypt:/letsencrypt
19
20 whoami:
21 image: traefik/whoami
22 labels:
23 - "traefik.enable=true"
24 - "traefik.http.routers.whoami.rule=Host(`whoami.example.com`)"
25 - "traefik.http.routers.whoami.tls.certresolver=letsencrypt"
26
27volumes:
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 setup
2services:
3 npm:
4 image: jc21/nginx-proxy-manager:latest
5 ports:
6 - "80:80"
7 - "443:443"
8 - "81:81" # Admin interface
9 volumes:
10 - npm_data:/data
11 - npm_letsencrypt:/etc/letsencrypt
12
13volumes:
14 npm_data:
15 npm_letsencrypt:
16
17# After starting:
18# 1. Access http://your-server:81
19# 2. Login with admin@example.com / changeme
20# 3. Add proxy hosts through the GUI

NPM 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 Caddyfile
2services:
3 caddy:
4 image: caddy:2-alpine
5 ports:
6 - "80:80"
7 - "443:443"
8 volumes:
9 - ./Caddyfile:/etc/caddy/Caddyfile
10 - caddy_data:/data
11 - caddy_config:/config
12
13 app:
14 image: myapp:latest
15 # No port exposure needed - Caddy connects via Docker network
16
17volumes:
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 simple
2app.example.com {
3 reverse_proxy app:80
4}
5
6api.example.com {
7 reverse_proxy api:3000
8}
9
10files.example.com {
11 root * /srv/files
12 file_server browse
13}
14
15# 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.