Skip to main content
In this hands-on tutorial, you’ll set up a single HashiCorp Vault node on an AWS EC2 instance using integrated Raft storage, AWS KMS auto-unseal, and a basic TCP listener. We assume you’ve already provisioned your EC2 instance (e.g., via Packer) and dropped the Vault binary and example configs into /tmp.

Table of Contents

  1. Install the Vault Binary
  2. Create a Vault System User and Directories
  3. Define the Systemd Service
  4. Vault Configuration (vault.hcl)
  5. Start and Verify Vault
  6. References

1. Install the Vault Binary

SSH into your EC2 instance and place the Vault executable in your PATH.
Ensure that /usr/local/bin is in your $PATH so you can run vault without providing the full path.

2. Create a Vault System User and Directories

Run Vault under a non-root user and prepare the configuration and data directories.

3. Define the Systemd Service

Create the Systemd unit at /etc/systemd/system/vault.service:
Reload and enable the Vault service:

4. Vault Configuration (vault.hcl)

Below is an example of /etc/vault.d/vault.hcl using Raft storage, AWS KMS auto-unseal, and a non-TLS TCP listener for demonstration:
For a production setup, always enable TLS by adding tls_cert_file and tls_key_file under the listener block.

5. Start and Verify Vault

Launch Vault and confirm its status:
Expected output:
View runtime logs to troubleshoot:
You should see AWS KMS auto-unseal messages if IAM and KMS permissions are correct:

6. References

Watch Video

Practice Lab