This guide walks you through deploying a Hugo static site using the PaperMod theme, hosted on an unprivileged LXC container running NGINX. This version includes a manual installation of Hugo via .deb for full control over the version.
๐ Prerequisites
Proxmox or any hypervisor
Ubuntu 22.04 LXC (unprivileged)
A non-root user with sudo privileges
๐ ๏ธ Step 1: Install Required Dependencies
sudo apt update && sudo apt install -y curl wget git nginx
๐ Step 2: Install Hugo Manually (v0.147.8)
wget https://github.com/gohugoio/hugo/releases/download/v0.147.8/hugo_0.147.8_linux-amd64.deb
chmod +x hugo_0.147.8_linux-amd64.deb
sudo dpkg -i hugo_0.147.8_linux-amd64.deb
hugo version
๐ Step 3: Create Your Hugo Site
sudo mkdir -p /opt/web && cd /opt/web
sudo chown $USER:$USER /opt/web
hugo new site packetrealm.io
cd packetrealm.io
๐จ Step 4: Install PaperMod Theme
git init
git submodule add https://github.com/adityatelange/hugo-PaperMod themes/PaperMod
git submodule update --init --recursive
โ๏ธ Step 5: Configure PaperMod Theme
Replace config.yaml with:
baseURL: "https://packetrealm.io/"
title: "PacketRealm"
theme: "PaperMod"
languageCode: "en-us"
params:
homeInfoParams:
Title: "PacketRealm.io"
Content: |
Welcome to my cyber lair.
Homelab engineer. Network alchemist.
Every byte has a purpose. Every route, a secret.
socialIcons:
- name: "github"
url: "https://github.com/hiltondsilva"
- name: "linkedin"
url: "https://linkedin.com/in/hiltondsilva"
markup:
goldmark:
renderer:
unsafe: true
โ๏ธ Step 6: Create First Post
hugo new posts/welcome.md
Populate it with content (example: site intro, lab summary, etc.)
๐ง Step 7: Build the Site
hugo --cleanDestinationDir
This generates static content in public/
๐ Step 8: Configure NGINX to Serve the Site
sudo nano /etc/nginx/sites-available/default
Replace contents with:
server {
listen 80;
server_name packetrealm.io;
root /opt/web/packetrealm.io/public;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
Test and reload:
sudo nginx -t
sudo systemctl reload nginx
โ Final Check
Visit http://LXC-IP or set DNS for packetrealm.io to your server IP to access the site.