What Vault needs from the hardware
With integrated storage, all of Vault's data lives on each node's own disk, so HashiCorp's reference architecture sizes the disk as carefully as the processor. It gives two starting points per node:
| Cluster size | CPU | Memory | Disk | Disk IOPS | Throughput |
|---|---|---|---|---|---|
| Small | 2-4 cores | 8-16 GB | 100+ GB | 3,000+ | 75+ MB/s |
| Large | 4-8 cores | 32-64 GB | 200+ GB | 10,000+ | 250+ MB/s |
The same guide recommends five nodes spread over three availability zones, which survives losing two nodes or a whole zone. Each node listens on two ports: 8200 for the API, the web UI and cluster bootstrapping, and 8201 for Raft, replication and request forwarding between Vault servers. A single node is a fine start but has no failover.
Why Vault is happier on a machine of its own
HashiCorp's production hardening guide says Vault should be the only user process on its host, with swap disabled so sensitive memory never lands on disk, core dumps switched off, and the service running as an unprivileged account. Each needs control of the operating system.
- No neighbours. A dedicated server is one physical computer with nobody else's work on it, so the single-tenancy advice is met by the hardware, not by a promise.
- Root access. You set the swap, core-dump and firewall rules yourself, and choose Ubuntu or Debian from the install list.
- A way back in. Rack servers, blades and the m510 and m710x cartridges come with an out-of-band console: the screen and the power button, even when a firewall rule has cut off SSH.
- Start clean whenever you like. Reinstalling the operating system is a control-panel action with no ticket and no charge.
- No contract. The term is month to month, so a trial commits you to nothing longer.
Picking the server
Match the node to the table above and favour the disk over the processor. For a lab or a small single node, a compact cartridge server with an SSD is enough. For a production cluster, look at the two-processor blades and rack machines on the enterprise dedicated servers page: hardware RAID for a mirrored pair of SSDs, registered ECC memory, and the console on every one. Some single-processor lines carry NVMe disks.
Every server ships with one IPv4 address and IPv6 at no charge, on an unmetered port. A racked server is handed over within 30 minutes of payment approval. The servers are in New York, Miami, San Francisco, Amsterdam and Bucharest; current builds and prices are on the dedicated server catalogue.
Installing Vault on Ubuntu or Debian
HashiCorp publishes an APT repository. The package adds a local vault user, a vault.service systemd unit and a config file at /etc/vault.d/vault.hcl. Keep port 8200 closed to the internet until you have finished init: an uninitialised Vault hands the keys to whoever initialises it first.
- Add the repository and install the package with the three commands below, copied from HashiCorp's install page.
- Put your certificate, private key and CA file in
/opt/vault/tls/asvault-cert.pem,vault-key.pemandvault-ca.pem, then set ownership so only thevaultgroup can read the key:sudo chown root:vault /opt/vault/tls/vault-key.pemandsudo chmod 0640 /opt/vault/tls/vault-key.pem(the cert and CA go toroot:root, mode0644). - Replace the contents of
/etc/vault.d/vault.hclwith the config further down, putting the server's own address and a unique node name in the placeholders. - Turn swap off on the host, as the integrated storage docs strongly recommend alongside
disable_mlock = true. - Before starting Vault, turn on the host firewall: allow SSH first, then allow 8200 only from your own addresses and 8201 only from the other Vault nodes. Write every rule for both IPv4 and IPv6.
- Start the service with
sudo systemctl enable vault.servicefollowed bysudo systemctl start vault.service, then check it withsudo systemctl status vault.service. - Point the CLI at the server:
export VAULT_CACERT=/opt/vault/tls/vault-ca.pemand setVAULT_ADDRto thehttps://name your certificate was issued for, port 8200. - Run
vault operator initonce, on one node only, and read the next section before you press Enter.
wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install vault
ui = true
cluster_addr = "https://<LOCAL_IPV4_ADDRESS>:8201"
api_addr = "https://<LOCAL_IPV4_ADDRESS>:8200"
disable_mlock = true
storage "raft" {
path = "/opt/vault/data"
node_id = "<UNIQUE_ID_FOR_THIS_HOST>"
}
listener "tcp" {
address = "0.0.0.0:8200"
tls_cert_file = "/opt/vault/tls/vault-cert.pem"
tls_key_file = "/opt/vault/tls/vault-key.pem"
}
Vault assumes TLS unless you switch it off with tls_disable. Do not: the listener carries tokens and secrets, and the minimum version already defaults to TLS 1.2. For more nodes, add a retry_join block per peer inside the storage "raft" stanza, with leader_api_addr set to that peer's https:// address on port 8200 and leader_ca_cert_file = "/opt/vault/tls/vault-ca.pem" so the join can verify the peer's certificate.
Init, unseal, and where the keys must never live
By default vault operator init prints five unseal key shares and a root token, and any three of the five shares rebuild the key that opens the data. Vault does not keep that key anywhere. Lose enough shares and the vault stays sealed for good, with no reset from the server side.
- Split the shares between people. One share per holder, never stored on the Vault server.
- Encrypt them at birth. The
-pgp-keysoption encrypts each share to a named holder's public PGP key, and-root-token-pgp-keydoes the same for the root token, so the plain values never sit in your terminal scrollback. - Expect to unseal after every restart. With the default Shamir seal each node starts sealed; run
vault operator unsealand enter shares until the threshold is met. Auto unseal hands this to a key service such as Transit or a cloud KMS instead. - Retire the root token. Use it to set up auth methods and policies, then revoke it, as the hardening guide advises. Rotating the shares later is
vault operator rekey, which needs a quorum of the current ones.
Running it well after day one
- Snapshots.
vault operator raft snapshot save raft.snapwrites the whole cluster state to one file. Copy it off the machine on a schedule; a snapshot stored on the node it protects is not a backup. - Restores overwrite. Before
vault operator raft snapshot restore, save a fresh snapshot of the current state and confirm that file exists. The command returns early and finishes in the background, so wait for the log lines saying post-unseal setup is complete and Vault is unsealed before sending traffic. - Audit log. Enable an audit device straight after init; the hardening guide lists it as a baseline step, and it is the record you will want if a token leaks.
- Firewall. Keep the install-step rules current as nodes and offices change.
- Upgrades and clocks. Upgrade regularly and keep time synchronised on every node; check peers with
vault operator raft list-peersafter each change.
The licence, and the OpenBao fork
On 10 August 2023 HashiCorp moved its products, Vault included, from the Mozilla Public License 2.0 to the Business Source License 1.1 for all future releases. HashiCorp's announcement says copying, modifying and redistributing stay allowed for commercial and non-commercial use; the restriction is on offering a product that competes with HashiCorp's own. Protecting your own company's secrets is not that; selling a hosted secrets service might be, so read HashiCorp's licensing FAQ first.
OpenBao is a community fork of Vault managed under the Linux Foundation's OpenSSF, and its repository is licensed MPL-2.0. It suits teams that want an OSI-approved licence; check its own documentation for feature differences rather than assuming parity.
When a whole server is the wrong answer
If you need Vault only to learn the commands, a small Cloud VPS costs less and resets just as easily; it shares a physical host with other customers, which is fine for a lab and the opposite of what the hardening guide asks for production. If you need the five-node, three-zone layout HashiCorp recommends, that is five servers, and you remain the operator: we keep the hardware and network running, while Vault, its keys and its upgrades are yours.
Questions people ask
- Can I run Vault on just one server?
- Yes. Integrated storage works with a single node, and many teams start that way. The cost is availability: while that machine reboots or fails, nothing can read secrets from it.
- Is the self-hosted edition of Vault free?
- The community edition is published under the Business Source License 1.1, which lets you use it commercially and non-commercially as long as you are not offering a product that competes with HashiCorp. Using it for your own infrastructure fits that. Features marked Enterprise in the docs, such as seal high availability and seal wrapping, need a paid licence.
- What happens if I lose the unseal keys?
- Vault does not store the key it uses to open the data, so without a threshold of shares (three of five by default) the vault stays sealed permanently. Spread the shares across people and places on the day you run init.
- Do I have to type unseal keys after every reboot?
- With the default Shamir seal, yes: every node starts sealed and needs a threshold of shares. Auto unseal moves that job to a key service such as Transit or a cloud KMS, so nodes open themselves at startup. If that key is ever deleted, the cluster cannot be recovered.
- Should I choose OpenBao instead?
- Choose OpenBao if an OSI-approved licence matters to your organisation or you want to build a product on it; it is a Vault fork run under the Linux Foundation's OpenSSF and licensed MPL-2.0. Choose Vault if you want HashiCorp's own releases.