November 26, 2026

Traefik vs Caddy vs Nginx Proxy Manager for a Home Lab

A small home server rack in a basement with a mini PC, a network switch with status lights and bundled Ethernet cables.

Three lines of Caddyfile become 44 lines of JSON when Caddy’s own adapt command expands them. Five Docker labels do roughly the same job in Traefik, and in Nginx Proxy Manager the same route is a form in a web page, stored in a database file nobody reads. All three put a self-hosted app behind HTTPS on its own hostname. Where they differ is where the configuration lives, who writes it, and what breaks first when something goes wrong.

Video: Christian Lempa on YouTube

Same job, three config models

A text file, a label scanner and a web form

Caddy reads a Caddyfile and converts it to its native JSON before running anything. That conversion is visible. On an Ubuntu 24.04 test container with the distribution’s Caddy package (version 2.6.2), a minimal site block:

app.example.com {
    reverse_proxy app:8080
}

passes caddy validate with Valid configuration, and caddy adapt produces this, compacted:

{"apps":{"http":{"servers":{"srv0":{"listen":[":443"],"routes":[{"match":[{"host":["app.example.com"]}],"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"app:8080"}]}]}]}],"terminal":true}]}}}}}

Note what isn’t written anywhere in either version: a certificate path, a port 80 listener, a redirect. Caddy’s automatic HTTPS documentation says that “by default, Caddy serves all sites over HTTPS,” obtains and renews certificates for domains in the config, and redirects HTTP to HTTPS. The three-line file leans on those defaults the way a landline leans on the phone company’s wiring.

Traefik works from the other end. It doesn’t start from a file of sites; it builds routes from whatever its providers report. With the Docker provider, Traefik reads its dynamic configuration from the Docker API at unix:///var/run/docker.sock by default, and its Docker provider reference states that “Traefik requires access to the docker socket to get its dynamic configuration.” Routes appear and vanish as containers start and stop.

Nginx Proxy Manager describes itself as a “Docker container and built in Web Application for managing Nginx proxy hosts” in its guide. Its setup page maps three ports, 80 and 443 for public traffic and 81 for the admin web interface, and stores its data in /data, where SQLite lives by default, with certificates under /etc/letsencrypt. The route is a row in a database, edited through a browser.

A monitor showing a terminal window with blurred lines of configuration text above a mechanical keyboard.

Docker labels: native, plugin or absent

Routing that travels with the container, for better and worse

Native label support is Traefik’s main draw for Docker users. Each app’s Compose file carries its own routing, so adding a service never means editing a central file. The label syntax in Traefik’s Docker routing reference is consistent: routers under traefik.http.routers.<name>, services under traefik.http.services.<name>. A typical block:

services:
  app:
    image: example/app
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.app.rule=Host(`app.example.com`)"
      - "traefik.http.routers.app.entrypoints=websecure"
      - "traefik.http.routers.app.tls.certresolver=myresolver"
      - "traefik.http.services.app.loadbalancer.server.port=8080"

Traefik itself was not run for this comparison; the block was only checked for valid YAML on the test container (5 labels parsed OK). The port label is optional when a container exposes a single port, since, per the same reference, “by default, Traefik uses the first exposed port of a container.”

Caddy has no label support in the core server. A third-party plugin, caddy-docker-proxy, hosted under a personal GitHub account rather than the Caddy organization, “scans Docker metadata” for labels and “generates an in-memory Caddyfile.” Its example uses two labels, caddy: whoami.example.com and caddy.reverse_proxy: "{{upstreams 80}}", which is terser than Traefik’s five. Like Traefik, it needs the Docker socket in its default mode: “Controller instances require access to Docker host socket.”

Nginx Proxy Manager’s documentation describes no label provider at all. Hosts are added in the UI, by hostname and upstream address, which means an app’s Compose file and its public route live in two different places. For a small lab that’s barely a cost. For a lab that rebuilds containers weekly, it’s a second ledger to keep in balance, the sort of drift a post on self-hosting a service with Docker Compose can’t prevent on its own.

Certificates and challenges

All three use ACME; they differ in how much is implied

Caddy Traefik Nginx Proxy Manager
Default behavior HTTPS for every site in config, automatic Certs only where a router uses a resolver Requested per host in the UI
Public CA Let’s Encrypt, fallback to ZeroSSL Let’s Encrypt production by default Let’s Encrypt, or a supplied certificate
Challenges Automatic, needs 80/443 reachable for public names HTTP-01, TLS-ALPN-01, DNS-01 Let’s Encrypt via UI
Local names and IPs Own internal CA (not publicly trusted) Not covered on the pages fetched Not covered on the pages fetched
Where certs live Caddy storage, $HOME by default acme.json /etc/letsencrypt volume

Sources for the table: Caddy’s automatic HTTPS page, Traefik’s ACME resolver reference, and Nginx Proxy Manager’s guide and setup page.

Traefik’s resolver “requests certificates for a set of domain names inferred from routers,” per its ACME reference, and the challenge choice has physical consequences. HTTP-01 needs the entrypoint “reachable by Let’s Encrypt through port 80,” TLS-ALPN-01 needs port 443, and DNS-01 is the only one of the three the page says supports wildcard certificates. A home lab behind a carrier-grade NAT, or one that never opens ports at all, is pushed toward DNS-01 whichever proxy it picks.

Caddy also carries a fallback that appears nowhere in the Caddyfile. If Let’s Encrypt fails, the documentation says Caddy tries ZeroSSL, and if both fail it keeps retrying, with gaps that grow to as much as a day, for up to 30 days. For internal hostnames and IP addresses, Caddy issues from its own local certificate authority, which browsers won’t trust until the root is installed on each client. The certificate rules themselves keep tightening, which is the subject of the earlier piece on preparing for 64-day certificates.

Three patch panels stacked in a rack, each with different colored Ethernet cables routed to different ports.

The nginx underneath the forms

What a GUI saves is about twenty lines per host

Nginx Proxy Manager generates nginx configuration so its users don’t write it. A hand-written nginx equivalent of the three-line Caddyfile, with HTTP redirect, the ACME challenge path, forwarded headers and WebSocket upgrade, gives a sense of the size of what’s hidden. It is not the file Nginx Proxy Manager generates; it’s a plain nginx block of the kind its forms stand in for:

server {
    listen 80;
    server_name app.example.com;
    location /.well-known/acme-challenge/ { root /var/www/certbot; }
    location / { return 301 https://$host$request_uri; }
}
server {
    listen 443 ssl;
    server_name app.example.com;
    ssl_certificate     /tmp/px/c.pem;
    ssl_certificate_key /tmp/px/k.pem;
    client_max_body_size 0;
    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

With a throwaway self-signed certificate in place, nginx 1.24.0 on the test container accepted it:

nginx: the configuration file /tmp/px/nginx-test.conf syntax is ok
nginx: configuration file /tmp/px/nginx-test.conf test is successful

Twenty-two non-blank lines against Caddy’s three, and the nginx version still needs Certbot or something like it to fetch and renew the certificate. That renewal plumbing is exactly what fails in the cases covered in the Certbot troubleshooting guide. Nginx Proxy Manager’s pitch is that nobody has to see either half. Its guide says the goal was a tool so simple “that a monkey could do it,” with advanced nginx configuration “available for super users.”

Where people get burned

Most failures trace back to the socket, the defaults or the storage volume

  • Every container gets a route. Traefik’s exposedByDefault defaults to true, per the Docker provider reference. Without setting it to false and labeling only the containers meant to be public with traefik.enable=true, a database or admin panel can pick up a router just by starting.
  • The socket is root. Both Traefik and caddy-docker-proxy read the Docker socket. Docker’s security documentation says “only trusted users should be allowed to control your Docker daemon” and that the daemon “requires root privileges unless you opt-in to Rootless mode.” Traefik’s own page calls unrestricted API access “a security concern.” A proxy is the container facing the internet, which makes it the worst possible holder of that key.
  • Losing certificate storage. Caddy says the $HOME folder “must be writeable and persistent,” and Nginx Proxy Manager keeps certificates in a mounted /etc/letsencrypt volume. A container recreated without its volume starts asking for certificates from scratch. Let’s Encrypt’s rate limits allow “up to 5 certificates” per exact same set of names every 7 days, with no override offered. A few rebuilds in an afternoon can lock a hostname out for days. The same page asks people testing to use the staging environment.
  • Failed validations stack up. The same limits allow 5 authorization failures per identifier per account per hour. A port 80 that the ISP blocks, combined with an HTTP-01 challenge and a restart loop, burns through that quickly. If something else already holds port 80, finding what’s using a port comes before any proxy debugging.
  • Admin port left open. Nginx Proxy Manager’s example publishes port 81 as the “Admin Web Port.” Publishing it on a host that’s reachable from the internet puts the login page for every route in the lab one port scan away.
  • On-demand TLS without a gate. Caddy can fetch a certificate during the first handshake for unlisted domains, and its docs warn that this must be both enabled and restricted, typically with an “ask” endpoint, to prevent abuse.
An open brass padlock hanging on the latch of a metal breaker panel door in a garage.

The case for the boring option

Labels feel automatic until the container that holds the routing is the one that’s down

The strongest argument against Traefik’s label model is that it ties routing to the state of the Docker daemon. When the daemon or a container misbehaves, the routes go with it, and the place to look for configuration is spread across every Compose file in the lab. A Caddyfile is one text file. It can sit in git, be diffed, and be read during an outage with nothing but a terminal.

Scale and discipline cut the other way. A lab with forty containers and a weekly habit of adding more gets real value from routing that is created with the service and deleted with it. A central Caddyfile drifts too, just in the other direction, holding routes for containers that were removed months ago. And Nginx Proxy Manager answers a different question entirely: for someone who doesn’t want to learn any configuration syntax, a form with a “request certificate” switch is the right tool, and the database behind it is only a problem on the day it has to be restored. Backing up its /data and /etc/letsencrypt volumes is that day’s insurance, and it’s the same discipline any other stateful container needs.

Which fits whom

Match the proxy to how the lab changes, not to how it looks today

Situation Best fit Reason, from the docs above
A handful of services, config kept in git Caddy Three-line sites, HTTPS by default
Many containers that come and go Traefik Native Docker provider, routes from labels
Wants labels but prefers Caddy’s syntax Caddy with caddy-docker-proxy Two labels per service; third-party plugin
No interest in config files Nginx Proxy Manager Web UI, Let’s Encrypt per host, aimed at beginners
No inbound ports or wants wildcards Whichever supports DNS-01 with the DNS provider in use HTTP-01 and TLS-ALPN-01 need 80 or 443 reachable

The proxy that fits is usually the one whose failure the owner can diagnose at 2 a.m. with the tools already on the machine. A web form is easy right up until it loads a blank page, a label set is easy until the socket is the problem, and a Caddyfile is easy until the defaults do something nobody wrote down. Which of those three failures has cost the most time in a real lab?

Sources

  • Caddy, Automatic HTTPS: https://caddyserver.com/docs/automatic-https
  • Traefik, Docker provider (install configuration reference): https://doc.traefik.io/traefik/reference/install-configuration/providers/docker/
  • Traefik, Docker routing configuration reference: https://doc.traefik.io/traefik/reference/routing-configuration/other-providers/docker/
  • Traefik, ACME certificate resolver reference: https://doc.traefik.io/traefik/reference/install-configuration/tls/certificate-resolvers/acme/
  • Nginx Proxy Manager, Guide: https://nginxproxymanager.com/guide/
  • Nginx Proxy Manager, Full Setup Instructions: https://nginxproxymanager.com/setup/
  • caddy-docker-proxy (GitHub, lucaslorentz): https://github.com/lucaslorentz/caddy-docker-proxy
  • Docker, Docker Engine security: https://docs.docker.com/engine/security/
  • Let’s Encrypt, Rate Limits: https://letsencrypt.org/docs/rate-limits/
  • x9m8, Self-host a service with Docker Compose: https://x9m8.com/docker-compose-self-host-service/
  • x9m8, 64-day certificates: ACME renewal prep: https://x9m8.com/64-day-certificates-acme-renewal-prep/
  • x9m8, Certbot renewal failed troubleshooting: https://x9m8.com/certbot-renewal-failed-troubleshooting/
  • x9m8, Find what is using a port on Linux: https://x9m8.com/find-what-is-using-a-port-linux/

487 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *