Overview
Caddy is essentially a configuration management system that can run various apps like an HTTP server, TLS certificate manager, PKI facilities, and more. It can be extended with plugins known as config modules.
Caddy sports a flexible and powerful HTTP reverse proxy, on-line configuration API, and a robust, production-ready static file server, and serves all sites over HTTPS by default with automagic TLS certificates.
Overall program technical specifications
Language
Memory safety guarantees
Build artifacts
Runtime dependencies
Compile time
~2 seconds hot
Deployment environments
- Command line interface
- System service
- Containers
- Kubernetes
- Embedded
Supply chain and releases
Operating systems
- Linux
- Windows
- macOS
- FreeBSD
- OpenBSD
- NetBSD
- Android
Microarchitectures
- x86 (i386, i686)
- x86-64 (AMD64)
- ARM
- ARM 64 (AArch64)
- MIPS
- MIPS64[LE]
- PPC64[LE]
- RISCV64
- S390X
- Apple Silicon (Apple ARM; M1, M2, etc.)
Regular expression engine
Concurrency model
Plugin model
High-level capabilities
Configuration changes
- RESTful HTTP API
- Config files
- Secure remote access
App modules
- HTTP
- TLS
- PKI
- Events
- Raw TCP & UDP
- SSH
- PHP
- Dynamic DNS
- Security
- Process supervision
- Profiling
Logs
- Leveled
- Structured
- High efficiency, zero-allocation
- Extensible
- Delete, filter, redact, and censor fields
- IP masking
- Hash values
- Regex replacement
Storage
- File system
- Embedded (in-memory)
- Postgres
- Redis
- Vault
- Consul
Command line interface
Caddy's CLI is not only useful—it's helpful. While most server CLIs merely run the process and reload config, Caddy's CLI goes the extra lightyear to help make administering your modern web server a breeze.
Plugins can register their own subcommands to extend Caddy's CLI.
Command help
caddy help
or -h
.
man
pages can also be generated)
Admin API wrappers
- Adapt config to JSON
- Start the server, optionally with config
- Gracefully reload configuration
- Stop the server
Binary utilities
- Detailed build metadata
- List installed config modules
- List dependencies
- Add and remove plugin packages
- Print the version
- Upgrade the Caddy binary
Configuration utilities
- Format Caddyfile
- Validate configuration
- List dependencies
- Add and remove plugin packages
- Print the version
Module utilities
- Static file server
- HTTP reverse proxy
- Static HTTP responses (templateable)
- Storage import/export (backup/restore)
- Hash password for use with HTTP basic auth
- Export file browse template
Integration utilities
- Generate shell completion script
- Print the environment
- Generate
man
pages - Install Caddy-managed root CA into trust stores
- Remove Caddy-managed root CA from trust stores
System signals
- INT (graceful stop)
- QUIT
- TERM
Exit codes
Configuration
We've designed Caddy so that its configuration not only provides access to features, but it IS a feature in and of itself.
No more quibbling over which config file format is the best: use whatever you want! Caddy's config adapters allow you to use whatever config format you prefer.
Native config format
Config adapters
- Caddyfile
- JSON 5
- JSON-C
- NGINX Conf
- YAML
- CUE
- TOML
- HCL
- Dhall
- MySQL
Human-friendly config
Export
Config API
Config files
Automatic HTTPS
Our flagship feature, powered by CertMagic. Caddy is the first and only major server that enables HTTPS by default, and automatically procures and renews certificates for all your sites.
Fully-native, integrated auto-HTTPS is far superior to any solution that requires external tooling or cron jobs. Caddy's certificate maintenance is the best in the industry because it is more robust, reliable, and scalable than any other solution. Caddy simplifies your infrastructure instead of complexifying it.
Sure, you can try deploying 100,000 sites with Certbot and a cron job—but if that doesn't fall over by itself, the web server will. Only Caddy is designed to massively scale TLS certificates both horizontally and vertically.
Never manually generate a CSR again. Never click a link in an email to download a certificate. Never (mis)configure your web server to use them. Never miss reminders to renew your certificates, one-by-one, every few months before they expire. You won't even have to think about certificates or TLS.
It's truly automagic.
Compliance
- PCI DSS compliant
- NIST compliant
- HIPAA compliant
- Industry best practices
On-Demand TLS
Certificate issuers
- ACME
- Internal (self-signed)
- Microsoft Active Directory Certificate Services
Certificate managers
- HTTP
- Tailscale
Cluster coordination
- Obtaining & renewing certificates
- Loading existing certificates
- OCSP staples
- Session ticket keys (STEKs)
Redirect HTTP to HTTPS
OCSP
Must-Staple
Revocation handling
Session ticket hardening
Key types
- Ed25519
- ECDSA P256
- ECDSA P384
- RSA 2048
- RSA 4096
Certificate lifetimes
Most ACME clients assume 90-day certificates, or don't expect certificates shorter than 7 days. Caddy can successfully manage certificates with lifetimes on the order of hours and minutes.
Instead of hard-coding a certain age before renewing, Caddy computes the age relative to the lifespan of each certificate, called a Renewal Window Ratio. By default, Caddy renews certificates after 2/3 of their usable lifetime. This ratio works for most validity periods, but can be adjusted.
Intelligent error handling
Built-in throttling
ACME
Caddy's ACME client is best-in-class, with higher reliability and more production experience than any other integrated ACME client available today. Caddy has been using ACME since before the public availability of Let's Encrypt, and Caddy works with any ACME-compatible CA.
Compatibility
- Let's Encrypt
- ZeroSSL
- Google Trust Services
- BuyPass
- DigiCert
- GlobalSign
- SSL.com
- Smallstep
Test endpoints
External account binding
Challenge types
- HTTP-01
- TLS-ALPN-01
- DNS-01
Alternate challenge ports
- HTTP (default 80)
- TLS-ALPN (default 443)
Smart challenge selection
DNS challenge integrations
- ACME-DNS
- AliDNS
- Cloudflare
- DigitalOcean
- DNSPod
- DuckDNS
- DynDNS
- EasyDNS
- Gandi
- GoDaddy
- Google Cloud DNS
- Hetzner
- Linode
- Name.com
- Namecheap
- Namesilo
- Netlify
- OVH
- Porkbun
- PowerDNS
- RFC 2136
- Route 53
- Scaleway
- Vercel
- Vultr
- See all...
Trusted CA certificates
Preferred chains
- Smallest
- CommonName of root
- CommonName of any
HTTP server
Caddy's HTTP server is one-of-a-kind: powerful, extensible, efficient, and modern.
HTTP versions
- HTTP/1.1
- HTTP/2
- HTTP/2 over cleartext (H2C)
- HTTP/3
HTTPS
Listen interfaces
- TCP
- UDP
- Unix sockets
Listener wrappers
- Redirect HTTP on HTTPS port
- PROXY protocol
- Tailscale
Timeouts
- Read timeout
- Read HTTP header timeout
- Write timeout
- Idle timeout
- TCP keepalive interval
Full duplex communication
- Configurable for HTTP/1
- Default for HTTP/2
Error handling
TLS termination
- TLS 1.2
- TLS 1.3
- Client authentication (TLS mutual auth; mTLS)
- Client auth modes: request, require, verify if given, require and verify
- Cipher suites
- Curves
- ALPN
- Limit protocol versions
- Default SNI
- Fallback SNI
Cross-site security
Access logs
- More useful than Common Log Format (CLF)
- Request headers (except sensitive fields)
- Response headers
- Remote IP
- Latency
Observability
Request handling
Request filters
- Host
- Path
- Method
- Headers
- Protocol
- Remote IP
- Arbitrary CEL expression
- File (existence, size, modify date)
- HTTP route variable
- Logical NOT
- Geolocation
- Remote host
HTTP handlers
Handlers are modules that can be composed together to handle incoming requests precisely the way you want. Handler modules are, like the rest of Caddy, extensible and pluggable. It is not really feasible for us to list all the handlers here.
In practice, handlers are paired with matchers which filter or classify requests based on various properties such as their path, headers, query string, method, and more. This allows you to selectively apply any and all of these handlers to certain requests.
ACME server
Authelia
Authentication
- HTTP Basic authentication
- JWT
- Discord
- Forms
- SAML
Advanced auth
- Form-based
- Local
- Basic
- LDAP
- OpenID Connect
- OAuth 2
- SAML
Cache
- Badger
- Etcd
- NutsDB
- Olric
- Redis
Encode
- Gzip
- Zstandard (zstd)
- Brotli
File server
Go package vanity paths
gRPC-Web bridging
Header manipulation
- Add
- Set (overwrite)
- Delete
- Substring replace
Image filtering
- Crop
- Fit
- Flip
- Resize
- Rotate
- Sharpen
Map
Mercure
Metrics
HTTP/2 server push
Rate limiting
- Local or distributed
- Multiple zones
- Buffer pooling
- Only 1 goroutine
- Configurable O(Kn) memory management
- State persisted through reloads
- Sets Retry-After header
- Optional jitter
- Highly programmable
Request body controls
Reverse proxy
Rewrite requests
- Method
- URI (path, query string)
- Strip path prefix or suffix
- Regular expression support
- Intelligent URL-encoding and forward-slash handling
Static responses
Subrouting
Templates
Tracing
Variables
WebDAV
Reverse proxy
Caddy has the most flexible general-purpose reverse proxy in the world, featuring advanced request and response handling, dynamic routing, health checking, load balancing, circuit breaking, and more.
What makes Caddy's proxy unique is its design. Only the client-facing side of the proxy needs to be HTTP; the transport underlying the roundtrip with the backend can be fulfilled with any protocol!
Moreover, our proxy can be programmed with highly dynamic upstreams. That is, the available upstreams can change during in-flight requests! If no backends are available, Caddy can hold onto the request until one is.
High-level proxy features
Transports
- HTTP
- FastCGI
- NTLM
Load balancing
- Random
- Random Choose-N
- Least connections
- Round robin
- Weighted round robin
- First available
- Remote IP hash
- Client IP hash
- URI hash
- Query hash
- Header hash
- Cookie hash
Circuit breaking
Health checking
- Active
- Passive
Observability
Upstream sources
- Static
- Dynamic: A records
- Dynamic: SRV records
- Dynamic: Multiple sources combined
Retries
Streaming
Trusted proxies
Header manipulation
- Add
- Set (overwrite)
- Delete
- Substring replace
Buffering
- Requests
- Responses
Request rewriting
Response interception
Active health checks
Active health checks assume a backend is down by default until that is confirmed otherwise by a health check.
HTTP request parameters
- Path & query string
- Port
- Headers
Timing
Success criteria
- Response timeout
- HTTP status code
- Regular expression match on body
Failure safety
Passive health checks
Passive health checks assume a backend is up by default until failure criteria are met in the course of proxying requests.
Failure criteria
- Concurrent request limit exceeded
- HTTP Status
- Latency
Failure memory
HTTP transport
This is the default transport module. It crafts a proxied HTTP request to obtain an HTTP response from the backend.
DNS resolvers
TLS
- Custom root CA pool
- Client authentication to backend
- Custom handshake timeout
- Server Name Indicator (SNI)
- Renegotiation level
- Exempt certain ports from TLS
Connection pooling
- HTTP Keep-Alive
- Custom probe interval
- Maximum idle connections (total and per-host)
- Idle connection timeout
Compression
Connection limit
PROXY Protocol
Timeouts
- Connection (dial)
- RFC 6555 fallback
- Reading response headers
- Expect continue
- Read
- Write
Custom buffer sizes
- Read buffers
- Write buffers
HTTP versions
- HTTP/1.1
- HTTP/2
- H2C (HTTP/2 over cleartext)
FastCGI transport
FastCGI is typically used to serve PHP applications via php-fpm. FastCGI responders may require additional information about the script being run such as script name, path relative to root, etc., and Caddy's FastCGI transport takes care of all of that and makes it configurable.
Highly efficient
Path splitting
Resolve root symlink
Environment variables
Timeouts
- Dial (connect)
- Read
- Write
Capture stderr
Static file server
Caddy's file server is the premier way of serving static files for your website.
It's simple: specify a root directory from which to serve the files, then each request path is automatically appended to the root to get the full path of the file to serve.
Kernel acceleration
Virtual file systems
- Local disk
- Embedded assets
- Amazon AWS S3
Precompressed files
- Gzip
- Brotli
- Zstandard
Hide files and folders
Index filenames
Conditional requests
- Etag
- Last-Modified
- If-Match
- If-None-Match
- If-Modified-Since
- If-Unmodified-Since
- If-Range
Range requests
Canonical paths
Pass-thru mode
File browser
Caddy's file server comes alive through its modern file browser that looks attractive on mobile and desktop. It has more features and utility than any other standard HTTP file server!
Folder listings
Day and night themes
- Light mode
- Dark mode
Sort by columns
- File/directory
- Name
- Size
- Date modified
Filter
Layout
- List
- Grid
Responsive design
JSON API
Accept-Encoding: application/json
header will be replied to with a JSON payload for programmatic or scripted access to your file listing.
Customizable listing template
File size visualization
File type icons
Caddy is a living project with a TON of features. This page is not yet a comprehensive list of all the features and benefits provided by Caddy because there's so many to mention. We welcome contributions on GitHub!