caddy(8)
Caddy is a powerful, enterprise-ready open source web server with automatic HTTPS.
Synopsis
caddy [COMMAND] [OPTIONS]Description
Caddy is a modern HTTP/2 web server written in Go that automatically obtains and renews TLS certificates from Let's Encrypt. It simplifies web server configuration with a human-readable Caddyfile format and handles HTTPS by default, eliminating the complexity of traditional web servers.
Caddy supports reverse proxying, load balancing, static file serving, and dynamic configuration through its API. It runs as a single executable with no external dependencies, making it ideal for containers and minimal deployments.
Common options
| Flag | What it does |
|---|---|
-c, --config | Path to the Caddyfile or config file to use |
-adapter | Name of the adapter to use (e.g., 'caddyfile' for Caddyfile syntax) |
-watch | Watch for changes to the config file and reload automatically |
-listen | Listen address for the admin API (default: localhost:2019) |
-validate | Parse and validate the config without starting the server |
-env-file | Path to .env file to load environment variables from |
--pidfile | Write process ID to the given file |
--resume | Resume using the last known configuration and state |
Examples
Start Caddy using the Caddyfile in the current directory
caddy runStart Caddy with a specific Caddyfile configuration
caddy run -c /etc/caddy/CaddyfileStart Caddy using a JSON config file with the caddyfile adapter
caddy run -c config.json -adapter caddyfileStart Caddy in the background (daemon mode)
caddy start -c CaddyfileValidate the Caddyfile syntax without running the server
caddy validate -c CaddyfileReload Caddy with a new configuration without stopping it
caddy reload -c CaddyfileStop a running Caddy instance gracefully
caddy stopDisplay the version and build information of Caddy
caddy version