Skip to main content
In this guide, you’ll learn how to configure HashiCorp Vault for reliable, long-term operation—whether you’re running a single-node server or a multi-node cluster. Vault servers load their settings from a configuration file written in HCL or JSON. This file defines:
  • Storage backend (Consul, S3, DynamoDB, Integrated Storage)
  • Listener settings (API and cluster addresses, ports, TLS)
  • Seal mechanism (AWS KMS, Azure KMS, Transit)
  • Cluster parameters (cluster name, UI, API address, log level)
  • Optional stanzas (telemetry, audit devices, etc.)

Running Vault with a Config File

To start Vault using your configuration file:
In production environments, manage Vault with a service manager like systemd or Windows Service Manager to ensure automatic startup and proper log handling.

Key Configuration Components

Configuration Structure

A Vault configuration file comprises multiple named stanzas and top-level parameters. Here’s the skeleton in HCL:
  • listener: Defines the API port, cluster port, and TLS options.
  • storage: Configures where Vault persists its data.
  • seal: Sets up the auto-unseal provider (e.g., KMS).
  • telemetry: Controls metrics export.
Top-level parameters include:
  • api_addr
  • cluster_addr
  • ui
  • cluster_name
  • log_level

Basic Stanza Examples

  • listener: Binds Vault to all interfaces on ports 8200 (API) and 8201 (cluster).
  • seal: Configures AWS KMS for automatic unseal.
Disabling TLS (tls_disable = true) is insecure. Always enable TLS (tls_disable = false) in production and provide valid certificates.

Production-Ready Configuration Example

Use this HCL template as a starting point for a highly available, production-grade Vault cluster:
  • storage.consul: Persists Vault data to a local Consul agent.
  • tls_disable = false: Enforces TLS; certificates must be valid.
  • seal.awskms.endpoint: Uses a VPC endpoint for secure AWS KMS access.

Vault Contents vs. Config File

The Vault configuration file does not manage:
  • Secrets Engines
  • Auth Methods
  • Audit Devices (beyond file/device declaration)
  • Vault Policies, Entities, and Groups
These resources are created inside Vault after initialization and unseal, using the CLI or API.

Summary of Stanzas

*Vault can run without an auto-unseal seal stanza, but manual unseal is required at each startup.

Watch Video

Practice Lab