npm install -g dweb
A distributed data community. DWeb is a nonprofit-backed community & open protocol for building apps of the future.
Use dWeb command line to share files with version control, back up data to servers, browse remote files on demand, and automate long-term data preservation.
Have questions? Join our chat via IRC or Gitter:
Table of Contents
- Install the
$ dwebCLI to use in the command line.
$ dweb command line tool
The recommended way to install the DWeb command line tool is with
npm install -g dweb
Make sure you have
npm installed first. If not, see the prerequisites section below. We recommend
npm because it makes it easy to install new versions of
dweb when they get released.
npm install finishes, you should be able to run the
$ dweb command. If not, see the installation troubleshooting for tips.
Installing without npm
If you are unable to use
npm to install dweb, you can also download a single file binary distribution version of
dweb using the one line install command below. The binary includes a copy of node and dweb packaged inside a single file, so you just have to download one file in order to start sharing data, with no other dependencies needed on your system:
wget -qO- https://raw.githubusercontent.com/distributedweb/dweb-climaster/download.sh | bash
- Node: You'll need to install Node JS before installing DWeb. DWeb needs
nodeversion 4 or above and
npminstalled. You can run
node -vto check your version.
npmis installed with node. You can run
npm -vto make sure it is installed.
Once you have
npm ready, install
dweb from npm with the
--global, -g option,
npm install -g dweb.
What is DWeb?
Share, backup, and publish your filesystem. You can turn any folder on your computer into a dweb. DWeb scans your folder, allowing you to:
- Track your files with automatic version history.
- Share files with others over a secure peer to peer network.
- Automate live backups to external HDs or remote servers.
- Publish and share files with built in HTTP server.
DWeb allows you to focus on the fun work without worrying about moving files around. Secure, distributed, fast.
Rather not use the command line? Check out these options:
- DWeb Desktop - A desktop app to manage multiple dats on your desktop machine.
- Beaker Browser - An experimental p2p browser with built-in support for the DWeb protocol.
dweb command line
Share, download, and backup files with the command line! Automatically sync changes to datasets. Never worry about manually transferring files again.
Add DWeb to your
npm install dweb --save. DWeb exports the dwebs-core API via
Full API documentation is available in the dwebs-core repository on Github.
We have DWeb installed, let's use it!
DWeb's unique design works wherever you store your data. You can create a new dweb from any folder on your computer.
A dweb is some files from your computer and a
.dweb folder. Each dweb has a unique
dweb:// link. With your dweb link, other users can download your files and live sync any updates.
You can start sharing your files with a single command. Unlike
git, you do not have to initialize a repository first,
dweb share will do that for you:
dweb share <dir>
dweb share to create a dweb and sync your files from your computer to other users. DWeb scans your files inside
<dir>, creating metadata in
<dir>/.dweb. DWeb stores the public link, version history, and file information inside the dweb folder.
dweb clone dweb://<link> <download-dir>
dweb clone to download files from a remote computer sharing files with DWeb. This will download the files from
dweb://<link> to your
<download-dir>. The download exits after it completes but you can continue to update the files later after the clone is done. Use
dweb pull to update new files or
dWeb archive synced to live sync changes.
dweb clone with the link above to read more about the protocol!
Other Cool Commands
A few other highlights. Run
dweb help to see the full usage guide.
dweb create- Create an empty dWeb archive and
dweb doctor- DWeb network doctor! The doctor tries to connect to a public peer. The doctor also creates a key to test direct connections.
dweb log ~/data/dweb-folder/or
dweb log dweb://<key>- view the history and metadata information for a dweb.
To get started using DWeb, you can try downloading a dweb and then sharing a dweb of your own.
We made a demo folder just for this exercise. Inside the demo folder is a
dweb.json file and a gif. We shared these files via DWeb and now you can download them with our dweb key!
Similar to git, you can download somebody's dweb by running
dweb clone <link>. You can also specify the directory:
❯ dweb clone dweb://778f8d955175c92e4ced5e4f5563f69bfec0c86cc6f670352c457943666fe639 ~/Downloads/dweb-demo dweb v13.5.0 Created new dWeb archive in /Users/joe/Downloads/dweb-demo/.dweb Cloning: 2 files (1.4 MB) 2 connections | Download 614 KB/s Upload 0 B/s dWeb archive synced complete. Version 4
This will download our demo files to the
~/Downloads/dweb-demo folder. These files are being shared by a server over DWeb (to ensure high availability) but you may connect to any number of users also hosting the content.
You can also also view the files online: registry.dwebx.net/778f8d955175c92e4ced5e4f5563f69bfec0c86cc6f670352c457943666fe639. registry.dwebx.net can download files over DWeb and display them on HTTP as long as someone is hosting it. The website temporarily caches data for any visited links (do not view your dweb on registry.dwebx.net if you do not want us to cache your data).
DWeb can share files from your computer to anywhere. If you have a friend going through this demo with you, try sharing to them! If not we'll see what we can do.
Find a folder on your computer to share. Inside the folder can be anything, DWeb can handle all sorts of files (DWeb works with really big folders too!).
First, you can create a new dweb inside that folder. Using the
dweb create command also walks us through making a
❯ dweb create Welcome to dweb program! You can turn any folder on your computer into a dWeb archive. A dWeb archive is a folder with some magic.
This will create a new (empty) dweb. DWeb will print a link, share this link to give others access to view your files.
Once we have our dweb, run
dweb share to scan your files and sync them to the network. Share the link with your friend to instantly start downloading files.
You can also try viewing your files online. Go to registry.dwebx.net and enter your link to preview on the top left. (Some users, including me when writing this, may have trouble connecting to registry.dwebx.net initially. Don't be alarmed! It is something we are working on. Thanks.)
Bonus HTTP Demo
DWeb makes it really easy to share live files on a HTTP server. This is a cool demo because we can also see how version history works! Serve dweb files on HTTP with the
--http option. For example,
dWeb archive synced --http, serves your files to a HTTP website with live reloading and version history! This even works for dats you're downloading (add the
--sparse option to only download files you select via HTTP). The default HTTP port is 8080.
localhost:8080/?version=10 to view a specific version.
Get started using DWeb today with the
clone commands or read below for more details.
The first time you run a command, a
.dweb folder is created to store the dWeb metadata.
Once a dweb is created, you can run all the commands inside that folder, similar to git.
DWeb keeps secret keys in the
~/.dweb/secret_keys folder. These are required to write to any dats you create.
Creating a dweb & dweb.json
dweb create [<dir>]
The create command prompts you to make a
dweb.json file and creates a new dweb. Import the files with sync or share.
Optionally bypass Title and Description prompt:
dweb create --title "MY BITS" --description "are ready to synchronize! 😎"
dweb create --yesdweb create -y
The quickest way to get started sharing files is to
❯ dweb share dweb://3e830227b4b2be197679ff1b573cc85e689f202c0884eb8bdb0e1fcecbd93119 Sharing dweb: 24 files (383 MB) 0 connections | Download 0 B/s Upload 0 B/s Importing 528 files to Archive (165 MB/s) [=-----------------------------------------] 3% ADD: data/expn_cd.csv (403 MB / 920 MB)
Syncing to Network
dWeb archive synced [<dir>] [--no-import] [--no-watch]
Start sharing your dweb archive over the network.
Sync will import new or updated files since you last ran
Sync watches files for changes and imports updated files.
--no-importto not import any new or updated files.
--no-watchto not watch directory for changes.
--importmust be true for
By default, DWeb will ignore any files in a
.datignore file, similar to git. Each file should be separated by a newline. DWeb also ignores all hidden folders and files.
DWeb uses dweb-ignore to decide if a file should be ignored. Supports pattern wildcards (
/*.png) and directory-wildcards (
By default, DWeb will download all files. If you want to only download a subset, you can create a
.dwebdownload file which downloads only the files and folders specified. Each should be separated by a newline.
Start downloading by running the
clone command. This creates a folder, downloads the content and metadata, and a
.dweb folder inside. Once you started the download, you can resume using
clone or the other download commands.
dweb clone <link> [<dir>] [--temp]
Clone a remote dweb archive to a local folder. This will create a folder with the key name if no folder is specified.
You can use a
dweb.json file to clone also. This is useful when combining DWeb and git, for example. To clone a dweb you can specify the path to a folder containing a
git clone email@example.com:joehand/dweb-clone-sparse-test.git dweb clone ./dweb-clone-sparse-test
This will download the dweb specified in the
Updating Downloaded Archives
Once a dweb is clone, you can run either
dweb pull or
dWeb archive synced in the folder to update the archive.
dweb pull [<dir>]
Update a cloned dweb archive with the latest files and exit.
dWeb archive synced [<dir>]
Download latest files and keep connection open to continue updating as remote source is updated.
dweb <link> <dir>will run
dweb clonefor new dats or resume the existing dWeb archive in
dweb <dir>is the same as running
dWeb archive synced <dir>
DWeb Registry and Authentication
As part of our Knight Foundation grant, we are building a registry for dweb archives. We will be running a dweb registry at registry.dwebx.net, but anyone will be able to create their own. Once registered, you will be able to publish dweb archives from our registry. Anyone can clone archives published to a registry without registration:
dweb clone registry.dwebx.net/jhand/cli-demo
You can also use the
dweb command line to register and publish to dweb registries. DWeb plans to support any registry. Currently,
registry.dwebx.net is the only one available and the default.
To register and login you can use the following commands:
dweb register [<registry>] dweb login dweb whoami
Once you are logged in to a registry, you can publish a dWeb archive archive:
cd my-data dweb create dweb publish --name my-dataset
All registry requests take the
<registry> option if you'd like to publish to a different registry than registry.dwebx.net.
You can deploy your own compatible registry server if you'd rather use your own service.
Key Management & Moving dats
dweb keys provides a few commands to help you move or backup your dwebs.
Writing to a dweb requires the secret key, stored in the
~/.dweb folder. You can export and import these keys between dwebs. First, clone your dweb to the new location:
dweb clone <link>
Then transfer the secret key:
dweb keys export- copy the secret key printed out.
dweb keys import- this will prompt you for the secret key, paste it in here.
If you have trouble sharing/downloading in a directory with a
.dweb folder, try deleting it and running the command again.
Check Your dWeb Version
Knowing the version is really helpful if you run into any bugs, and will help us troubleshoot your issue.
Check your DWeb version:
You should see the DWeb semantic version printed, e.g.
Node & npm
To use the DWeb command line tool you will need to have node and npm installed. Make sure those are installed correctly before installing DWeb. You can check the version of each:
node -v npm -v
-g option installs DWeb globally, allowing you to run it as a command.
Make sure you installed with that option.
- If you receive an
EACCESerror, read this guide on fixing npm permissions.
- If you receive an
EACCESerror, you may also install DWeb with sudo:
sudo npm install -g dweb.
- Have other installation issues? Let us know, you can open an issue or ask us in our chat room.
If you are having trouble with a specific command, run with the debug environment variable set to
dweb (and optionally also
This will help us debug any issues:
DEBUG=dweb,dwebs-core dweb clone dweb://<link> dir
Networking capabilities vary widely with each computer, network, and configuration. Whenever you run DWeb there are several steps to share or download files with peers:
- Discovering Peers
- Connecting to Peers
- Sending & Receiving Data
With successful use, DWeb will show
Connected to 1 peer after connection.
If you never see a peer connected, your network may be restricting discovery or connection.
Please try using the
dweb --doctor command (see below) between the two computers not connecting. This will help troubleshoot the networks.
- DWeb may have issues connecting if you are using iptables.
We've included a tool to identify network issues with DWeb, the DWeb doctor. The DWeb doctor will run two tests:
- Attempt to connect to a public server running a DWeb peer.
- Attempt a direct connection between two peers. You will need to run the command on both the computers you are trying to share data between.
Start the doctor by running:
For direct connection tests, the doctor will print out a command to run on the other computer,
dweb doctor <64-character-string>.
The doctor will run through the key steps in the process of sharing data between computers to help identify the issue.
var DWeb =
Read more about the JS usage provided via
Please see guidelines on contributing before submitting an issue or PR.
This command line library uses dwebs-core to create and manage the archives and networking. If you'd like to build your own DWeb application that is compatible with this command line tool, we suggest using dwebs-core.
Installing from source
Clone this repository and in a terminal inside of the folder you cloned run this command:
This should add a
dweb command line command to your PATH.
Now you can run the
dweb command to try it out.
The contribution guide also has more tips on our development workflow.
npm run testto run tests
npm run auth-serverto run a local auth server for testing