Back to services

Caddy

Powerful, enterprise-ready, open source web server with automatic HTTPS.

View alternatives to Caddy
Suggest edit
Open source
Self-hostable
Apache-2.0
Recent reviews

Alternatives

Tech stack

No tech stack added yet. Sign in to suggest some

Overview

Caddy is an open-source web server written in Go. It is currently operated by ZeroSSL and funded by sponsorships. Its defining feature is that it enables HTTPS for all sites by default: it automatically obtains, renews, and maintains TLS certificates, and that includes localhost and internal IPs. The project describes it as the first server to fully automate the management of public certificates, and says it currently manages more than 50 million certificates.

Key Features

Automatic HTTPS and TLS

  • Automatically obtains and renews TLS certificates for all sites by default.
  • On-Demand TLS: obtains a certificate on the fly during the TLS handshake, which suits white-label SaaS providers that need to serve HTTPS on their customers' own domains.
  • Can reliably manage certificates for hundreds of thousands of sites.
  • The default TLS configuration meets PCI, HIPAA, and NIST compliance requirements.
  • OCSP stapling is enabled by default and responses are cached; if a certificate is revoked, it is renewed automatically.
  • When multiple instances share the same storage, they coordinate certificate management automatically and share keys and OCSP staples.

Internal PKI (Public Key Infrastructure)

  • Includes a complete built-in PKI suite based on open-source Smallstep libraries.
  • Localhost and internal addresses use short-lived certificates issued by a locally trusted CA, and the root certificate can be installed automatically into the local trust store.
  • You can create multiple private CAs, with root and intermediate keys generated automatically; intermediate certificates are renewed automatically before they expire.
  • Can act as an ACME server and issue certificates to other Caddy instances.

Reverse Proxy

  • Supports proxying HTTP/HTTPS, WebSocket, gRPC, and FastCGI (commonly used for PHP), with extensible transport modules.
  • Built-in load balancing, active and passive health checks, retries, circuit breaking, and load limiting.
  • Supports dynamic backends, for example looking up backend addresses via SRV records on every request, which suits frequently changing environments.
  • Configuration changes take effect gracefully without dropping connections. The project states that all of these high-availability features are free, with no enterprise paywall.

Static File Serving

  • Supports on-the-fly compression or serving precompressed files; the project says it was the first web server to support Zstandard encoding.
  • Supports virtual file systems, so files can be read from local disk, cloud storage, or a database, or served from content embedded in the binary.
  • Fully supports production features such as Range requests and ETags.
  • Offers an optional directory browsing interface with breadcrumb navigation and a grid view.

Flexible Configuration

  • Caddyfile: a concise, readable configuration format that lets you set up a production-ready site in just a few lines.
  • JSON: the native configuration format, which can be modified dynamically through a RESTful management API (listening on localhost:2019 by default). The API provides ACID guarantees and scopes changes by URI path, so other parts of the configuration aren't changed by accident.
  • Config adapters: you can use formats such as YAML, TOML, CUE, HCL, and NGINX configuration files.

Modularity and Extensibility

  • At its core is a configuration manager, on top of which various apps run, such as the HTTP server, certificate management, and the internal CA.
  • Plugins are written in Go and compiled into the same static binary. You choose only the ones you need, with no RPC overhead.
  • Combined with FrankenPHP, it can serve as a PHP application server without needing php-fpm.

Target Users and Use Cases

  • Individual developers and site owners who want to set up HTTPS for their sites quickly
  • SaaS platforms that need to issue certificates for large numbers of customer custom domains
  • Operations teams building reverse proxies and load balancers
  • Enterprises that want to deploy a private CA for internal services and development environments
  • Self-hosting users who want a single entry point for Docker containers or homelab services

Core Strengths

  • Secure defaults: uses HTTPS and modern TLS settings with no extra configuration, and has been cited in several peer-reviewed papers.
  • Simple configuration: the project states that a Caddyfile is typically only 15%–25% as long as the equivalent nginx configuration.
  • Single static binary: no external library dependencies, making deployment simple.
  • Programmable: configuration can be changed live through the REST API, which suits automation and large-scale deployments.
  • Memory safe: Go's TLS stack is more memory-safe than OpenSSL.

Installation and Deployment

Download the binary for your platform from the official download page, or install it using your system package manager or the official Docker image as described in the documentation. The download page also lets you select plugins to build a customized version.

A minimal Caddyfile example:

example.com {
	reverse_proxy localhost:8080
}

After you run caddy run, as long as the domain already resolves to this server, Caddy will automatically obtain a certificate and enable HTTPS.

Technical Requirements

  • Cross-platform, running as a single static binary.
  • To obtain public certificates automatically, the domain must resolve to the server, and ports 80/443 generally need to be reachable from the public internet.
  • Developing plugins requires knowledge of Go.

Notable Points

  • Free and open source, funded by sponsorships; companies can purchase sponsorships to get private support and training services.
  • Used by companies such as Stripe for internal systems.
  • The website offers a live demo: point a caddydemo subdomain at the demo server to try automatic certificate issuance.