Skip to content

Instantly share code, notes, and snippets.

@bep
Last active April 26, 2024 04:13
Show Gist options
  • Save bep/a0d8a26cf6b4f8bc992729b8e50b480b to your computer and use it in GitHub Desktop.
Save bep/a0d8a26cf6b4f8bc992729b8e50b480b to your computer and use it in GitHub Desktop.
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 -
Copy link

ghost commented Jul 29, 2018

Users installing from the prebuilt ARM binary may want to mv hugo ../usr/bin after installation to make the binary available on path.

@pzb568
Copy link

pzb568 commented Sep 30, 2018

Where can I find a tutorial?

@cybardev
Copy link

Users installing from the prebuilt ARM binary may want to mv hugo ../usr/bin after installation to make the binary available on path.

ln -s hugo /usr/bin/hugo would probably be better

@sumit-buddy
Copy link

sumit-buddy commented Feb 8, 2021

I just tried to install hugo on android. It was pretty simple.

Here is how it can be done :

  • Install termux app
  • Update packages using pkg upgrade command
  • Then type pkg install hugo
  • You are all set
  • Type hugo new site <sitename> to create your site directory
  • cd <sitename>
  • git init
  • git submodule add <hugo-git-theme-link> themes/<theme-name>
  • Then run
    hugo server
  • open http://localhost:1313/

Hurray !

@tuanggolt
Copy link

open

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