Lesson 1 of 9 · 22m
The Caddy Mental Model: HTTPS Is the Default
Why Caddy treats certificates as infrastructure rather than a chore, and the operational conditions automatic HTTPS quietly depends on.
The first Caddy deployment I ever inherited looked impossible: no certbot cron, no certificate renewal scripts, no TLS file paths, and yet every host had a valid certificate. That is the point. Caddy's core bet is that TLS is not an advanced feature bolted onto a web server — it is part of serving a hostname correctly.
HTTPS is attached to identity
When you write this:
app.internal.example.net
reverse_proxy 127.0.0.1:8080you are not just saying "listen for this name." You are declaring an identity. If the name is publicly resolvable, Caddy will try to obtain and renew a publicly trusted certificate automatically. If the name is localhost or otherwise not publicly issuable, Caddy falls back to its internal certificate authority instead of silently serving plaintext.
That inversion matters operationally. With nginx, the usual failure is forgetting renewal plumbing. With Caddy, the usual failure is exposing a hostname before DNS, routing, firewall, or port 80/443 reachability is correct — then wondering why issuance fails.
What the automation actually needs
For normal public certificates, assume Caddy must be reachable from the internet:
client / ACME validator
|
v
ports 80 and/or 443 -> Caddy process -> correct site blockThe HTTP-01 challenge uses port 80. TLS-ALPN-01 uses port 443. You do not need both for every issuance, but if you firewall one away you narrow the challenge options and create confusing failures. Renewal is the same machinery, running in the background long after the first certificate appears.
Caddy stores certificates, keys, and ACME account data under its application data directory — commonly /var/lib/caddy/.local/share/caddy when run as the packaged caddy user. Lose that directory on a busy edge and you may re-issue many certificates at once. Treat it as state, not disposable cache.
The important boundary
Automatic HTTPS does not mean "any string in the config gets a real certificate." Public certificate authorities only issue for names they can validate. Internal names, bare IPs, and private-only services use Caddy's local CA or need the DNS challenge. That distinction is a mental-model issue, not a configuration detail: decide whether the edge is public before choosing the TLS design.
Field notes
caddy runis for foreground debugging; production normally uses the systemd service andcaddy reloadfor changes.- If issuance is failing, inspect logs before touching config. The ACME error usually tells you whether validation never arrived or arrived at the wrong server.
- Never copy another machine's certificate directory as a scaling strategy. Shared storage and certificate state need deliberate design.
- Automatic HTTPS removes renewal scripts, not DNS discipline. Bad DNS is still bad DNS.
Was this lesson helpful?