Turns out this “hugo” setup was a lot easier than my last attempt at making a personal website.

First, find a cheap hosting provider.

Spin up a small instance. Lock it down.

Install apache2. Install ModSecurity. Make sure you can view the classic apache test page.

Install Hugo. You can keep apache serving out of /var/www/html, but you’ll want another directory for Hugo. I went with another folder alongside …/html, called …/www_hugo. This is your new Hugo directory.

Pick a theme. Put it in your Hugo directory. Under …/themes.

Pick your starting directory - usually “posts”, but mine is “photography”. mkdir it in your Hugo directory under …/content.

Make a new post by using hugo new [starting_directory]/first_post.md.

Go edit that post. Change draft=true to draft=false. Add some riveting content, like hello world below the header section.

Now, for your own sanity, switch directories to /bin and start editing a new file called something like hugo_refresh.

You’ll want it to look something like this:

#!/bin/bash

echo "Removing old data..."
rm -rf /var/www/html/*
echo "Done"

echo "Sleeping for a second, just to make sure..."
sleep 2s
echo "Done"

echo "Inserting new data..."
cp -r /[your_Hugo_dir]/public/* /var/www/html/
echo "Done"

Switch directories back to your Hugo directory, and run hugo followed by your shiny new hugo_refresh script.

Browse to your server’s public IP and see if things worked. If so, congrats! You have a proto-site.

You can expand on it by getting a domain (don’t be like me and get a .us domain, get something you can WhoIsGuard) and pointing it to your (hopefully static) server IP. If your server IP is dynamic, you can use a service like no-ip to work around that.

I’ve modified my config.toml to have custom header items that map to folders.

Why the hugo_refresh script, you might ask? Because Hugo is a static content generator, so it just turns your .md files into .html files that you still have to copy over. You could theoretically re-point Apache to …/[hugo_dir]/public/* but I opted not to.

If you want to insert raw HTML into Hugo, there are workarounds for that, too.

If you run the two commands to get new content and they fail, try throwing in a hugo -D. I’ll often alias hr to hugo;hugo -D;hugo_refresh.