Scroll to navigation

CADDY-RUN(1) General Commands Manual CADDY-RUN(1)

NAME

caddy-run - Starts the Caddy process and blocks indefinitely

SYNOPSIS

caddy run [--config <path> [--adapter <name>]] [--envfile <path>] [--environ] [--resume] [--watch] [--pidfile <fil>]

DESCRIPTION

Starts the Caddy process, optionally bootstrapped with an initial config file, and blocks indefinitely until the server is stopped; i.e. runs Caddy in "daemon" mode (foreground).

If a config file is specified, it will be applied immediately after the process is running. If the config file is not in Caddy's native JSON format, you can specify an adapter with --adapter to adapt the given config file to Caddy's native format. The config adapter must be a registered module. Any warnings will be printed to the log, but beware that any adaptation without errors will immediately be used. If you want to review the results of the adaptation first, use the 'adapt' subcommand.

As a special case, if the current working directory has a file called "Caddyfile" and the caddyfile config adapter is plugged in (default), then that file will be loaded and used to configure Caddy, even without any command line flags.

If --envfile is specified, an environment file with environment variables in the KEY=VALUE format will be loaded into the Caddy process.

If --environ is specified, the environment as seen by the Caddy process will be printed before starting. This is the same as the environ command but does not quit after printing, and can be useful for troubleshooting.

The --resume flag will override the --config flag if there is a config auto- save file. It is not an error if --resume is used and no autosave file exists.

If --watch is specified, the config file will be loaded automatically after changes. ⚠️ This is dangerous in production! Only use this option in a local development environment.

OPTIONS

--adapter

Name of config adapter to apply

--config

Configuration file

--envfile

Environment file to load

--environ

Print environment

--pidfile

Path of file to which to write process ID

--pingback

Echo confirmation bytes to this address on success

--resume

Use saved config, if any (and prefer over --config file)

--watch

Watch config file for changes and reload it automatically

SEE ALSO

caddy-adapt(1), caddy-caddy(1), caddy-environ(1), caddy-file-server(1), caddy-fmt(1), caddy-hash-password(1), caddy-help(1), caddy-list-modules(1), caddy-man(1), caddy-reload(1), caddy-reverse-proxy(1), caddy-start(1), caddy-stop(1), caddy-trust(1), caddy-untrust(1), caddy-validate(1), caddy-version(1), caddy(1)

DOCUMENTATION

Full documentation is available at: https://caddyserver.com/docs/

VERSION

2.4.5-1

BUGS

Report Bugs to: https://github.com/caddyserver/caddy

COPYRIGHT

(c) Matthew Holt and The Caddy Authors

September 2021