Reverse Proxy for a Home Server: Caddy vs NPM vs Traefik
A reverse proxy for a home server sits in front of your self-hosted apps and routes requests by hostname: photos.example.com goes to one container, docs.example.com to another. It terminates HTTPS, renews certificates automatically and gives you a single place to add authentication, instead of juggling a dozen ports like :8096, :8123 and :9000.
The three tools most home labs choose between are Caddy, Nginx Proxy Manager (NPM) and Traefik. This guide compares them using their official documentation as of December 2026 (Caddy 2.11, Nginx Proxy Manager 2.17.1, Traefik 3.8), then covers the security rules that matter more than the choice of tool.
What a reverse proxy does (and doesn’t do)
Without a proxy, each app listens on its own port and usually speaks plain HTTP. With one, the proxy is the only thing listening on ports 80 and 443. It reads the hostname of each incoming request, forwards it to the right backend over your internal network, and adds headers such as X-Forwarded-For so the app knows the real client address.
What you gain:
- TLS everywhere. All three tools can obtain and renew certificates via the ACME protocol, typically from Let’s Encrypt.
- One choke point for access control. Basic authentication, IP allow lists or a single sign-on service can be added in front of apps that have weak or no login of their own.
- Fewer open ports. Only the proxy needs to be reachable; backend containers can stay on an internal Docker network.
What you don’t gain: a reverse proxy doesn’t patch the apps behind it. If a published app has a vulnerability, the proxy will forward the exploit as faithfully as any other request. That’s why the most important decision isn’t which proxy to use, but which apps to publish at all.
Caddy vs Nginx Proxy Manager vs Traefik
| Feature | Caddy | Nginx Proxy Manager | Traefik |
|---|---|---|---|
| How you configure it | Caddyfile (short text config) or JSON API | Web UI (admin port 81) | Static config plus dynamic config, often Docker labels |
| HTTPS by default | Yes, for any site with a hostname | Per proxy host, requested in the UI | Per router, via a configured certificate resolver |
| ACME challenges | HTTP-01 and TLS-ALPN-01 enabled by default; DNS-01 with a provider plugin | Let’s Encrypt certificates requested in the UI | HTTP-01, TLS-ALPN-01 and DNS-01 resolvers |
| Internal-only HTTPS | Built-in local CA for localhost, IPs and internal names | Upload your own custom certificate | Your own certificates or DNS-01 |
| Built-in authentication | basic_auth with hashed passwords; forward_auth for SSO |
Access Lists and basic HTTP auth | Middlewares (basic auth, forward auth) |
| Container discovery | Manual entries (plugins exist) | Manual entries in UI | Automatic from Docker labels |
| Extra attack surface | Admin API on localhost by default | Admin UI on port 81 | Dashboard/API if enabled; Docker socket access |
| Best fit | Small, stable set of services; text-config fans | Beginners who prefer clicking to editing | Many containers that come and go |
Caddy
Caddy’s documentation says it was the first web server to use HTTPS automatically and by default. Given a public DNS name, it obtains a certificate from a public ACME CA such as Let’s Encrypt or ZeroSSL, keeps it renewed, and redirects HTTP to HTTPS. For local hostnames and IP addresses, it signs certificates with its own local certificate authority instead; those are only trusted on machines where you install Caddy’s root certificate.
A complete proxy configuration for one app is three lines:
photos.example.com {
reverse_proxy localhost:2283
}
Caddy’s basic_auth directive refuses plaintext passwords; you generate a hash with caddy hash-password and paste the hash into the config. For per-user logins with two-factor authentication, its forward_auth directive can hand authentication off to a dedicated identity service such as Authelia.
Nginx Proxy Manager
Nginx Proxy Manager wraps Nginx in a web interface. Its official setup page runs it with Docker Compose, publishing port 80 (public HTTP), 443 (public HTTPS) and 81 (the admin web port). The project lists free Let’s Encrypt certificates, access lists and basic HTTP authentication among its features. Its images support amd64 and arm64; the setup page notes that armv7 support ended with version 2.14.
On first run, NPM generates keys, initialises its database and creates a default admin user. Log in on port 81 straight away and set your own credentials before doing anything else.
Traefik
Traefik is built around automatic discovery. With the Docker provider, it watches the Docker API and builds routes from container labels, so a new service can get a hostname and certificate just by adding labels to its Compose file:
labels:
- traefik.enable=true
- traefik.http.routers.photos.rule=Host(`photos.example.com`)
- traefik.http.routers.photos.entrypoints=websecure
- traefik.http.routers.photos.tls.certresolver=le
Two defaults deserve attention. First, the Docker provider’s exposedByDefault option is true, meaning every container becomes routable unless you set it to false and opt in with traefik.enable=true. Second, the dashboard: Traefik’s own documentation says enabling the API and dashboard in production “is not recommended” because it exposes all configuration elements, and the api.insecure mode publishes them on a dedicated entry point without protection.
Getting certificates: HTTP-01 vs DNS-01
All three proxies use ACME, and the challenge type decides what you must expose:
- HTTP-01. The CA fetches a token over port 80. Easy, but port 80 must be reachable from the internet, and Let's Encrypt states this challenge cannot issue wildcard certificates.
- TLS-ALPN-01. Validated over port 443 with a special TLS handshake. Same exposure requirement, on 443 instead of 80.
- DNS-01. You prove control by creating a TXT record. Caddy's docs note this needs no open ports and the server doesn't need to be externally accessible. It also allows wildcard certificates, per Let's Encrypt. The cost: your proxy holds API credentials for your DNS zone, so scope that token as narrowly as your provider allows.
DNS-01 is the strongest fit for home labs that are accessed only over a VPN: you get browser-trusted certificates for *.home.example.com while nothing is published to the internet.
While experimenting, point your proxy at Let’s Encrypt’s staging environment. Production issuance is rate limited; for example, Let’s Encrypt allows up to 50 certificates per registered domain every 7 days, and a looping misconfiguration can burn through limits quickly.
Security rules that matter more than the tool
- Publish only what must be public. If you’re the only user of a service, put it behind a VPN instead. Our Tailscale vs WireGuard comparison covers the two common options.
- Bind admin ports to the right interface. In Docker Compose,
"127.0.0.1:81:81"publishes NPM’s admin UI only on the host itself; you can then reach it through an SSH tunnel or VPN. Never add a router port forward for it. - Add authentication in front of weak apps. Use the proxy’s basic auth or access lists at minimum; prefer a forward-auth identity provider with two-factor authentication for anything sensitive.
- Protect the Docker socket. Traefik’s Docker provider reads
/var/run/docker.sock. Docker’s security documentation warns that only trusted users should be allowed to control the Docker daemon, because a container started through it can be given unrestricted access to the host’s filesystem. A read-only bind mount does not limit what can be done through the API, so consider a socket proxy that exposes only the read endpoints Traefik needs, or use the file provider instead of Docker discovery. - Keep the proxy updated. It is the one component every request touches. Pin image versions in Compose, then update deliberately and read release notes.
- Log and watch. Enable access logs so you can see what’s hitting your public hostnames; tools like fail2ban or CrowdSec can act on them, as covered in our home server security basics.
Which reverse proxy should you choose?
There’s no wrong answer among the three; they’re all mature and widely used. Switching later is also reasonable, because the backends don’t care which proxy sits in front of them. If you run Home Assistant, note that it needs proxy-specific settings for trusted proxies; our guide to accessing Home Assistant remotely covers that case.
A sensible first deployment
If you’re starting from scratch, a conservative layout looks like this:
- Run the proxy as a container on the same Docker host as your apps, on a shared internal network; backends publish no host ports.
- Use a domain you own, with DNS-01 if you can, so you're not forced to open port 80.
- Expose only ports 80/443 of the proxy, and only if a service truly needs public access. Otherwise keep everything behind your VPN.
- Put an authentication layer in front of any app without strong built-in login.
- Back up the proxy's configuration and certificate storage (Caddy's data directory, NPM's
dataandletsencryptfolders, or Traefik'sacme.json) along with your app data.
If Docker isn’t installed yet, start with our guide to installing Docker Compose on Ubuntu, and see the rest of the networking section for VPN and DNS guides.
Frequently asked questions
Do I need a domain name for a reverse proxy?
For publicly trusted certificates from Let's Encrypt, yes: the certificate is issued for a DNS name you control. For LAN-only names, Caddy can issue certificates from its own local CA, but each client must trust that CA.
Can I get valid HTTPS without opening ports?
Yes, with the DNS-01 challenge. Let's Encrypt validates a TXT record in your DNS zone, so no inbound ports are needed and wildcard certificates become possible. Your proxy needs API credentials for your DNS provider.
Is Nginx Proxy Manager the same as Nginx?
No. Nginx Proxy Manager is a separate project that packages Nginx with a web interface for creating proxy hosts, certificates and access lists. It's convenient, but it adds its own admin UI that you must keep private.
Does a reverse proxy make an app secure?
It handles encryption and can add a login in front of the app, but it does not fix vulnerabilities in the app itself. Keep apps updated and only publish what genuinely needs to be reachable from the internet.
Sources
- Automatic HTTPS: Caddy Documentation
- basic_auth (Caddyfile directive): Caddy Documentation
- Full Setup Instructions: Nginx Proxy Manager
- Nginx Proxy Manager Guide: Nginx Proxy Manager
- ACME certificate resolver: Traefik Labs
- API & Dashboard: Traefik Labs
- Docker provider: Traefik Labs
- Challenge Types: Let's Encrypt
- Rate Limits: Let's Encrypt
- API: Caddy Documentation
- Docker Engine security: Docker
We research every guide from manufacturer documentation, government and standards bodies, and other primary sources, which are cited at the end of each article. We do not accept payment for coverage. Read our editorial policy to see how articles are researched, fact-checked and updated, or tell us if something is out of date.