Docs / Programming & Development / How to Deploy a Hugo Static Site on a VPS

How to Deploy a Hugo Static Site on a VPS

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 23 views · 1 min read

What Is Hugo?

Hugo is one of the fastest static site generators, written in Go. It builds thousands of pages in seconds, making it ideal for blogs, documentation sites, and portfolios hosted on your Breeze.

Prerequisites

  • A Breeze running Ubuntu 22.04 or later
  • Nginx installed
  • A domain name pointed to your Breeze

Step 1: Install Hugo

sudo apt update
sudo apt install hugo

Or install the extended version for SCSS support:

wget https://github.com/gohugoio/hugo/releases/download/v0.124.0/hugo_extended_0.124.0_linux-amd64.deb
sudo dpkg -i hugo_extended_0.124.0_linux-amd64.deb

Step 2: Build the Site

cd /var/www/hugo-site
hugo --minify

The output is generated in the public/ directory.

Step 3: Configure Nginx

server {
    listen 80;
    server_name yourdomain.com;
    root /var/www/hugo-site/public;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~* \.(css|js|png|jpg|svg|woff2|ico)$ {
        expires 1y;
        add_header Cache-Control "public, immutable";
    }
}
sudo ln -s /etc/nginx/sites-available/hugo /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

Step 4: Enable SSL

sudo certbot --nginx -d yourdomain.com

Automated Deployment

Set up a Git hook or cron job to pull changes and rebuild:

#!/bin/bash
cd /var/www/hugo-site
git pull origin main
hugo --minify

Hugo rebuilds in milliseconds, so deployments are nearly instant on your Breeze.

Was this article helpful?