What is Caddy?
Caddy is a powerful, open-source web server designed to make serving websites secure, reliable, and scalable. It automatically obtains and renews TLS certificates for all your sites, ensuring every connection uses HTTPS by default. With its modular architecture, Caddy can act as a reverse proxy, static file server, and even an internal certificate authority. It supports multiple configuration formats including the user-friendly Caddyfile and a programmable JSON API, making it adaptable to any workflow. Caddy is built with security and compliance in mind, meeting PCI, HIPAA, and NIST standards out of the box.
Beyond its core capabilities, Caddy offers advanced features such as On-Demand TLS for dynamically provisioning certificates, cluster coordination for managing multiple instances, and a robust suite of high-availability tools including health checks and load balancing. Its extensible design allows developers to write custom modules in Go, and it can integrate with FrankenPHP for significantly faster PHP performance. Trusted by industry experts and academic researchers, Caddy is a modern solution for deploying and managing web infrastructure at any scale.
Features
- Automatic HTTPS: Automatically obtains and renews TLS certificates for all sites, including localhost and internal IPs.
- Reverse Proxy: Proxies HTTP, HTTPS, WebSockets, gRPC, FastCGI with load balancing and health checks.
- Static File Server: Serves static files with compression, range requests, Etags, and directory browsing.
- Flexible Configuration: Supports Caddyfile for simple configs and JSON config with RESTful API for complex deployments.
- Extensible Architecture: Module-based system allows custom plugins written in Go to add any functionality.
Use Cases
- Deploying a secure HTTPS website with minimal configuration
- Setting up a reverse proxy for microservices or legacy applications
- Serving static sites from local filesystem, cloud storage, or embedded binaries
- Creating an internal certificate authority for private PKI management
- Building a highly available web infrastructure with dynamic backend discovery
FAQs
-
How does Caddy automatically obtain TLS certificates?
Caddy uses the ACME protocol to automatically obtain certificates from Let's Encrypt or other ACME CAs. It handles renewal and revocation seamlessly. -
What configuration formats does Caddy support?
Caddy supports its native JSON format and the simpler Caddyfile. It also has config adapters for other formats like YAML, TOML, NGINX config, and more. -
Is Caddy suitable for large-scale deployments?
Yes, Caddy is designed for high scalability with features like cluster coordination, shared storage for certificate management, and dynamic backend discovery. -
Can I extend Caddy's functionality?
Yes, Caddy has a modular architecture that allows you to write custom plugins in Go. Plugins are compiled into the binary for performance and reliability. -
Does Caddy work with PHP?
Yes, Caddy can serve PHP applications via FastCGI or, with FrankenPHP, run PHP directly in-process for better performance.