Location Caddy configuration file

1. Caddy version (caddy version):2.4.0

2. How I run Caddy:

<!-I turn caddy on VPS ubuntu 20.0.4 OS caddy was installed via snap–>

b. Command:

Was just checking if I use the following command to point caddy to its configuration file
–caddy run --config
/path/to/Caddyfile
Do I press enter after caddy run --config then type the location of configuration file below?
/path/to/Caddyfile >
So it will look something like

caddy run --config
/path/to/Caddyfile

It’s probably a silly question but I am new to caddy and want to get it right the first time I do it and once I’ve done that should I reload caddy or stop and start caddy??your help will be greatly appreciated

Paste command here.

c. Service/unit/compose file:

Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.

d. My complete Caddyfile or JSON config:

Paste config here, replacing this text.
Use `caddy fmt` to make it readable.
DO NOT REDACT anything except credentials.
LEAVE DOMAIN NAMES INTACT.
Make sure the backticks stay on their own lines.

3. The problem I’m having:

4. Error messages and/or full log output:

5. What I already tried:

6. Links to relevant resources:

Hey @Cinimod,

You should not press enter before typing the location of the configuration file. The whole command should be on one line.

You should be aware that the command, caddy run, starts the server in the foreground. That means it will keep running until you exit the terminal or abort the process. (See documentation: https://caddyserver.com/docs/command-line#caddy-run)

The commands, caddy start, caddy stop, and caddy reload, all operate on a Caddy server running in the background. In that usage, you start the server, reload it, or stop it, whenever you need.

Thank you for your detailed reply i greatly appreciate your time and effort

This topic was automatically closed after 30 days. New replies are no longer allowed.