Creating a Hugo Static Site
   2 min read

How to create a static website using the Hugo static website generator. The instructions are geared towards Windows since that is the operating system I use the most.

Install Hugo on Windows

  1. Create the folder path: C:\Hugo\bin
  2. Download the latest extended Hugo zip file since some themes require it. e.g.
  3. Extract the zip file contents to the C:\Hugo\bin folder. The Hugo executable path is C:\Hugo\bin\hugo.exe.
  4. Add the folder path C:\Hugo\bin\ to your system environment variables.
    1. Search for "env" in the Windows search bar and select Edit the System environment variables
    2. Enter an administrator password if prompted.
    3. Click on the Environment Variables button.
    4. In the System variables section click on path entry
    5. Click on New and add the path C:\Hugo\bin

  5. To test the installation:
    1. Open a new command prompt window (search for cmd and select Command Prompt)
    2. Type hugo help and press Enter.
    3. You should see usage documentation starting with:
Hugo is the main command, used to build your Hugo site.
Hugo is a Fast and Flexible Static Site Generator built with love by spf13 and friends in Go.

Install a Hugo theme

  1. Create a new folder for your website files. I use a different drive or partition from my operating system (e.g. D:\Data\MyBlogSite) so that I can back up my website easily.
  2. Initialize a new website:
    1. Open a new command prompt window.
    2. Change directory to the website folder (e.g. cd D:\Data\MyBlogSite).
    3. Type "hugo new site" (no quotes), and press enter.

  3. Select and click on a Hugo theme to navigate to the theme's GitHub page.
  4. Click on the Download ZIP button:

    GitHub download link

  5. Extract the zip file contents to your MyBlogSite folder.
  6. Follow the instructions on the theme's GitHub page for how to configure the theme.
  7. Add a batch file in your MyBlogSite folder to start the Hugo server:
    1. Create a new text file in your MyBlogSite folder and add the text hugo server.
    2. Save the file and rename it to hugo_server.bat.
    3. Double-click the file to start the Hugo server.

  8. Open a browser window and navigate to http://localhost:1313/
  9. You should now see the home page of your new static website!