Exclusive Metin2 game shield on FreeBSD: Automatic siege mode, VIP list, and whitelist from your dashboard. See how it works
Create a server

Guide

How to Set Up a Static Website with Hugo

Hugo builds blazing-fast static HTML. On a VPS it fits blogs and landings with no PHP or database.

Steps

  1. Install Hugo (distro package; use the official .deb for newest):

    sudo apt update
    sudo apt install -y hugo
    hugo version
  2. Create the site and a sample post:

    mkdir -p ~/sites && cd ~/sites
    hugo new site mysite && cd mysite
    hugo new content posts/hello.md
    hugo
  3. Publish public/ with Nginx (adjust root/server_name):

    sudo mkdir -p /var/www/mysite
    sudo rsync -a ~/sites/mysite/public/ /var/www/mysite/
    sudo tee /etc/nginx/sites-available/mysite >/dev/null <<'EOF'server {  listen 80;  server_name example.com;  root /var/www/mysite;  index index.html;}EOF
    sudo ln -sf /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/mysite
    sudo nginx -t && sudo systemctl reload nginx
  4. After content edits, rebuild and sync:

    cd ~/sites/mysite && hugo
    sudo rsync -a ~/sites/mysite/public/ /var/www/mysite/

Tips

  • Add a theme under themes/ and enable it in hugo.toml.
  • Add HTTPS with Certbot once DNS points at the VPS.

ext step

Serve your static site on a clean VPS: Deploy your Cloud VPS.

Related guides