Self-host your own GitHub-Pages style project on a low power server quickly and easily using go-live.

Alex Tsankov
4 min readJan 8, 2021

A static webpage is a blob of HTML,CSS, and JS that doesn’t change whenever a user loads a page. This is different than traditional websites, because there is no database, no dynamic rendering on a server, and the page is easily cacheable in a content delivery network. This architecture is known as a JAM — Stack, and the most popular host is Github Pages.

Install/Source Code: https://github.com/antsankov/go-live
Website: https://antsankov.gitbook.io/go-live/

Here are some examples of static webpages:

  • A simple index.html that has paths to JS and CSS is a static webpage.
  • A Jekyll project can be compiled locally into static HTML pages.
  • A React project can be compiled into static HTML.

And there are many more examples!

However, there are cases where you want this simplicity, but would like to run it on your own low-cost server, for greater control or tunability. To achieve this we will be using a simple high performance tool I wrote called go-live which replicates the functionality.

Step 1: Create a basic $5/month Ubuntu droplet on Digital Ocean. You can actually run on any hosting provider (AWS, Azure, etc.) but I like Digital Ocean because it’s fast, cheap, and you don’t need a lot of performance for go-live to run. The entire program is around 4MB big!

Step 2: Once your droplet is created (should take 30 seconds) login to it via SSH. You can do this by using the command:

ssh root@<IP ADDRESS OF DROPLET>

If you are able to connect, you should see a welcome message like below.

Step 3: Once you are on the Droplet, it’s time to start installing the server. The first step is to turn on tmux so your session doesn’t end when you log out. So first type in

tmux

Now you should be in the Tmux session, if you close your terminal, you can get back again by using tmux attach -t 0 . Once you have tmux going, install the server run the following command:

snap install go-live

Once you run the command, you should see output like this. Now the server is ready to go.

Congratulations the server is ready!

Step 4: At this stage you can run the command in any directory and it’ll start serving it publicly on port 9000. Just run this command:

go-live

Let’s test it out. When go-live doesn’t see any HTML files in a directory its serving, it starts in file server mode.

Once it’s being run you can go to the Net address and see the files from any computer, it’s being served! go-live uses the simplest defaults possible to get your up and running quickly.

It’s working! (I created test.txt and test2.txt for the demo, they’re not there by default)

Step 5: Now that the server is running, simply put any HTML files in a directory, and it’ll start serving it in real time. Any file called index.html is served first when users connect.

Congratulations, upload and compile your HTML to the server and then run go-live in the directory and you’re done.

Bonus Step: Want to get DNS and HTTPS for your server? First get a DNS name, and then connect your DNS name to Cloudflare. This is dependent on where you buy your DNS name. Cloudflare is totally free, but registering a DNS name isn’t.

Once you have the DNS connected, create an A record, from your DNS name (Sample.com) to the IP address of your Digital Ocean instance.

Now go to your server, and run

go-live --server

Which runs go-live on Port 80! You’re now ready for users to go to sample.com and hit your webpage.

--

--