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.
</p>
<p>
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.
</p>
<h3class="green">Overall program technical specifications</h3>
<divclass="feature-list">
<divclass="feature-row">
<h4>Language</h4>
<divclass="benefits">
The language choice is crucial for a web server. Most servers (NGINX, Apache, HAProxy, etc.) and their dependencies are written in C, which are vulnerable to catastrophic memory safety bugs like Heartbleed. Go programs like Caddy are impervious to a whole class of security vulnerabilities.
Caddy is statically compiled. Dynamically-linked applications can easily break in production and may be less secure as shared executable resources are loaded from various places around the system. Generally, Caddy binaries do not necessarily require external libraries — not even libc.
On consumer hardware, standard Caddy builds compile in just a few seconds. This is crucial for rapid iteration, plugin development, and low-cost deployments.
Caddy's regular expression language is <ahref="https://swtch.com/~rsc/regexp/regexp1.html">based on the Thompson NFA and has numerous performance improvements over PCRE</a> used by other web servers. It guarantees the runtime cost increases linearly instead of exponentially. This is ideal when evaluating untrusted input.
Go's runtime optimizes scheduled CPU time in smarter ways than the operating system can using lightweight user-space threads called goroutines. Caddy easily handles hundreds of thousands of requests per second.
Caddy can be extended by compile-time plugins, which compile as native code, in a way that cannot be broken during deployments or by system upgrades. With no IPC or RPC calls, Caddy extensions perform equally well with native code.
Top-level configuration structures are called app modules, or Caddy apps. They provide the bulk of Caddy's functionality. Anyone can write app modules, and Caddy comes with several standard apps built-in.
Assets and state, including certificates and OCSP staples, are stored in configurable storage backends. In fact, multiple instances of Caddy configured with the same storage are considered part of a cluster and can coordinate automatically.
Caddy's CLI is not only useful—it's <i>helpful</i>. 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.
</p>
<p>
Plugins can register their own subcommands to extend Caddy's CLI.
</p>
<divclass="feature-list">
<divclass="feature-row">
<h4>Command help</h4>
<divclass="benefits">
If you misspell a command or flag, miss an argument, or don't know the subcommand, help text is automatically printed. You can also access overall command help or subcommand help with <code>caddy help</code> or <code>-h</code>.
</div>
<divclass="detail">
Built-in, automatic (<code>man</code> pages can also be generated)
Several subcommands use administration API endpoints for use with the CLI to help you perform common tasks like loading config from files or stopping the server.
</div>
<ulclass="detail">
<li>Adapt config to JSON</li>
<li>Start the server, optionally with config</li>
<li>Gracefully reload configuration</li>
<li>Stop the server</li>
</ul>
</div>
<divclass="feature-row">
<h4>Binary utilities</h4>
<divclass="benefits">
Since custom builds of Caddy are so common, several commands exist to help you manage and get detailed information about your build.
</div>
<ulclass="detail">
<li>Detailed build metadata</li>
<li>List installed config modules</li>
<li>List dependencies</li>
<li>Add and remove plugin packages</li>
<li>Print the version</li>
<li>Upgrade the Caddy binary</li>
</ul>
</div>
<divclass="feature-row">
<h4>Configuration utilities</h4>
<divclass="benefits">
If you choose to use configuration files, Caddy's CLI helps you manage them.
</div>
<ulclass="detail">
<li>Format Caddyfile</li>
<li>Validate configuration</li>
<li>List dependencies</li>
<li>Add and remove plugin packages</li>
<li>Print the version</li>
</ul>
</div>
<divclass="feature-row">
<h4>Module utilities</h4>
<divclass="benefits">
Modules may register their own subcommands to provide common functionality that can be utilized without a config document.
</div>
<ulclass="detail">
<li>Static file server</li>
<li>HTTP reverse proxy</li>
<li>Static HTTP responses (templateable)</li>
<li>Storage import/export (backup/restore)</li>
<li>Hash password for use with HTTP basic auth</li>
<li>Export file browse template</li>
</ul>
</div>
<divclass="feature-row">
<h4>Integration utilities</h4>
<divclass="benefits">
Several subcommands can help you integrate Caddy into your shell environment.
</div>
<ulclass="detail">
<li>Generate shell completion script</li>
<li>Print the environment</li>
<li>Generate <code>man</code> pages</li>
<li>Install Caddy-managed root CA into trust stores</li>
<li>Remove Caddy-managed root CA from trust stores</li>
</ul>
</div>
<divclass="feature-row">
<h4>System signals</h4>
<divclass="benefits">
Caddy has support for common operating system signals/interrupts, with subtle differences in behavior for each one.
Whether Caddy exits successfully or with an error, the <ahref="/docs/command-line#exit-codes">exit code</a> can give a hint to your process supervisor or script how to handle that.
We've designed Caddy so that its configuration not only provides access to features, but <i>it IS a feature</i> in and of itself.
</p>
<p>
No more quibbling over which config file format is the best: use whatever you want! Caddy's <ahref="/docs/config-adapters">config adapters</a> allow you to use whatever config format you prefer.
</p>
<divclass="feature-list">
<divclass="feature-row">
<h4>Native config format</h4>
<divclass="benefits">
Caddy's native configuration format is ubiquitous: it has tooling in nearly every operating system, platform, programming language, and API ecosystem. Almost all other formats can be translated down into JSON, which balances human readability and programmability. You'll find it a powerful ally of your web server.
</div>
<divclass="detail">
JSON
</div>
</div>
<divclass="feature-row">
<h4>Config adapters</h4>
<divclass="benefits">
You can always write your config in another format and with config adapters, Caddy will implicitly translate it into JSON for you so you can work with what you like.
</div>
<ulclass="detail">
<li>Caddyfile</li>
<liclass="nonstandard">JSON 5</li>
<liclass="nonstandard">JSON-C</li>
<liclass="nonstandard">NGINX Conf</li>
<liclass="nonstandard">YAML</li>
<liclass="nonstandard">CUE</li>
<liclass="nonstandard">TOML</li>
<liclass="nonstandard">HCL</li>
<liclass="nonstandard">Dhall</li>
<liclass="nonstandard">MySQL</li>
</ul>
</div>
<divclass="feature-row">
<h4>Human-friendly config</h4>
<divclass="benefits">
The Caddyfile is most users' favorite way to write their web server config by hand because its syntax is forgiving while also being designed with a structure that makes it easy to read and write. It is translated to JSON automatically.
</div>
<divclass="detail">
Caddyfile
</div>
</div>
<divclass="feature-row">
<h4>Export</h4>
<divclass="benefits">
Caddy's administration API allows you to have runtime access to the current configuration in JSON format with a simple GET request.
</div>
</div>
<divclass="feature-row">
<h4>Config API</h4>
<divclass="benefits">
Caddy receives its configuration through an API endpoint, which can accept JSON or any other format it has a config adapter for.
</div>
</div>
<divclass="feature-row">
<h4>Config files</h4>
<divclass="benefits">
If you prefer normal commands to manage configuration, Caddy's CLI wraps the API endpoints for you.