How To Install and Use Hugo On Ubuntu 18.04 Bionic Beaver LTS

(: December 30, 2018)

In this guide, I’ll take you through the steps to install and use Hugo on Ubuntu 18.04 LTS Desktop and Server editions. Hugo has been confirmed to be the fastest open-source static site generator written in Go. Hugo is capable of generating a static site at a speed of <1 ms per page, the average site builds in less than a second. It ships with pre-made templates to make quick work of SEO, commenting, analytics and other functions.

Hugo supports unlimited content types, taxonomies, menus, dynamic API-driven content, and more, all without plugins. Additionally, you can output your content in multiple formats, including JSON or AMP

How To Install Hugo On Ubuntu 18.04 LTS

Hugo can be installed on Ubuntu 18.04 by downloading a .deb package or from apt repository.{text-align:left} img{margin:0 auto 0 0}

Installing Hugo On Ubuntu 18.04 LTS from apt repository

Update your system apt index and install Hugo:

sudo apt-get update $ sudo apt-get install hugo

You can confirm the location of hugo binary after installation using which

$ which hugo

Installing Hugo On Ubuntu 18.04 LTS from .deb package

To install Hugo on Ubuntu 18.04 from Debian package, first, download the latest release from Github releases page Select a version that matches your CPU architecture:

export VER="0.53"

Then install the package using:

$ sudo dpkg -i hugo_${VER}_Linux-64bit.deb
Selecting previously unselected package hugo.
(Reading database … 187292 files and directories currently installed.)
Preparing to unpack hugo_0.53_Linux-64bit.deb …
Unpacking hugo (0.53) …
Setting up hugo (0.53) …

If the installation was successful, you should be able to use hugo command:

$ hugo --help

How to Use Hugo on Ubuntu 18.04

Now that Hugo is installed, you can start creating website content. Before that, you’ll need to create new content for your site. In this example, my site is called

$ hugo new site
Congratulations! Your new Hugo site is created in /home/jmutai/

Just a few more steps and you're ready to go:

1. Download a theme into the same-named folder.
   Choose a theme from, or
   create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".

Visit for quickstart guide and full documentation.

To create a test page, cd to site directory and use



$ cd
$ ls
archetypes config.toml content data layouts static themes

Site content is placed inside content directory

$ hugo new posts/
/home/jmutai/ created

Add dummy content for test:

$ vim content/posts/


title: "Test Page"
date: 2018-07-12T10:17:29Z
draft: true

# Hello World

This is my first hugo site, wooo!!

if [[ $hugo_install == "success" ]]; then
  echo "Happy me"


Build site:

$ hugo

                   | EN  
  Pages            |  3  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     |  0  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 9 ms

This will create public folder and add content to it. To serve website using hugo build-in server, use:

$ hugo server

                   | EN  
  Pages            |  3  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     |  0  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 10 ms
Watching for changes in /root/{content,data,layouts,static}
Watching for config changes in /root/
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address
Press Ctrl+C to stop

For self hosting on a web server like Nginx or Apache, copy content inside public directory to your Web server document root.

Also check:

How to Install Jekyll on Ubuntu 18.04

How to Install and configure Ghost CMS on Ubuntu 16.04 / Debian 9{text-align:left} img{margin:0 auto 0 0}