loading...
Cover image for FREE JamStack / Static Site Hosting with Keybase.io

FREE JamStack / Static Site Hosting with Keybase.io

joelnet profile image JavaScript Joel Originally published at joel.net ・2 min read

Keybase offers secure messaging and file sharing. Included in the file sharing offering is 250GB of storage which can also be used to host public JamStack / Static Websites.

Install Keybase

Keybase Sites are accessed through their software so you'll have to head over to Keybase.io and follow the directions for your operating system to install.

After installing the Keybase client, navigate to the Files tab. You should see a screen similar to this.

keybase.png

Follow the directions to Enable Keybase for the file system for your operating system. This will give you native file system access to your Keybase secure file share.

Once the Keybase File System has been installed you should be able to access your files at /keybase for Mac/Linux and K:\ on Windows.

If everything is setup correctly, under /keybase you should see three directories.

/keybase
    /private
    /public
    /team
Enter fullscreen mode Exit fullscreen mode

The Keybase Subdomain

All Keybase accounts are given a subdomain with the format <username>.keybase.pub. For example, my username is joelnet, so my subdomain is joelnet.keybase.pub. This is where my static files will live.

Copying Files to Keybase

Files can be added to the Keybase Subdomain by copying them into /keybase/public/joelnet (K:\public\joelnet on Windows). All files copied here are PUBLIC and everyone has read access to them.

I have prepared a Gatsby site that I am going to copy to /keybase/public/joelnet (K:\public\joelnet on Windows).
copy-files-to-keybase.gif

Your website has been deployed! Open up a browser and visit your new site. My site is now up and visible on joelnet.keybase.pub 🔥

Custom Domain Names

Keybase also supports custom domain names, but the process is a little different.

The site needs to be deployed under /keybase/private/<username>,kbpbot/<site> (K:\private\<username>,kbpbot/<site> on Windows). <site> can be any name. This gives you the flexibility to host multiple sites on Keybase.

The next step is setting up the DNS.

Create a CNAME to point to kbp.keybaseapi.com.

Next create a TXT record. If your site is at my-site.example.com, then prefix the record with _keybase_pages..

This is what my DNS records look like:

dns.png

After copying your files, your website should be accessible on your custom domain!

End

More information about Keybase Sites can be found here.

Cheers 🍻

Photo by Killian Eon from Pexels

Discussion

pic
Editor guide