Caddy — Overview#

Identity#

Purpose#

Caddy is an extensible, production-ready web server and application platform written in Go that provides automatic HTTPS by default. It solves the operational burden of TLS certificate management — automatically obtaining and renewing certificates from Let’s Encrypt and ZeroSSL — while supporting HTTP/1.1, HTTP/2, and HTTP/3 out of the box. It targets both individual developers who want zero-config HTTPS and organizations that need a programmable, API-driven server platform.

Significance#

Caddy is one of the most influential web servers in the Go ecosystem, having pioneered automatic HTTPS as a default behavior and inspiring other servers to follow. It introduced the concept of treating the entire server config as a single JSON document manipulable via a live admin API, enabling online configuration changes without restarts. The project manages millions of TLS certificates in production and has shaped how Go developers think about web server configuration. Its xcaddy plugin build tool and CertMagic library (a spin-off) are widely adopted in their own right.

Key metrics#

  • Go files: 302
  • Top-level directories: caddyconfig, caddytest, cmd, internal, modules, notify
  • Direct dependencies: 50
  • First commit / age: Active since ~2015 (v2 rewrite ~2019); repo is mature and production-hardened

Notable characteristics#

  • Auto-HTTPS via CertMagic: Deep integration with the caddyserver/certmagic library enables zero-config TLS certificate acquisition and renewal; the modules/caddytls and modules/caddypki packages implement a fully-managed local CA for internal names, making HTTPS the default even in development.
  • Module/plugin architecture: Nearly all server functionality — HTTP handlers, TLS providers, loggers, storage backends — is implemented as registered Caddy modules. The modules.go file exposes a global registry, allowing third-party plugins to integrate by importing a package that calls RegisterModule() during init().
  • JSON-native config with adapters: The native config format is JSON (reflecting the in-memory Go struct layout), but a config adapter system translates Caddyfile, YAML, TOML, NGINX configs, etc. into JSON at load time. This makes the internal config representation the single source of truth.
  • Live admin API: A built-in HTTP admin endpoint (admin.go) supports dynamic, partial config updates, config reloads, and status queries without restarting the server — a significant operational advantage over traditional web servers.
  • HTTP/3 (QUIC) first-class: Ships with quic-go as a direct dependency and enables HTTP/3 by default alongside HTTP/1.1 and HTTP/2, placing it ahead of most web servers in transport protocol support.
  • OpenTelemetry + Prometheus built-in: Integrates prometheus/client_golang and a full OpenTelemetry stack (traces, metrics, logs) as direct dependencies, making observability a first-class concern rather than an afterthought.