Skip to main content

Caddy Caddyfile Generator

Generate a production-ready Caddyfile for your server. Caddy automatically provisions and renews HTTPS certificates — no certbot needed. Supports static sites, reverse proxies, PHP-FPM, and API gateways.

✓ Automatic HTTPS ✓ Reverse proxy + health checks ✓ Security headers built-in

Frequently Asked Questions

What is Caddy?▼

Caddy is a modern, open-source web server written in Go. Its killer feature is automatic HTTPS — it automatically obtains and renews TLS certificates from Let's Encrypt with zero configuration. It's simpler than nginx for most use cases, with a human-readable Caddyfile config format, HTTP/2 and HTTP/3 support, and a powerful plugin ecosystem.

How does Caddy automatic HTTPS work?▼

When you specify a real domain in the Caddyfile (e.g., 'example.com {}'), Caddy automatically requests a TLS certificate from Let's Encrypt via ACME. It handles domain validation, certificate renewal (60 days before expiry), and reloads automatically. No certbot, no cron jobs. Works for any publicly reachable domain pointing to your server.

What is the difference between Caddy and nginx?▼

Caddy's strengths: automatic HTTPS (zero config), simpler config syntax, built-in HTTP/3 (QUIC), auto-reload on config change, and a JSON API for dynamic config. nginx's strengths: lower memory use, more fine-grained tuning, decades of production battle-testing, wider hosting panel support. For new projects, Caddy is often faster to set up. For high-performance tuning, nginx gives more knobs.

How do I reverse proxy with Caddy?▼

Minimal Caddyfile: 'example.com { reverse_proxy localhost:3000 }'. That's it — Caddy handles HTTPS automatically. For health checks: 'reverse_proxy localhost:3000 { health_uri /health; health_interval 10s }'. For load balancing multiple backends: 'reverse_proxy localhost:3000 localhost:3001 localhost:3002'. Default balancing is round-robin.

How do I run Caddy?▼

Install: on Ubuntu, 'sudo apt install caddy'. Place your Caddyfile in /etc/caddy/Caddyfile. Start: 'sudo systemctl start caddy'. Test config: 'caddy validate --config /etc/caddy/Caddyfile'. Apply without restart: 'caddy reload --config /etc/caddy/Caddyfile'. For Docker: 'docker run -p 80:80 -p 443:443 -v $PWD/Caddyfile:/etc/caddy/Caddyfile caddy'.

How do I add plugins to Caddy?▼

Caddy plugins are compiled in. Use the official builder: xcaddy (go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest). Build with plugins: 'xcaddy build --with github.com/mholt/caddy-ratelimit'. Or use the web builder at caddyserver.com/download to download a custom binary. Common plugins: caddy-ratelimit, caddy-crowdsec-bouncer, caddy-dns/* for DNS challenges.

Sponsored

Disclosure

Affiliate disclosure: some links below may earn us a small commission at no cost to you. Learn more

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →