Quick how to: Host a website on Dat (Beaker Browser) for free
Update 20210111: This tutorial is out of date. Beaker Browser updated its protocol to hyper (HyperCore, HyperDrive). HashBase doesn’t work with hyper at the time of this update.
Dat is a peer-to-peer protocol. Beaker Browser is a browser to browse websites hosted on it. If you visit a website, you download it from other peers, and you seed it further. If you want to support a website, you can pin it, so it’s always available on your computer for others to access (pin me!).
You can host your websites on Dat for free. There are no servers; users and pinning services can serve your files. There are free services that can make your website available on the clearnet.
You host only static websites on Dat. There are no servers to interact with, to host databases on. Static websites can still be used for a lot. With JavaScript you can access other peer-to-peer networks, and store data on if needed, like IOTA or IPFS.
Popular static site generators are Jekyll and Hugo, but there are many others. With these tools you can quickly, easily make a website or a blog that looks good, works well with phones and search engines. You don’t have to do any coding. You should keep your website small, so it’s easier to pin; compress your images.
-
Download Beaker Browser, set it up to your liking
-
Menu > Create new > From folder > select the folder your website’s in
-
Under Settings fill in the metaadata: Title, Description etc.
-
Under Files review the changes and Publish all
-
Click Share and share your public key with your friends
The websites are identified by private keys (dat://46415d000a5080de26f2458c4170e954c0e0ae0a914143aac09ab138b298019c/ for example). While you’re online everyone can download your websites from you. You should use a pinning service to host your files even when you are offline. HashBase is a popular pinning service that can host 100 MB for free. It gives you a subdomain, so it’s easier for you to share your website, and it makes your website accessible from the clearnet as well.
-
Paste in your public key
-
Give a name (subdomain) to your website
You’re done. Your website is accessible from the clearnet under https://yourname.hashbase.io. It’s always available for everyone to visit. Share your website.
If you’re on Dat, but you host your website on the clearnet in some other way too, like GitHub Pages, you should add a .well-known/dat and a _config.yml file like such, so if people use the Beaker Browser (or a browser add-on), they are redirected to the decentralized Dat website.
Do you have a hobby you want to write about? Do you want a personal website, or a website for your small business? You can create a pretty, small, static website for free in some minutes or hours.