Setup of a Caddy HTTP Server on Fedora 37
This tutorial installs a Caddy HTTP server with TLS/HTTPS.
Caddy does all what we expect from a modern website automatically. No extra configuration is necessary to serve HTTPS. Certificates are obtained and renewed for all domain names. Also it redirects from the HTTP port by default.
Prerequisites
Being firm in using the command line.
A domain name, called
foo.net
in this tutorial.A Fedora server, set up as depicted in Setup of a Server with Fedora 37.
Install
Caddy
# Install sudo dnf install caddy # Start the server on each boot sudo systemctl enable caddy.service # Start the server now sudo systemctl start caddy.service
Firewall
Configure
Create log directory:
Create source directory:
sudo nvim /etc/caddy/Caddyfile.d/foo.net.caddyfile
:
That's really all it needs to obtaine certificates for all domain names, serve a static website over HTTPS, and also to redirect from HTTP. See https://caddyserver.com/docs/caddyfile/patterns or https://caddyserver.com/docs/automatic-https for more information.