Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Run Hugo on an Android phone

First install Termux

Then there are two options:

Build from source

Open the Termux terminal on your Android device and copy-and-paste the commands listed below and hit ENTER:

apt update;\
apt install -y git golang make;\
export GOPATH=$HOME/go;\
export PATH=$PATH:$GOPATH/bin;\
go get -d github.com/spf13/hugo;\
cd $GOPATH/src/github.com/spf13/hugo;\
make install;\
hugo server -s docs;

Now you can point a browser at http://localhost:1313 and you should see the Hugo site with docs and all.

Use a prebuilt release binary

apt update;\
apt install curl;\
curl -L https://github.com/spf13/hugo/releases/download/v0.20/hugo_0.20_Linux_ARM.tar.gz | tar zxf -

I've been trying to get Hugo to run on my Samsung Chromebook Pro via Termux. I've tried both of your options, and I can seem to get it to work at all. I'm getting an error that it's an unsupported architecture when I try to build it. Specifically I've been trying to get https://github.com/netlify/victor-hugo to work, and I haven't had success. Any thoughts, and assistance would be appreciated.

The make version fails completely, and won't "make" due to a makeinstall not being present.
The pre-built release binary downloads, but I can't seem to get it to run.

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