dWeb University

How To Create dSites

What Is A dSite

A dSite works just like any other website, but instead of being transported with HTTP, a dSite's files are transported (perhaps unsurprisingly) with a P2P protocol like dWeb. dWeb is the P2P protocol integrated with dBrowser, although we plan on integrating more in the future.

Instead of being hosted on a server, the files of a dSite can be hosted from any computer! This means that you can publish a website from your personal computer, and your friends, your pet dog, or anyone else on the network can help keep your website’s files online.

In dBrowser, a dSite is simply a folder that’s been published with dweb://. This website is a dSite! You can visit dweb://dwebs.io to see for yourself.

dSites are exciting because they enable anyone to create and publish a website without needing to know how to run a server. As long as someone else on the network is seeding your website’s files, it will stay online. It also allows someone who is under constant censorship by centralized network operators to safely sleep at night, knowing their dSite will be online tomorrow.

How To Create A dSite?

Creating a dSite can be done via dBrowser and/or dPack CLI.
Below, we cover both ways you can accomplish this whether using dBrowser or dPack CLI.

Creating a dSite via dBrowser

Please refer to dBrowser's documentation for how to create a dSite within dBrowser here: Creating dSites In dBrowser

Creating a dSite via dPack CLI

Step 1 - Launch dPack

To start using the dPack CLI, simply open your terminal and type

dweb

You will immediately see a usage menu as you see below:

Step 2 - Create a dPack

To create a dPack, simply run:

dweb create

You will be asked to create a title and a description for your dPack. After finishing the dPack setup, you will be given a dWeb URL that starts with dweb://. After creation, you will notice that the directory you created within, has a "dweb.json" file that contains the title and description you created during dPack setup.

Step 3 -Distribute a dPack

To distributed the dPack you created so other peers on the dWeb can view it, simply run:

dweb dist

Once you run dweb dist, the dPack will remain available for dWeb until you exit the dist screen.

Step 4 - Forking a dPack

You can fork a dPack via a remote peer by running

dweb fork <dweb-address>

Make sure you include the dWeb address immediately after the command. For example, you could run dweb fork dweb://cbce9c5e3... and it will fork the dPack to whichever folder your terminal is actively running commands within.

Step 5 - View It!

Once a dPack is being distributed to peers, you can take the dWeb address and paste into dBrowser's address bar and view the files, the dSite or the dApp your dPack is based on. It's that simple. You can even point your .com or other TLD to your dWeb address, so you can serve your dPack from the dWeb rather than expensive servers!

Distributing dSites

In order to distribute a dSite or a dApp, simply open a terminal, go to the folder your dSite is in and run the following commands using screen:

dweb dist
[CTRL A + D to exit screen and keep distribution running]

Keeping dSites Online Forever

dWeb's P2P protocol enables users and web developers to publish dSites/dApps straight from their personal computer although what happens when someone turns off their computer? If nobody is seeding your dSite or dApp, your dSite or dApp won't be available. It's not good practice to keep your computer on 24/7, so we created many solutions to keeping your dSites and dApps online, so you can safely turn off your computer without any worry!

  • Use dPack CLI from a server by forking the dWeb key address and then syncing it with the dWeb.
  • Ask a friend to help seed your files with dBrowser's seeding menu
  • Share your website’s URL with a seeding service like dHosting
  • Or setup a permanent seeding tower using dPack Forever

How To Create dSites


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.