Webserver

  1. Install Caddy.
# debian or ubuntu
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
chmod o+r /usr/share/keyrings/caddy-stable-archive-keyring.gpg
chmod o+r /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

verify

systemctl status caddy
  1. Clone static website files to server.
git clone <git-repo-url> /var/www/html
# ex. git clone https://gitea.nodusk.me/jay/mercury-publish.git /var/www/html
  1. Edit Caddyfile /etc/caddy/Caddyfile.
:80 {
    root * /var/www/html
    file_server
}
  1. Reload Caddy
systemctl restart caddy
  1. Open server at http://localhost or http:<server-ip>:80 if hosted remotely.
  2. (optional) Use Pangolin, Caddy, or another reverse proxy to add domain name and remote access.

Reverse Proxy