I followed the Debian/Ubuntu installation instructions to the letter and Caddy won't run. Wat do?

1. The problem I’m having:

I followed the Debian/Ubuntu installation instructions to the letter and Caddy won’t run.

2. Error messages and/or full log output:

https://imgur.com/CJolrTp

3. Caddy version:

2.8.4

4. How I installed and ran Caddy:

I followed the installation instructions for Debian/Ubuntu

a. System environment:

MX-23, booted with systemd. No docker or other extraneous BS.

b. Command:

The instructions don't include a command for running Caddy, only for restarting or stopping it. I took a wild stab at "sudo systemctl start caddy", though.

c. Service/unit/compose file:

I have no idea what this is

d. My complete Caddy config:


http://siliconaftershock.fairuse.org {
	# Set this path to your site's directory.
	root * /home/wds/Desktop/Aftershock frontend/

	# Enable the static file server.
	file_server

	# Another common task is to set up a reverse proxy:
	# reverse_proxy localhost:8080

	# Or serve a PHP site through php-fpm:
	# php_fastcgi localhost:9000
}

5. Links to relevant resources:

BTW, please disregard the Windows-like appearance of the command prompt. That’s just the Chicago95 theme for XFCE

The service cannot access files in users’ home directories. Put the files elsewhere, e.g. /var/www or something like that.

1 Like

C:\etc\caddy> caddy start
2024/09/28 19:28:02.578 INFO using adjacent Caddyfile
2024/09/28 19:28:02.579 INFO adapted config to JSON {“adapter”: “caddyfile”}
2024/09/28 19:28:02.579 INFO admin admin endpoint started {“address”: “localhost:2019”, “enforce_origin”: false, “origins”: [“//localhost:2019”, “//[::1]:2019”, “//127.0.0.1:2019”]}
2024/09/28 19:28:02.580 WARN http.auto_https server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server {“server_name”: “srv0”, “http_port”: 80}
2024/09/28 19:28:02.580 INFO tls.cache.maintenance started background certificate maintenance {“cache”: “0xc00053cb00”}
2024/09/28 19:28:02.580 INFO tls.cache.maintenance stopped background certificate maintenance {“cache”: “0xc00053cb00”}
Error: loading initial config: loading new config: http app module: start: listening on :80: listen tcp :80: bind: permission denied
Error: caddy process exited with error: exit status 1

Now what?

Why are you using caddy start?! You’ve installed the package. Use sudo systemctl start caddy.

1 Like

See Keep Caddy Running — Caddy Documentation for how to see Caddy’s logs when running as a systemd service. If it’s failing to run, it would show the reason in those logs.

1 Like