Updated at 2022-08-17 13:29

Caddy is a web server with automatic HTTPS.

Seems cool... wouldn't use it for production though.

Install Caddy: Installing through the package manager also enables the related systemd service

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf '' \
    | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf '' \
    | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
# sudo apt install libnss3-tool

Create a Caddyfile to /etc/caddy/Caddyfile:

sudo install -m 0644 /dev/stdin /etc/caddy/Caddyfile <<EOF
    # email
    auto_https off
:2015 {
    root * /usr/share/caddy
sudo caddy fmt --overwrite /etc/caddy/Caddyfile
caddy validate --config /etc/caddy/Caddyfile
caddy run --config /etc/caddy/Caddyfile --environ
chromium http://localhost:2015/
caddy start --config /etc/caddy/Caddyfile
chromium http://localhost:2015/
caddy reload --config /etc/caddy/Caddyfile
caddy stop --config /etc/caddy/Caddyfile

systemctl start caddy
chromium http://localhost:2015/
systemctl status caddy
systemctl stop caddy