Hashicorp Vault - Initialize the Vault using the vault operator init command

by
Jeremy Canfield |
Updated: April 01 2024
| Hashicorp Vault articles
If you have not yet installed Hashicorp Vault, check out my article Install Hashicorp Vault on Docker.
The very first thing you do after installing Hashicorp Vault is to initialize the vault.
- Initialize the vault using the vault operator init command (this article)
- Initialize the vault using the vault UI
- Initialize the vault using Python hvac
Let's say you are running the Hashicorp Vault in a Docker container named hashicorp_vault.
~]$ sudo docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
01c8540eba06 vault:1.13.3 "docker-entrypoint.s…" 12 minutes ago Up 12 minutes 0.0.0.0:8200->8200/tcp, :::8200->8200/tcp hashicorp_vault
In this scenario, you would use the docker exec command to issue the vault operator init command in the hashicorp_vault container.
~]# sudo docker exec hashicorp_vault vault operator init
The vault status command should then have Initialized true.
~]# sudo docker exec hashicorp_vault vault status
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed true
Total Shares 5
Threshold 3
Unseal Progress 0/3
Unseal Nonce n/a
Version 1.8.1
Storage Type raft
HA Enabled true
Did you find this article helpful?
If so, consider buying me a coffee over at