$linuxjunkies
>

caddy(8)

Caddy is a powerful, enterprise-ready open source web server with automatic HTTPS.

UbuntuDebianFedoraArch

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

FlagWhat it does
-c, --configPath to the Caddyfile or config file to use
-adapterName of the adapter to use (e.g., 'caddyfile' for Caddyfile syntax)
-watchWatch for changes to the config file and reload automatically
-listenListen address for the admin API (default: localhost:2019)
-validateParse and validate the config without starting the server
-env-filePath to .env file to load environment variables from
--pidfileWrite process ID to the given file
--resumeResume using the last known configuration and state

Examples

Start Caddy using the Caddyfile in the current directory

caddy run

Start Caddy with a specific Caddyfile configuration

caddy run -c /etc/caddy/Caddyfile

Start Caddy using a JSON config file with the caddyfile adapter

caddy run -c config.json -adapter caddyfile

Start Caddy in the background (daemon mode)

caddy start -c Caddyfile

Validate the Caddyfile syntax without running the server

caddy validate -c Caddyfile

Reload Caddy with a new configuration without stopping it

caddy reload -c Caddyfile

Stop a running Caddy instance gracefully

caddy stop

Display the version and build information of Caddy

caddy version

Related commands