TiloBox
Back to directory
Caddy project preview

Caddy

An extensible web server and reverse proxy with automatic HTTPS, configuration APIs, modules, and HTTP/3 support.

LicenseApache-2.0
GitHub stars75.2k
Last commit1 weeks ago
Tags7 topics
GoReverse ProxyProductivityWeb ServerOpen SourceAutomatic HttpsDeveloper Tools
Overview

Why consider Caddy?

An extensible, open-source web server written in Go that automatically provisions and renews TLS certificates by default.

Guided learning

Learn Caddy by building

Practical setup notes, real use cases, and copy-ready examples in one focused guide.

3 min read 3 sections
In this guide3 sections

Caddy is an open-source web server written in Go that differentiates itself by automatically handling TLS certificate provisioning and renewals out of the box. As described in the project repository, it acts as an extensible platform that uses TLS by default. Instead of requiring external tools or cron jobs to manage certificates, the server handles these negotiations internally.

Core Configuration Architecture

At its core, Caddy operates on a dynamic JSON structure. The getting started documentation explains that its configuration is natively just a JSON document. Unlike traditional static text configurations, this native format allows the server to be completely programmable at runtime. You can update routing rules, add new virtual hosts, or change load balancing policies via the server's REST API without restarting the process or dropping existing connections.

Because JSON can be verbose for human operators, the project provides a simpler configuration language called the Caddyfile. When you launch the server using a Caddyfile, a built-in config adapter automatically converts the human-readable text into the native JSON structure the server requires. This layered approach means you can use the simpler format for everyday deployments, but switch to the JSON API for automated or complex infrastructure.

Operating as a Reverse Proxy

One of the most common workflows is placing Caddy in front of internal application servers. The built-in reverse proxy module can handle load balancing, health checks, and automatic header management.

For simple local development or quick testing, the reverse proxy guide notes that you can bypass configuration files entirely and run the proxy directly from your terminal. The following command binds the server to port 2080 and forwards all traffic to a backend service running on port 9000:

bash
1caddy reverse-proxy --from :2080 --to :9000

By supplying a domain name instead of a local port, the server automatically provisions the necessary certificates. Caddy serves the proxy over HTTPS automatically and by default if it knows the target hostname, meaning you don't need additional steps to secure the connection.

Setup and Verification Steps

When you supply a configuration file, the daemon will load it and begin listening on the specified ports. If you are using the JSON format, you must POST the file to the administration endpoint:

  1. Create your caddy.json file.
  2. Start the daemon using caddy run.
  3. Submit the configuration via curl localhost:2019/load -H "Content-Type: application/json" -d @caddy.json.

Alternatively, if you are relying on the adapter, placing a file named Caddyfile in your working directory and running caddy run will automatically parse and apply the rules. To apply updates without downtime, running caddy reload evaluates the new configuration and gracefully swaps the active routing table while preserving active connections.

If the new configuration fails to load, the server aborts the update and rolls back to the old configuration to prevent downtime, preventing a bad update from taking your site offline.

Related tools

More options with a similar category or technology profile.

Caddy FAQs

Caddy is listed as a Developer Tools tool on TiloBox. Review the overview, features, and official documentation on this page to decide whether it solves your specific workflow.

Start with the project's GitHub repository and official website for supported installation and deployment instructions. Test the setup with representative data or a small project before rolling it out more widely.

Caddy is listed under the Apache-2.0 license. Read the complete license text and the project's notices before using, modifying, or distributing the software.

Production readiness depends on your requirements. Review maintenance activity, security practices, documentation, backup and upgrade procedures, and compatibility with your stack; then validate it in a non-production environment.

Caddy is listed as an alternative to Nginx. Compare the core workflow, deployment model, integrations, and licensing against your must-have requirements before switching.