Hugo on Codeanywhere Cloud IDE
Last updated: Feb 9, 2023
Get Started
To get started, sign up and create a new container on Codeanywhere.

Install Go
Most of the commands for Hugo Modules require a newer version of Go installed (see https://golang.org/dl/) and the relevant VCS client (e.g. Git, see https://git-scm.com/downloads/ ).

Make sure Go is installed and available in the container using the following command:
$ go version

Install Hugo Extended
First download the binary into a temp folder:
$ wget -P /tmp/ https://github.com/gohugoio/hugo/releases/download/v0.99.1/hugo_extended_0.99.1_Linux-64bit.deb
Now you can extract the content and install:
$ sudo dpkg -i /tmp/hugo_extended_0.99.1_Linux-64bit.deb

From the container, type hugo version
in the terminal. You should see something similar to this appear, which means Hugo has been properly installed:
$ hugo v0.99.1-d524067382e60ce2a2248c3133a1b3af206b6ef1+extended linux/amd64 BuildDate=2022-05-18T11:18:14Z VendorInfo=gohugoio

You can find all releases of Hugo on the official github repo:
https://github.com/gohugoio/hugo/releases
Add Site
Create a new site or clone your existing site Github repository.

Preview Site
Run $ hugo server
.

Open preview.


To preview your site manually, replace [container name] with your container name.
https://port-1313-[container name].preview.codeanywhere.com/
Sample:
My container link is: https://ide.codeanywhere.com/tedm-hxz97459500903/#/home/cabox/workspace which means the container name is tedm-hxz97459500903. The preview site link will be:
https://port-1313-tedm-hxz97459500903.preview.codeanywhere.com/