> For the complete documentation index, see [llms.txt](https://dvault.onepub.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dvault.onepub.dev/installing-dvault.md). Agents can also search and read this documentation through its [MCP server](https://dvault.onepub.dev/~gitbook/mcp).

# Installing DVault

## Installing DVault

There are a couple of ways you can install DVault:

DVault is written in dart so if you have dart installed you can install DVault by running:

```
pub global activate dvault
```

The DVault project also provides binaries for each of the supported platforms.

You can download the latest version from one of the following links:

TODO: use pub\_release package to deploy exes.

Linux Windows Mac OSX

## Initialising DVault

Once you have installed DVault you need to initialise it:

```
dvault init
```

DVault will ask you for a passphrase which is used to secure your private key.

IF YOU FORGET YOUR PASSPHRASE YOU ARE SCREWED. Store it somewhere safely.

When you initialise DVault it generates a public/private key pair and stores them in your home directory in a file called `.dvault`.

If you need to automate the initialisation of DVault then we support a number of ways to pass in the passphrase.

In order from most secure to least secure:

<table data-header-hidden><thead><tr><th>Method</th><th>Description</th><th width="199">Example</th><th>Notes</th></tr></thead><tbody><tr><td>Method</td><td>Description</td><td>Example</td><td>Notes</td></tr><tr><td>ask</td><td>dvault will prompt the user for the passphrase</td><td><code>dvault init</code> or <code>dvault -p=ask init</code></td><td>This is the default method and the most secure.</td></tr><tr><td>stdin</td><td>Pipe the passphrase in via standard in</td><td><code>echo 'my passphrase' \| dvault -p=stdin init</code></td><td>Using echo as this example does actually makes this the least secure. You should have your application write directly to stdin rather than spawning a process with the passphrase on the cli.</td></tr><tr><td>env</td><td>Pass the passphrase via the environment variable DVAULT_PASSPHRASE</td><td><code>export DVAULT_PASSPHRASE="my passphrase";dvault -p=env init</code></td><td>Many OSs let a privileged user examine the environment variables associated with any process so using an environment variable could expose your passphrase to other users on the same system.</td></tr><tr><td>arg</td><td>Pass the passphrase via a command argument</td><td><code>dvault -p=arg -P="my passphrase" init</code></td><td>If you use the -P option you don't actually need to provide the -p=arg option as its assumed. You can't use the -P option with any other -p option.</td></tr></tbody></table>
