Caddy(8)

๐ŸŒธ NAME ๐ŸŒธ

caddy-run โ€” starts the Caddy process and then just... blocks. forever. indefinitely. it's giving loyal.


โœจ SYNOPSIS โœจ

caddy run [--config  [--adapter ]] [--envfile ] [--environ] [--resume]
[--watch] [--pidfile ] [flags]

๐Ÿ’– DESCRIPTION ๐Ÿ’–

okay so bestie, picture this: you run caddy run and Caddy wakes up, optionally with an initial config file to bootstrap it, and then it just stays there. Like, blocks indefinitely until the server is stopped. That's "daemon" mode, but in the foreground. main character energy honestly, it doesn't leave the room. ๐Ÿ‘‘

If you hand it a config file, that file gets applied immediately once the process is already running. And if your config file is not in Caddy's native JSON format, no stress โ€” you can name an adapter with --adapter and it'll adapt your file into Caddy's native format for you. That adapter has to be a registered module though, fr fr. Any warnings will get printed to the log, but โš ๏ธ beware: any adaptation that comes out without errors is immediately used. If you wanna peek at the adaptation results before committing, run the adapt subcommand first. so smart of you.

Special case, and it's kind of iconic: if your current working directory has a file literally called "Caddyfile", and the caddyfile config adapter is plugged in (it is by default, bestie), then that file gets loaded and used to configure Caddy โ€” even if you passed zero command line flags. it just knows. ๐Ÿ”ฎ

If you pass --envfile, an environment file full of environment variables in KEY=VALUE format gets loaded into the Caddy process. cute.

If you pass --environ, the environment as seen by the Caddy process gets printed before starting. it's the same as the environ command, except it does not quit after printing โ€” which is super useful for troubleshooting. ๐Ÿฉบ

About --resume: it will override the --config flag if there's a config auto-save file hanging around. And listen, it is not an error if you use --resume and no autosave file exists. no drama. ๐Ÿซถ

And if you pass --watch, the config file gets loaded automatically after changes. โš ๏ธ but caution bestie, this can make unintentional config changes easier โ€” only use this one in a local development environment. please. for me. ๐Ÿ™ˆ


๐ŸŽ€ OPTIONS ๐ŸŽ€

  • -a, --adapter="" โ€” name of the config adapter to apply
  • -c, --config="" โ€” the configuration file
  • --envfile=[] โ€” environment file(s) to load
  • -e, --environ[=false] โ€” print the environment
  • -h, --help[=false] โ€” help for run
  • --pidfile="" โ€” path of the file to which the process ID gets written
  • --pingback="" โ€” echo confirmation bytes to this address on success
  • -r, --resume[=false] โ€” use the saved config, if any (and prefer it over the --config file)
  • -w, --watch[=false] โ€” watch the config file for changes and reload it automatically

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹


๐Ÿ‘‘ HISTORY ๐Ÿ‘‘

  • 1-Jan-0001 โ€” auto generated by spf13/cobra

so that's the whole page bestie, no cap ๐Ÿ’… and for the cute sign-off: this lil masterpiece is auto generated by spf13/cobra, stamped Jan 0001, and it belongs to the Caddy(8) manual. periodt. ๐ŸŒˆโœจ๐Ÿ“

๐Ÿ“ฆ where this page comes from