caddy reload command changes the config of a running Caddy instance without downtime.
Usage
Description
Gives the running Caddy instance a new configuration. This has the same effect as POSTing a document to the/load API endpoint, but is convenient for simple workflows revolving around config files.
Since the admin endpoint is configurable, the endpoint configuration is loaded from the --address flag if specified; otherwise it is loaded from the given config file; otherwise the default is assumed.
Reloading the config is zero-downtime in most cases. Caddy will gracefully transition from the old config to the new one.
Flags
Configuration file to load (required).This is the new configuration you want to apply to the running Caddy instance.
Name of config adapter to apply.Required if the config file is not in JSON format.
Address of the administration listener, if different from config.Overrides the admin address determined from the config file.
Force config reload, even if it is the same as the current config.By default, Caddy will skip reloading if the new config is identical to the current one.
Examples
Reload with default admin address
Reload with custom admin address
Reload with adapter
Force reload even if config is unchanged
Reload with JSON config
Exit Codes
0- Success (config reloaded)1- Failed (config invalid or could not reload)
How It Works
Thecaddy reload command:
- Loads the config file from disk
- Adapts it to JSON if an adapter is specified
- Determines the admin API address from:
- The
--addressflag (highest priority) - The config file being loaded (parses admin config)
- Default address
localhost:2019
- The
- Sends a POST request to
/loadon the admin API with:- The new config as the request body
Cache-Control: must-revalidateheader (if--forceis used)Caddy-Config-Source-Fileheader (original config file)Caddy-Config-Source-Adapterheader (adapter used)
- Returns success or failure
Zero-Downtime Reloads
Caddy’s config reloads are designed to be zero-downtime:- New config is validated before applying
- New listeners are started before old ones are closed
- Active connections continue on old listeners
- New connections use the new config
- Old resources are cleaned up after active connections finish
In some rare cases, a brief interruption may occur (e.g., if binding to a new port that conflicts with the old one).
Config Caching
By default, Caddy will not reload the config if it’s identical to the current one. This is an optimization to avoid unnecessary work. To bypass this cache, use the--force flag:
Automatic Reloads
You can also reload configs automatically:Using —watch flag
Using a file watcher
Using systemd path unit
Create/etc/systemd/system/caddy-reload.path:
/etc/systemd/system/caddy-reload.service:
Troubleshooting
Config validation errors
If your new config has errors, the reload will fail and the old config will remain active:Admin API not accessible
- Caddy is running
- The admin API is enabled
- You’re using the correct admin address
Related Commands
caddy run- Start Caddy in the foregroundcaddy start- Start Caddy in the backgroundcaddy stop- Stop Caddycaddy validate- Validate a config before reloadingcaddy adapt- Preview adapted config