Static site hosting on IPFS

Look ma, no centralized storage!

We're moving from a centralized understanding of the world to a decentralized understanding of the world.

One domain, some HTML, and a pinned IPFS folder.

That's all it took to host this website. It’s so simple that an ape could do it and it still has pros of a regular website:

And guess what:

You never knew it, but it’s easy for you to host static sites with IPFS too and heres how:

Get the IPFS client

Downloading the client could not be more straight forward.
You go to the IPFS repository and download the file for your OS.
Do you ever install and use a new application without reading the docs? Yeah, me too. In case you haven't downloaded something in the last decade, the docs are on the IPFS docs page.

Upload your HTML to IPFS

Create yourself something that doesn't remind you of MySpace.
Take your properly written to spec index.html, minified css, and optimized images, and place them together in a folder. Only savages don't test their work before publishing; make sure your relative paths are working. Next, you yeet that folder to the InterPlanetary File System by importing it in the IPFS client. Then click 'Pin' on the folder in your IPFS client to get the identifier. Lets just say its hard to give directions to our web 1.0 masterpiece if we don't know where it is.

Gateway and DNS

How do you navigate deep space?
Not sure about you, but portals sound good to me. First you create a portal using a cname record that points to an IPFS gateway. Then we create a _dnslink txt record that tells the portal where to go.

Here is an example:

Type Name Content
CNAME example.com cloudflare-ipfs.com
TXT _dnslink dnslink=/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco

Note: There are multiple types of gateways and approaches to DNS, this is just one of them.

To the moon!

You've now succesfully launched your content to the InterPlanetary Filesystem. Send your friends the link to your domain or the direct ipfs gateway link. To challenge your 1337 haxors, see if they can get your page with just the CID.

“The only way to control chaos and complexity is to give up some of that control.” — Gyan Nagpal


Epilogue

Inspired by my slack friends over at #cryptocurrency and #server-ops.

Heres to keeping up with the ever increasing pace of technology advancemnt. 🚀