Installing Hugo

Tuesday, May 18, 2021

I’ve written about how Hugo saved my website and how to deal with page resources . (Although, I now use ![]() syntax for images.) But I haven’t really done any deep dives into Hugo. I’m going to change that now. This blog post is all about installing Hugo. The reason I’m writing this post is because installing it isn’t as easy as it should be.

Linux Install

I’m starting with Linux because it is the easiest. If you are on Ubuntu or an Ubuntu flavor just type sudo apt install hugo. Arch Linux is as simple as sudo pacman -Syu hugo. And any of the other flavors you can easily find it in the repository’s library. See the installation page for more information.

MacOS Install

Open a browser to the GitHub release page for Hugo. Find the release that matches your system. Nestled in the middle of all the releases are TAR balls for either 64bit or ARM64 MacOS releases. Download the one that matches your system. The TAR ball consists of two Markdown files (one for the license and one for Readme) and the executable. We are going to decompress the archive and put the created Hugo folder into either the ~/Bin folder or the /usr/local/bin folder. Whichever you chose depends on if you want everyone that uses your machine to have access to Hugo (the latter) or if it’s only needed by you (the former).

Once you have extracted and placed Hugo in the correct location you should be able to test it with the which hugo command. This command will show you where you placed Hugo. Also, run the hugo version command to make sure the correct version is installed. If something happened and it doesn’t work, check out the installation page for more information on debugging your install.

Windows Install

Finally there was Windows. It seems that a lot of these great tools forget about Windows because their install is a little painful. If you have Chocolatey installed it is as simple as typing choco install hugo-extended -confirm in a command prompt. Too bad they don’t have a winget install.

Anyway, if you don’t have Chocolatey installed and don’t want to install yet another tool, you can do it the manual way. I have a Tools folder where I keep tools that I use that don’t have their own installer. In this folder I created a Hugo folder and download the Windows Zip file . Then unzip the contents into the C:\Tools\Hugo folder (there should be three files in this Hugo folder).

Next we have to make sure that this folder is in our path. Like everything there are many ways of doing this. I’ll do it the Windows way. First, open the Settings page by pressing Windows-I, that’s the Windows key plus the “I” key. This will open the settings panel. In the middle of the settings panel is a search box. In this search box type “Environment Variables”. This is what the Settings panel will show when searching for environment variables.

Select the first option to “Edit the system environment variables”.

The System Properties panel appears.

On the System Properties panel select the button near the bottom labeled “Environment Variables…”

The System Variables section of Environment Variables

Towards the bottom you will see a section called “System variables”. Select Path and then click the “Edit…” button. Something like this will come up:

The Edit environment variables panel

Along the right side are some buttons. Click “New” and enter the path for where Hugo is installed. In my case it would be C:\Tools\Hugo. Click the OK button to close the “Edit environment variable” panel. Then click OK to close the Environment Variables panel. And finally click OK to close the “System Properties” dialog.

Next open a Terminal and try typing hugo version to see if it worked. If not check the installation instructions .

Hopefully these instructions have helped. Hugo is a great tool for creating static web sites. Let me know if this has helped and I may do more of these deep dives on Hugo.

WindowsMacOSLinuxHugo

This work is licensed under CC BY-NC-SA 4.0

Would the Real SRP Standup

Install PWA on Edge