How to: Decentralized Web Hosting for Free Using Blockstack (with https too!)

When I was almost done with this, I realized it looks like an ad. It's not. I'm not affiliated with Blockstack or Runkod...just a user who likes both.

The goal here: get your website hosted in a place that's both free and decentralized. And oh, with https and with a custom domain name, like yoursite.com Yes, it's possible...I did it yesterday (see nefties.com).

The problem(s): problem #1 is that web hosting can get expensive. Problem #2 is that although there are free hosts and they're great, they often have nuisance ads or goofy things can happen. Several websites of mine recently, and suddenly, just vanished. Poof! They gone.

A decentralized host is a possible solution. Decentralized means that it's not run by anyone or any company or any organization. It's a network of independent computers (or nodes), like a blockchain, or bittorrent, or Napster from the old days. This is not for everyone. The sites can only be "static", meaning there's no use of php or cgi scripts, no databases to store user info. It's just web pages. But, for simply showing html/css/javascript web pages, it's great.

Blockstack

First, you'll need to use Blockstack. Blockstack is fantastic and has its own intricate rabbit-hole. They call themselves the "user-owned internet", meaning there are no ISPs, no companies providing the backbones behind it. Discussing Blockstack is way beyond the scope here. But, you'll need to join up do the steps below.

Also, there are two options presently for a decentralized site using Blockstack: XORbrowser and Runkod. I've used Runkod, then started with XORbrowser. XOR was intended as the focus of this tutorial. (Note: it was easy, it worked and I got my site running, but the URL was horrendous and I couldn't customize the domain.) Still, in the process or working this out, I heard from the XORbrowser dev, @mmajeed on Discord. He said he hasn't updated things in a while and he recommended Runkod. Since the XORbrowser dev directed me elsewhere, I kinda think that's a good hint to go there. So, Runkod it is.


Go to runkod.com


Go to Runkod.com, click "Launch your first project" then "Get started".

Since I joined with Blockstack, they've changed how people sign up. I'm not 100% sure, but I believe by onboarding with Runkod you will also get a Blockstack id. Still, follow the instructions at Runkod and I trust you'll get in.


Once into Runkod, click "Add Project".


This appeared after I added nefties.com. I believe you may need to wait 5 or 10 minutes before the dot changes from orange to green.

You're getting close now. The image above shows the "Management Console". You can see I have three websites hosted there, with nefties.com being the new one I added while writing this. Clicking the newly added project (nefties.com) opens the image below...


Notice the nefties.runkodapps.com subdomain. That will work just fine and you can use that URL immediately. (You'll get a "[R] It works!" on your website.) If you just want a place to get your files online, and you're okay with that URL, you're done. Just upload your files, and activate. Simple.

Your own domain name

I wanted to use my own .com domain name.

Runkod has a very good tutorial in their docs section https://runkod.com/docs. I basically just followed it, and it's clear, so I won't try to replicate it. I will offer a quick summary and a couple of notes.

There are essentially three things to do:

  1. put in a txt record (and get https)
  2. alter your DNS records
  3. get URLs pointing to the right place

These steps can be a little tricky, but it can be done. One of the reasons it's a little tricky is that steps 1 and 2 depend on who you registered your domain with. Mine was with bluehost, which was not on Runkod's tutorial, so I had to fumble around until it worked.

Still, it worked. Here's a little idea of what worked for me:

Thing 1
Adding the txt record is really very simple. And, you get a free security certificate so https works! You generate a random text-gibberish-string in Runkod, then paste it into the place where you registered the domain (like bluehost or godaddy) in their appropriate spot. After doing so, you go back to Runkod and check to see if things are "linked up".

This step took me a while. For some reason, it did not work the first time. I was stuck and just went on using the nefties.runkodapps.com subdomain. I tried the next day and Runkod generated a different txt record. Still, no luck. I tried a day or two later with another newly generated txt record, and for some reason, it went through the first try. Done with that.

Thing 2
This may be different depending with whom you registered your domain name, but for me using bluehost, this was very simple. I altered the CNAME as below:


The "host record" needs to be www as well as @ (see below). I think these "kadikoy" and "besikas" entries are the same for everyone. My understanding is that this is what gets the site work to both with and without the www in the URL.

Thing 3
Again, you can simply follow Runkod's great docs for this...https://runkod.com/docs/attaching-custom-domain-to-project. I'll just add some images to illustrate what I did.

Back in Runkod's "Management Console"...

The last thing to do is redirect things around back in Runkod. Remember, you've got your_site.runkoddapps.com already working. Now you want the www and the no-www and the your_sire.runkoddapps.com all to point to the same place, no matter what someone types into the URL bar.


You click "attach" and choose the one you want. In my case, I understand that this is telling nefties.runkoddapps.com to link up to nefties.com

I may have these out of order, but you also want to "redirect" the www and no-www, as below...


The end result is that www.nefties.com and nefties.com go together, kind of like the little green criss-cross arrows illustrates...

Load your pages

If you haven't loaded any html, you'll get a generate [R] web page that says "it works".

So, you've gotta drag in your own html and css and such. It's easy...just drag it in, let it load, then "activate". Boom!


Yours will be empty at first.

As a note, it seems you have to upload every file/image/directory etc. every time you make a new update. It would be nice if you only had to upload the files changed, but I believe that's not the case. Still, it's free, https, decentralized and that's pretty great.

Done

That's it. My website was up and running. It loads for nefties.com or www.nefties.com or https://nefties.com or nefties.runkoddapps.com


The finished product...my website with free decentralized web hosting, with https and a custom domain name.

Final note

Runkod seems great and being decentralized should mean it won't disappear. Still, you never know...Napster's not still around, is it? Please make sure you keep all or your files backed up somewhere else. If things suddenly evaporate, you'll be glad you have that backup.



Need a free Hive account? Learn more or get one here.

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center