Caddy
caddyserver · Networking & edge
GitHub stars
78,571Awaiting first sync
No measured star history yet
What is Caddy?
Caddy sits in front of your apps and handles the part of web hosting that most often goes wrong: certificates. It obtains and renews them automatically, so a small team can run several internal and public tools on one server without a person tracking expiry dates.
Caddy is a web server and reverse proxy that gets and renews HTTPS certificates for your sites by default. It serves static files, forwards traffic to your apps, and is set up with a short Caddyfile or a JSON config API. HTTP/1.1, HTTP/2 and HTTP/3 are all supported.
Core capabilities
- Gets and renews HTTPS certificates for your domains on its own, and redirects HTTP to HTTPS.
- Puts apps behind one server with a few lines of Caddyfile and the reverse_proxy directive.
- Applies new settings with no downtime through its API, and takes plugins via an xcaddy build.
Why automatic HTTPS matters when you self-host
Self-hosted apps hold logins and customer data, and browsers warn visitors when a site is not on valid HTTPS. A missed renewal can take a tool offline. Caddy gets certificates from Let's Encrypt and ZeroSSL for public names, renews them, and redirects HTTP to HTTPS. If issuing fails it retries and tries the next issuer, backing off for up to 30 days.
- HTTPS
- Let's Encrypt
- ZeroSSL
- Certificates
A short config for proxies and static sites
The Caddyfile is the simple way to set Caddy up: a domain, then directives such as reverse_proxy to send traffic to an app, or file_server to serve a folder. HTTP/3 is on by default alongside HTTP/1.1 and HTTP/2. Underneath, the native config is JSON, and a REST admin API can export it or change one part at a time.
- Caddyfile
- Reverse proxy
- HTTP/3
- Config API
Install, licence and plugins
Caddy is a single Go binary with no dependencies. Install it from GitHub releases, Debian, Ubuntu, Fedora and Arch packages, or the caddy Docker image. The code is Apache-2.0. Official packages carry only standard modules, so third-party plugins need a custom build with xcaddy. The name Caddy is a registered trademark.
- Apache-2.0
- Docker
- xcaddy
- Plugins
Where it fits
Use cases
- 01
Put HTTPS in front of a self-hosted app
Point the domain's DNS records at your server and open ports 80 and 443. Write the domain and a reverse_proxy line with the app's port in a Caddyfile, run Caddy, and it requests the certificate and passes traffic to the app.
- 02
Publish a static website
Put the site's files in a folder, add a Caddyfile with the domain and the file_server directive, and start it with caddy run. Add browse after file_server if you want a file listing where there is no index file.
- 03
Change routing without taking sites offline
Send the new config to Caddy's admin API with a POST to /load, by default on localhost:2019. Caddy applies it with no downtime and keeps the previous config if the new one fails.