Caddy Web Server: The Basics and What It Can Do
|
November 28, 2026
|
Development
Caddy is a powerful, enterprise-ready, open-source web server written in Go. Its headline feature is automatic HTTPS: the moment you point a domain at Caddy, it automatically obtains, installs, and renews TLS certificates from Let’s Encrypt — no configuration, no separate tooling, no expiring certificates to babysit. As of late 2026, the current stable release line is Caddy v2.11.x, with regular releases shipping performance improvements, security patches, and new features.
Why Caddy Exists
Traditional web servers like Apache and Nginx require extensive configuration, often spanning multiple files, with separate processes or scripts needed for TLS certificate management. Caddy takes a different philosophy: sensible defaults and simplicity first. A fully functional HTTPS site can be served with a single-line configuration, making it attractive for developers, hobbyists, and teams who want to ship without wrestling server configuration.Key Features
Automatic HTTPS by default. Unlike its predecessors, Caddy does not serve plain HTTP unless you ask it to. It automatically provisions certificates via ACME, handles renewals in the background, and gracefully falls back if a certificate cannot be obtained. It also supports custom certificate authorities, self-signed certificates, and static certificates for environments where ACME isn’t viable. Simple configuration. Caddy uses the Caddyfile, a human-readable, minimal configuration format. For example, serving a site over HTTPS with a reverse proxy backend might look like:example.com {
root * /var/www/html
file_server
reverse_proxy /api/* api.example.com:8080
}
That’s genuinely all that’s needed. For more complex setups, a full JSON configuration (available over the admin API) supports programmatic management.
Modern protocol support. Caddy ships with HTTP/2 and HTTP/3 (QUIC) support out of the box, along with TLS 1.3, OCSP stapling, and HSTS — features that on other servers often require extra configuration.
Reverse proxy and load balancing. Caddy works as a reverse proxy in front of application backends (Node.js, Python, Go services, databases with HTTP interfaces, etc.), with support for load balancing, health checks, and retry logic.
Extensibility through modules. Written in Go, Caddy is highly extensible. Developers can write plugins as Go modules compiled into the binary, covering everything from custom log formatting to authentication schemes and API gateways. The official module ecosystem includes features like rate limiting, basic/digest auth, JWT validation, WebSockets, and compression.
Static site serving. Caddy handles static file serving with clean URLs, directory listings (opt-in), and efficient file caching, making it a lightweight choice for static sites and SPAs.
