Caddy — Fast Web Server with Automatic HTTPS
Caddy is a modern web server with automatic HTTPS by default. Zero-config TLS certificates, reverse proxy, file server, and load balancer — all in a single binary.
What it is
Caddy is a modern web server written in Go. Its defining feature is automatic HTTPS: Caddy obtains and renews TLS certificates from Let's Encrypt without any configuration. It also functions as a reverse proxy, file server, and load balancer. The entire server ships as a single binary with no external dependencies.
Caddy targets developers and sysadmins who want HTTPS without manual certificate management. It replaces Nginx or Apache for common use cases with dramatically simpler configuration. The Caddyfile configuration format is human-readable and concise.
How it saves time or tokens
Caddy eliminates the certificate management workflow entirely. No certbot, no cron renewal jobs, no manual configuration of TLS settings. Point Caddy at your domain and it handles everything. The Caddyfile format reduces configuration from dozens of Nginx lines to a few lines. Reverse proxy setup is a single line rather than a separate location block.
How to use
- Install Caddy:
curl -sS https://getcaddy.com | bashor via package manager. - Create a Caddyfile with your domain and proxy/file-server directives.
- Run
caddy runand Caddy automatically obtains HTTPS certificates.
Example
# Quick reverse proxy (one command)
caddy reverse-proxy --from yourdomain.com --to localhost:3000
# Quick file server with HTTPS
caddy file-server --domain yourdomain.com
# Caddyfile for a typical setup
yourdomain.com {
reverse_proxy localhost:3000
}
api.yourdomain.com {
reverse_proxy localhost:8080
}
static.yourdomain.com {
root * /var/www/static
file_server
encode gzip
}
Related on TokRepo
- DevOps Tools — Server and infrastructure tools
- Self-Hosted Tools — Self-hosted infrastructure
Common pitfalls
- Caddy needs ports 80 and 443 open for automatic HTTPS. If another process (Nginx, Apache) occupies these ports, Caddy cannot obtain certificates.
- The Caddyfile syntax is different from Nginx conf. Do not try to translate Nginx config line-by-line; learn the Caddyfile idioms.
- Caddy's JSON config is the canonical format; the Caddyfile is syntactic sugar. For complex setups, you may need to use the JSON API directly.
Frequently Asked Questions
Caddy uses the ACME protocol to obtain TLS certificates from Let's Encrypt (or ZeroSSL) automatically. It handles domain verification, certificate issuance, and renewal without any configuration. Just specify your domain name.
For most use cases, yes. Caddy handles reverse proxy, file serving, load balancing, and TLS termination. Nginx has more third-party modules and handles higher connection counts. Caddy is simpler for typical web serving.
Yes. Caddy supports round-robin, least connections, random, and IP hash load balancing. Configure multiple upstream servers in the reverse_proxy directive.
Yes. Caddy is open source under the Apache 2.0 license. There is no paid tier for the server itself. The company behind Caddy offers commercial support and enterprise features separately.
Yes. Official Docker images are available. Mount your Caddyfile and data directory, expose ports 80 and 443, and Caddy handles HTTPS automatically inside the container.
Citations (3)
- Caddy GitHub— Caddy provides automatic HTTPS with zero configuration
- Caddy Documentation— Caddyfile configuration and reverse proxy setup
- Caddy Official Site— ACME protocol for automatic certificate management
Related on TokRepo
Source & Thanks
- GitHub: caddyserver/caddy — 71.4K+ ⭐ | Apache-2.0
- Website: caddyserver.com
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.