Install Hugo
Published: 2022-03-11 18:43:02

Install Hugo
Install Hugo on macOS, Windows, Linux, OpenBSD, FreeBSD, and on any machine where the Go compiler tool chain can run.
There is lots of talk about “Hugo being written in Go”, but you don’t need to install Go to enjoy Hugo. Just grab a precompiled binary!

Hugo is written in Go with support for multiple platforms. The latest release can be found at Hugo Releases.

Hugo currently provides pre-built binaries for the following:

macOS (Darwin) for x64, i386, and ARM architectures
Windows
Linux
OpenBSD
FreeBSD
Hugo may also be compiled from source wherever the Go toolchain can run; e.g., on other operating systems such as DragonFly BSD, OpenBSD, Plan 9, Solaris, and others. See https://golang.org/doc/install/source for the full set of supported combinations of target operating systems and compilation architectures.

Quick Install 
Binary (Cross-platform) 
Download the appropriate version for your platform from Hugo Releases. Once downloaded, the binary can be run from anywhere. You don’t need to install it into a global location. This works well for shared hosts and other systems where you don’t have a privileged account.

Ideally, you should install it somewhere in your PATH for easy use. /usr/local/bin is the most probable location.

Docker 
We currently do not offer official Hugo images for Docker, but we do recommend these up to date distributions: https://hub.docker.com/r/klakegg/hugo/

Homebrew (macOS) 
If you are on macOS and using Homebrew, you can install Hugo with the following one-liner:

install-with-homebrew.sh
brew install hugo
For more detailed explanations, read the installation guides that follow for installing on macOS and Windows.

MacPorts (macOS) 
If you are on macOS and using MacPorts, you can install Hugo with the following one-liner:

install-with-macports.sh
port install hugo
Homebrew (Linux) 
If you are using Homebrew on Linux, you can install Hugo with the following one-liner:

install-with-linuxbrew.sh
brew install hugo
Installation guides for Homebrew on Linux are available on their website.

Chocolatey (Windows) 
If you are on a Windows machine and use Chocolatey for package management, you can install Hugo with the following one-liner:

install-with-chocolatey.ps1
choco install hugo -confirm
Or if you need the “extended” Sass/SCSS version:

install-extended-with-chocolatey.ps1
choco install hugo-extended -confirm
Scoop (Windows) 
If you are on a Windows machine and use Scoop for package management, you can install Hugo with the following one-liner:

scoop install hugo
Or install the extended version with:

scoop install hugo-extended
Source 
Prerequisite Tools 
Git
Go (at least Go 1.11)
Fetch from GitHub 
Since Hugo 0.48, Hugo uses the Go Modules support built into Go 1.11 to build. The easiest way to get started is to clone Hugo in a directory outside of the GOPATH, as in the following example:

from-gh.sh
mkdir $HOME/src
cd $HOME/src
git clone https://github.com/gohugoio/hugo.git
cd hugo
go install --tags extended
Remove --tags extended if you do not want/need Sass/SCSS support.

If you are a Windows user, substitute the $HOME environment variable above with %USERPROFILE%.

macOS 
Assumptions 
You know how to open the macOS terminal.
You’re running a modern 64-bit Mac.
You will use ~/Sites as the starting point for your site. (~/Sites is used for example purposes. If you are familiar enough with the command line and file system, you should have no issues following along with the instructions.)
Pick Your Method 
There are three ways to install Hugo on your Mac

A package manager, like Homebrew (brew) or MacPorts (port)
Distribution (i.e., tarball)
Building from Source
There is no “best” way to install Hugo on your Mac. You should use the method that works best for your use case.

Pros and Cons 
There are pros and cons to each of the aforementioned methods:

Package Manager. Using a package manager is the simplest method and will require the least amount of work to maintain. The drawbacks aren’t severe. The default package will be for the most recent release, so it will not have bug fixes until the next release (i.e., unless you install it with the --HEAD option in Homebrew). Releases may lag a few days behind because it has to be coordinated with another team. Nevertheless, this is the recommended installation method if you want to work from a stable, widely used source. Package managers work well and they are easy to update.

Tarball. Downloading and installing from the tarball is also easy, although it requires a few more command line skills than does Homebrew. Updates are easy as well: you just repeat the process with the new binary. This gives you the flexibility to have multiple versions on your computer. If you don’t want to use brew, then the tarball/binary is a good choice.

Building from Source. Building from source is the most work. The advantage of building from source is that you don’t have to wait for a release to add features or bug fixes. The disadvantage is that you need to spend more time managing the setup, which is manageable but requires more time than the preceding two options.