Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 36 ยท Getting Started

Installing Vault and Using Dev Mode

Install the Vault binary on Windows, macOS and Linux, start the in-memory dev server, set VAULT_ADDR and VAULT_TOKEN, and learn what dev mode does and does not do.

Vault ships as a single binary called vault. The same binary is the server and the command-line client. To learn safely you can start a dev server: a throwaway Vault that keeps everything in memory, starts already unsealed and uses a known root token. It is perfect for practice and unsafe for anything real.

This lesson covers installing the binary, starting dev mode, pointing the CLI at it, and understanding exactly what dev mode changes compared with production.

You cannot run Vault on this site, so the commands below are read-only. I show what each command is for rather than inventing its output. The runnable examples parse environment-style settings and check a command line, as stand-ins.

Installing the binary

Platform Common way
macOS brew tap hashicorp/tap then brew install hashicorp/tap/vault
Windows Download the zip from the official releases page, put vault.exe on your PATH; or use a package manager such as winget or Chocolatey
Debian/Ubuntu Add HashiCorp's apt repository, then sudo apt install vault
RHEL/Fedora Add HashiCorp's yum/dnf repository, then install vault
Docker Use the official hashicorp/vault image

Always download from the official HashiCorp release site and verify the checksum and signature that is published with each release. Then check that it works:

Terminal
vault version
vault --help

Starting the dev server

Terminal
vault server -dev

When it starts, it prints the address (by default http://127.0.0.1:8200), an unseal key and a root token. Dev mode:

  • stores data in memory, so everything is lost when the process stops;
  • is already initialized and unsealed;
  • listens without TLS on 127.0.0.1:8200;
  • enables a secret/ KV version 2 mount;
  • uses a root token you can choose with -dev-root-token-id.
Terminal
vault server -dev -dev-root-token-id="root"

A fixed root token is convenient on your own laptop and a disaster anywhere else. Never expose a dev server to a network.

flowchart LR
    T1["Terminal 1<br/>vault server -dev"] --> V["Vault<br/>127.0.0.1:8200<br/>in memory"]
    T2["Terminal 2<br/>vault status"] -->|"VAULT_ADDR"| V

Leave the server running in one terminal and use another for the client.

Pointing the CLI at the server

The CLI reads two environment variables:

Variable Meaning
VAULT_ADDR The server URL, for example http://127.0.0.1:8200
VAULT_TOKEN The token sent with requests

Set them in the second terminal. On macOS and Linux:

Terminal
export VAULT_ADDR='http://127.0.0.1:8200'
export VAULT_TOKEN='root'

In PowerShell:

POWERSHELL
$env:VAULT_ADDR = "http://127.0.0.1:8200"
$env:VAULT_TOKEN = "root"

Then run:

Terminal
vault status

vault status reports whether Vault is initialized, whether it is sealed, the version and the storage type. It works even when the server is sealed, which makes it a useful first diagnostic.

Checking your environment

This stand-in reads an environment-like block and tells you what the CLI would see, including the common mistake of using https against a dev server that has no TLS.

Python Check VAULT_ADDR and VAULT_TOKEN

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

What dev mode does not teach you

Dev mode hides the hardest parts of Vault: initialization, key shares, unsealing, storage, TLS and high availability. You will study those in Seal, Unseal and Shamir's Secret Sharing and Initializing and Unsealing Vault. Think of dev mode as a classroom: the real Vault behaves the same for secrets and policies, but starts differently.

Validating a dev command line

A tiny linter for startup commands, useful for catching dangerous flags before they leave a laptop.

Python A startup-command linter

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Stopping and cleaning up

Press Ctrl+C in the server terminal. Because storage is in memory, all secrets, tokens and policies vanish. Starting again gives a new unseal key and (unless you fixed it) a new root token, so remember to update VAULT_TOKEN.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What happens to your data when a dev server stops?

    Dev mode uses in-memory storage. Nothing survives a restart.
  2. 2. Which variable tells the CLI where the server is?

    VAULT_ADDR holds the server address and VAULT_TOKEN holds the token.
  3. 3. Why does the CLI fail with a TLS error against the dev server when VAULT_ADDR starts with https?

    Dev mode listens without TLS. Use an http address for it.
  4. 4. Which statement about dev mode is true?

    Dev mode is for learning only and starts already initialized and unsealed.

Summary

  • Vault is one binary that acts as server and client; download it from the official site and verify it.
  • vault server -dev starts an in-memory, unsealed, no-TLS server for practice only.
  • Set VAULT_ADDR and VAULT_TOKEN, then use vault status to test.
  • Dev mode skips initialization, unsealing, storage and TLS, which production needs.

Next: Your First Secrets with the KV Engine