Install Hugo

How to install Hugo?

One can install Hugo on all of the major platforms: *nix, Windows and MAC.

Make sure to get the latest version: Hugo Releases

Linux

Update your server

sudo apt-get update

Install Hugo

sudo apt-get install hugo

Check which version was installed

sudo hugo version

Current versions are listed here: https://gohugo.io/categories/releases https://github.com/gohugoio/hugo/releases

Using dpkg utility

Confirm your server architecture

sudo uname -l

Output

X86_64

Go to Hugo release page to see most recent stable release

Get the url of the most recent release and download with wget, example:

wget https://github.com/gohugoio/hugo/releases/download/v0.50/hugo_0.50_Linux-64bit.deb

Use following command to extract the files and install Hugo package (example):

sudo dpkg -i hugo_0.50_Linux-64bit.deb

Run the following to verify installation:

sudo hugo version

Remove Hugo

sudo apt-get remove --auto-remove hugo

Windows

https://www.youtube.com/watch?v=G7umPCU-8xc

Go to your local Disk

Create a folder called “Hugo”

Inside the folder “Hugo” you just created, create another called “bin”

Go to https://github.com/gohugoio/hugo/releases:

Scroll to the bottom where the downloads/assets section of the current or chosen version is and download the appropriate windows version (32 bit or 64 bit)

Go to folder where you downloaded that zip file.

Right click on that file and choosee to extract to the C:/Hugo/bin folder.

Test if it works.

Open command prompt.

Go to the C:/Hugo/bin folder.

cd Hugo/bin

Run the hugo version command to show what version

hugo version

At this time, you cannot run hugo but in that directory.

In order for you to run hugo wherever you want, you will need to modify your path variable.

The path variable stores the location of executable files.

If you don’t have Windows 10, you will need to search for how to modify path variable with your specific Windows version.

If Windows 10, go to search bar, type in environment to find the “edit the system environment variables” of control panel. Click that

Click on Environment Variables

Select Path and click Edit button

Another window will pop up that shows the current environment variables.

Click New to add the new one for hugo

Type in the location of the application: C:\Hugo\bin

Click ok to accept changes

Click ok in environment variable windows, and click ok in the system properties window.

See what is in the Path variable:

Go to command prompt

echo %PATH%

Make sure that the location of your hugo executable file is shown.

Test to see if it works.

Go to command line and type

hugo version

MacOS

HomeBrew

If you have macOS and are using homebrew, install hugo with this one liner:

brew install hugo

Manual Method

First determine the hugo version wanted from the list of latest releases here:

https://github.com/gohugoio/hugo/releases

For example, if using macOS 64 bit, choose:

hugo_0.65.3_macOS-64bit.tar.gz

which is located here:

https://github.com/gohugoio/hugo/releases/download/v0.65.3/hugo_0.65.3_macOS-64bit.tar.gz

Go to the /tmp directory:

pushd /tmp

download the binary for hugo using wget (example shown):

wget https://github.com/gohugoio/hugo/releases/download/v0.55.1/hugo_extended_0.55.1_macOS-64bit.tar.gz

Un-tar the file (example shown):

tar xzvf hugo_extended_0.55.1_macOS-64bit.tar.gz

Copy the hugo folder to your /usr/local/bin folder:

cp hugo /usr/local/bin

Restor the previous value of the current directory:

popd

Test to see if hugo is functioning:

hugo version

NOTE:

which -a hugo

will show you all hugo executables in your path.

If /usr/local/bin/hugo is the only or top one, you’re good.

All “official” hugo releases including extended ones at https://github.com/gohugoio/hugo/releases 2.


Last modified 05.01.2017