Skip to content

VPS: Caddy Setup🔗

Install🔗

sudo apt update && sudo apt install -y caddy
sudo systemctl enable --now caddy

Caddyfile🔗

/etc/caddy/Caddyfile:

endershollow.com {
  encode gzip
  root * /srv/www/endershollow
  file_server
  try_files {path} {path}/ /index.html
}

docs.endershollow.com {
  encode gzip
  root * /srv/www/endershollow-docs
  file_server
}

noco.endershollow.com {
  encode gzip
  reverse_proxy 127.0.0.1:8080
}

Common Errors & Fixes🔗

  • Port 80 in use → nginx still running:
    sudo systemctl disable --now nginx
  • ACME DNS 400 (no valid A records) → DNS not pointing to VPS:
    Create A records for endershollow.com, docs, noco → VPS IP.
  • Unrecognized directive: rate_limit → not in Caddy core; remove it or use a plugin.
  • Validate config: sudo caddy validate --config /etc/caddy/Caddyfile.