This guide installs Hugo on a self-hosted Linux server.
Hugo can be installed via:
Download and install the latest Hugo binary:
# Download latest release (check https://github.com/gohugoio/hugo/releases)
wget https://github.com/gohugoio/hugo/releases/download/v0.158.0/hugo_extended_0.158.0_Linux-64bit.tar.gz
# Extract
tar -xzf hugo_extended_0.158.0_Linux-64bit.tar.gz
# Move to system path
sudo mv hugo /usr/local/bin/
# Verify installation
hugo version
Ubuntu/Debian:
sudo apt update
sudo apt install hugo
RHEL/CentOS:
sudo dnf install hugo
Snap (all Linux):
sudo snap install hugo
Create a new Hugo site:
hugo new site my-site
cd my-site
Clone or download a theme:
# Initialize git repo (required for git submodule themes)
git init
# Add a theme as submodule
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
# Or download theme directly
# Extract to themes/ directory
Configure theme in hugo.toml:
theme = "ananke"
Create a new post:
hugo new content posts/my-first-post.md
Edit the file and set draft: false in front matter when ready.
Generate static files:
# Development server with live reload
hugo server -D
# Production build
hugo --minify
Output is generated in public/ directory.
Copy public/ directory to your web server:
# Example: Copy to web server
rsync -avz public/ user@server:/var/www/html/
# Or use any static hosting (Netlify, Vercel, GitHub Pages)
See Hugo Configuration for configuration guidance.
See Hugo Security for hardening guidance.
Prefer automation? See these Ansible setup options:
Prefer containers? See Hugo Docker Setup.
Need professional assistance with your Hugo deployment? Our team provides:
Get in touch: office@linux-server-admin.com | Contact Page