How to Set Up Hugo: Complete Guide for BeginnersHow to Set Up Hugo: Complete Guide for Beginners

How to Set Up Hugo: Complete Guide for Beginners

Step-by-step guide to installing Hugo, the fast static site generator. Learn setup on Windows, macOS, and Linux with easy instructions for beginners.

How to Install and Customize Hugo - Complete Static Site Generator Guide

Hugo is one of the world’s most popular, high-speed static site generators written in Go. With near-instant build times, flexible taxonomy support, and zero external runtime dependencies, Hugo makes website creation fast, secure, and enjoyable. This comprehensive guide covers both the initial installation steps across different operating systems and essential customization techniques to build a unique, production-ready website.


Part 1: Installing Hugo

Step 1: Download Hugo Binary

To install Hugo, select the package manager or binary download corresponding to your operating system:

  1. Visit the official Hugo releases page or use package managers:
    • macOS (Homebrew): brew install hugo
    • Windows (Chocolatey / Scoop): choco install hugo-extended or scoop install hugo-extended
    • Linux (Snap / apt): sudo apt install hugo or snap install hugo --classic
  2. We strongly recommend downloading the Hugo Extended version, which includes built-in LibSass support for compiling SCSS/SASS stylesheets directly without external build tools.

Step 2: Confirm Installation

Verify that the Hugo binary is accessible in your system’s PATH:

hugo version

If the installation was successful, your terminal will output the version number, target architecture (e.g., windows/amd64 or darwin/arm64), and build date.

Step 3: Initialize a New Hugo Project

Navigate to your workspace directory and bootstrap a new site structure:

hugo new site mywebsite
cd mywebsite

This command generates the standard Hugo directory hierarchy:

  • archetypes/: Default frontmatter templates for new markdown files.
  • content/: Where your articles, posts, and pages reside.
  • layouts/: Custom HTML templates and partial overrides.
  • static/: Raw assets (images, favicons, robots.txt) copied directly to public root.
  • themes/: Installed site themes and styling assets.
  • hugo.toml (or hugo.yaml): The central configuration file.

Part 2: Customizing and Designing Your Hugo Site

Step 4: Installing and Configuring a Theme

Browse the vast theme ecosystem at themes.gohugo.io and select a design tailored for your project:

  1. Add your chosen theme as a Git submodule or clone it into the themes directory:
    git init
    git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
    
  2. Activate the theme by updating hugo.toml:
    baseURL = 'https://example.org/'
    languageCode = 'en-us'
    title = 'My Hugo Journey'
    theme = 'ananke'
    

Step 5: Managing Content and Writing Posts

Create your first post using the CLI:

hugo new posts/my-first-post.md

Hugo creates the file under content/posts/my-first-post.md populated with default YAML or TOML frontmatter:

---
title: "My First Post"
date: 2026-11-19T10:00:00Z
draft: false
tags: ["tech", "blog"]
---

Welcome to my brand new website generated with Hugo!

Step 6: Live Development Server and Production Build

  1. Local Development with Live Reload: Run the embedded development server to preview your changes in real time:

    hugo server -D
    

    Open http://localhost:1313 in your browser. Whenever you save changes to markdown files or stylesheets, Hugo hot-reloads the browser instantaneously.

  2. Compiling for Production: When you are ready to publish to Cloudflare Pages, GitHub Pages, or Netlify, run:

    hugo --minify
    

    Hugo processes all templates, minifies HTML/CSS/JS, and outputs the optimized static website into the public/ directory in a fraction of a second.