Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install Hugo on Nanobox

Create a boxfile.yml

First create a boxfile using the content from this gist

Start the local env

nanobox run

Create a new site

cd /tmp
hugo new site NAME
cp -a NAME/* /app/
cd -

Start hugo

hugo server --bind ""

Visit the app

In your browser, visit the IP or domain if added at port 1313


Write the app!

# use the static engine
engine: static
# install hugo
- bash <(curl -s -L
if [[ ! -f /data/bin/hugo ]]; then
cd /tmp
tar -xzf hugo_0.25.1_Linux-64bit.tar.gz
mv hugo /data/bin/hugo
cd -
rm -rf /tmp/*
Copy link

tylerflint commented Jul 18, 2017

Don't worry about the script. The tinyurl included in the extra_steps will pull the content and install hugo.

Copy link

Tolmark12 commented Jul 18, 2017

You'll want to add the baseUrl flag when running the server locally:

# If you specify a custom local dns alias:
hugo server --bind=""

# If no custom dns alias, use the IP address provided by nanobox
hugo server --baseUrl= --bind=""

NOTE, I haven't figured out how to get livereload to work yet, but this is the start:

  # use the static engine
  engine: static
  # enable file watching for live reload
  fs_watch: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment