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
Build artifacts
Runtime dependencies
Compile time
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
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
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
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
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
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)
Static file server
Caddy's file server is the preferred way of serving static files for your website.
The way it works is simple: specify a root directory from which to serve the files, then request paths are automatically inferred as file paths relative to that root and the file is sent to the client.