Hugo Installation Guide
Installing Hugo on Windows 11
Section titled “Installing Hugo on Windows 11”This guide walks you through the process of installing Hugo on Windows 11, setting up your development environment, and creating your first site.
Table of Contents
Section titled “Table of Contents”- Prerequisites
- Installation Methods
- Verifying Your Installation
- Creating Your First Hugo Site
- Running Your Hugo Server
- Next Steps
Prerequisites
Section titled “Prerequisites”- Windows 11 operating system
- Administrative privileges on your computer
- Command Prompt or PowerShell
- Git (recommended for version control)
Installation Methods
Section titled “Installation Methods”There are three primary methods to install Hugo on Windows 11. Choose the one that works best for your workflow.
Method 1: Using Chocolatey
Section titled “Method 1: Using Chocolatey”Chocolatey is a package manager for Windows that makes installing software easy.
-
Install Chocolatey (if not already installed):
- Open PowerShell as Administrator
- Run the following command:
Terminal window Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) -
Install Hugo using Chocolatey:
- For the standard version:
Terminal window choco install hugo -y- For the extended version (recommended for Sass/SCSS support):
Terminal window choco install hugo-extended -y
Method 2: Using Scoop
Section titled “Method 2: Using Scoop”Scoop is another lightweight package manager for Windows.
-
Install Scoop (if not already installed):
- Open PowerShell
- Run:
Terminal window Set-ExecutionPolicy RemoteSigned -Scope CurrentUserirm get.scoop.sh | iex -
Install Hugo using Scoop:
- For the standard version:
Terminal window scoop install hugo- For the extended version:
Terminal window scoop install hugo-extended
Method 3: Manual Installation
Section titled “Method 3: Manual Installation”If you prefer not to use a package manager, you can manually install Hugo:
-
Download Hugo:
- Visit the Hugo Releases page
- Find the latest release for Windows
- Download the appropriate ZIP file:
hugo_X.XX.X_windows-amd64.zip
for standard versionhugo_extended_X.XX.X_windows-amd64.zip
for extended version (recommended for Sass/SCSS processing)
-
Extract the ZIP file:
- Create a folder where you want to install Hugo (e.g.,
C:\Hugo
) - Extract the contents of the ZIP file to this folder
- Create a folder where you want to install Hugo (e.g.,
-
Add Hugo to your PATH:
- Search for “Environment Variables” in the Start menu
- Click “Edit the system environment variables”
- Click the “Environment Variables” button
- Under “System variables,” find the “Path” variable, select it and click “Edit”
- Click “New” and add the path to the Hugo executable (e.g.,
C:\Hugo
) - Click “OK” on all dialogs to save changes
Verifying Your Installation
Section titled “Verifying Your Installation”To verify that Hugo is installed correctly:
- Open a new Command Prompt or PowerShell window
- Run the following command:
hugo version
You should see output similar to:
Hugo Static Site Generator v0.111.3-...
Creating Your First Hugo Site
Section titled “Creating Your First Hugo Site”Once Hugo is installed, you can create your first site:
-
Navigate to the directory where you want to create your site:
cd C:\Users\YourUsername\Documents -
Create a new site:
hugo new site my-site -
Add a theme (required for Hugo to work properly):
cd my-sitegit initgit submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke -
Set the theme in your configuration file:
- Open
config.toml
in a text editor - Add the line:
theme = "ananke"
- Open
Running Your Hugo Server
Section titled “Running Your Hugo Server”To preview your site locally:
-
Start the Hugo server:
hugo server -DThe
-D
flag includes draft content in the preview. -
View your site by opening a browser and navigating to:
http://localhost:1313/
Next Steps
Section titled “Next Steps”Now that you have Hugo installed and your first site running, you can:
- Add content using Markdown files
- Customize your site’s theme and design
- Configure your site settings in
config.toml
- Deploy your site to a hosting service
For more information, refer to the official Hugo documentation.
This guide was created for Windows 11 users setting up Hugo for static site development.