Infrastructure•Apr 2026•3 min read

Caddy vs Traefik

Two modern reverse proxies that handle HTTPS automatically. One is simple. One is Kubernetes-native. Both make Nginx feel ancient.

🧊Nice Pick

Caddy

For most deployments, Caddy wins on simplicity. A 5-line Caddyfile replaces 50 lines of Nginx or Traefik config. Automatic HTTPS just works. Traefik is better if you're deep in Docker/Kubernetes and want dynamic service discovery.

The Post-Nginx Era

Nginx and Apache dominated for decades. They work, but configuring HTTPS, reverse proxying, and load balancing requires significant ceremony.

Caddy and Traefik are the modern alternatives. Both handle HTTPS automatically via Let's Encrypt. Both support reverse proxying, load balancing, and middleware. But they approach the problem differently.

Why Caddy Wins on Simplicity

A complete Caddy config for a reverse proxy with automatic HTTPS:

` example.com { reverse_proxy localhost:3000 } `

That's it. Three lines. Caddy handles the certificate, renewal, HTTP→HTTPS redirect, and OCSP stapling. No certbot, no cron jobs, no config reload.

For static sites, APIs, and simple deployments, nothing beats Caddy's ergonomics.

Why Traefik Wins in Dynamic Environments

Traefik's killer feature is automatic service discovery. In Docker:

• Add a label to your container: traefik.http.routers.myapp.rule=Host(\myapp.example.com\) • Traefik detects the new container and routes traffic to it. • No config file changes. No reload. Zero downtime.

In Kubernetes, Traefik reads Ingress resources and IngressRoute CRDs natively. Services appear and disappear, and Traefik adapts automatically.

For microservices with dozens of containers, this is transformative.

The Configuration Gap

Traefik's configuration is powerful but verbose. You're writing YAML or TOML, defining routers, services, and middleware separately. The documentation is dense.

Caddy's Caddyfile is human-readable. Most configs are under 20 lines. The documentation is some of the best in open source.

Traefik also has a nice dashboard for monitoring routes and services. Caddy has an admin API but no built-in UI.

Quick Comparison

FactorCaddyTraefik
Config SimplicityExcellent (Caddyfile)Complex (YAML/TOML)
Auto HTTPSBuilt-in, automaticBuilt-in, automatic
Docker DiscoveryVia pluginNative (labels)
KubernetesIngress controller availableFirst-class support
DashboardAdmin API onlyBuilt-in web UI
PerformanceFastFast
Memory UsageLowerHigher
DocumentationExcellentGood but dense

The Verdict

Use Caddy if: You want the simplest possible reverse proxy. Small to medium deployments, VPS hosting, static sites, or APIs. The Caddyfile is a joy.

Use Traefik if: You're running Docker Compose or Kubernetes with many services. Dynamic discovery eliminates manual config management.

Consider: Nginx is still fine for static file serving and high-concurrency scenarios. Don't migrate a working Nginx setup just because it's old.

🧊
The Bottom Line
Caddy wins

For most deployments, Caddy wins on simplicity. A 5-line Caddyfile replaces 50 lines of Nginx or Traefik config. Automatic HTTPS just works. Traefik is better if you're deep in Docker/Kubernetes and want dynamic service discovery.

Related Comparisons

Disagree? nice@nicepick.dev