Install the Hugo Static Site Generator on ArcoLinux

Hugo is a lightning-fast open-source static site generator that's written in Go.

ArcoLinux is a rolling release Linux distribution based on Arch Linux.

Prerequisites

  • ArcoLinux was installed using the ArcoLinuxL ISO with the easy installation option.
  • The examples shown in this article were performed using Xfce Terminal.
  • ArcoLinux was fully updated using the sudo pacman -Syu command.

Installation

I downloaded version 0.89.4 of Hugo extended. For the latest version or a different version, see the Hugo GitHub repo.

1curl -L -o ./Downloads/hugo_extended_0.89.4_Linux-64bit.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.89.4/hugo_extended_0.89.4_Linux-64bit.tar.gz

install-hugo-arcolinux1a.jpg

You'll need to create the local folder structure, extract the tar archive, add the execute permission, and create a link:

1sudo mkdir -p /opt/hugo
2sudo tar zxf ./Downloads/hugo_extended_0.89.4_Linux-64bit.tar.gz -C /opt/hugo
3sudo chmod +x /opt/hugo/hugo
4sudo ln -s /opt/hugo/hugo /usr/bin/hugo

install-hugo-arcolinux2a.jpg

You've installed Hugo! To verify the version, you use the hugo version command:

1hugo version

install-hugo-arcolinux3a.jpg

I configured Git since this is a newly installed system. Use the credential.helper store option to save your GitHub credentials. Saving your credentials automatically authenticates you when GitHub authentication is required instead of being prompted each time.

1git config --global user.name "<Your Name>"
2git config --global user.email "<your email>@users.noreply.github.com"
3git config --global credential.helper store

install-hugo-arcolinux5a.jpg

I downloaded my existing Hugo site from GitHub along with the theme that I've chosen:

1mkdir git
2cd git
3git clone https://github.com/mikefrobbins/mikefrobbins.com.git
4cd mikefrobbins.com/themes/
5git clone https://github.com/mikefrobbins/vienna.git

install-hugo-arcolinux4a.jpg

You can view your site locally by running the hugo server command and visiting http://localhost:1313/.

1hugo server

I write my content for this blog site in Markdown using VS Code. I preview the content with a locally installed version of Hugo. I use a private repo on GitHub to store the content. Any time I push a commit to GitHub, Netlify automatically performs a build of my blog site.

All of the software, tools, and hosting is free except for my domain name. The entire solution was uncomplicated to set up and configure.

References

Other resources

Adam Driscoll has a "Build fast, static websites, and host them for free" video about Hugo on his YouTube channel.