Log inSign up

OpenBao: open source secrets storage on your own server

Download the current bao Debian package from the OpenBao releases page, install it with apt, put a Raft storage and loopback listener config into /etc/openbao/openbao.hcl, and start the openbao service. Run bao operator init, unseal with three keys, enable a KV engine and an AppRole login for your applications, and expose the UI only through Nginx or Caddy with HTTPS.

Topic: Self-hosted apps · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

What is OpenBao and when does it fit?

OpenBao is a community fork of Vault, maintained under the Linux Foundation and licensed under the Mozilla Public License 2.0. It keeps the familiar model: secrets are encrypted with a key that only exists in memory after the server is unsealed, every access is checked against policies, and clients talk to a JSON API.

It fits well when you want central storage for database passwords, API keys and certificates for several services, with an audit trail, and you prefer a project with an open source licence. Commands use the bao binary and the BAO_ADDR variable, but the subcommands match what you may know from the Vault guide, so scripts usually port with a rename.

Prepare a fresh Ubuntu 24.04 or Debian 12/13 server, a sudo user with key login (see SSH keys and hardening) and a name like bao.example.net pointing at 198.51.100.24.

How do you install the OpenBao package?

OpenBao publishes signed .deb packages for each release on its GitHub releases page. Look up the latest tag, download the matching file for your CPU and install it with apt so dependencies and the service user are handled.

curl -s https://api.github.com/repos/openbao/openbao/releases/latest | grep tag_name
VER=2.4.4        # set to the tag shown above, without the leading v
ARCH=$(dpkg --print-architecture)
cd /tmp
wget https://github.com/openbao/openbao/releases/download/v${VER}/bao_${VER}_linux_${ARCH}.deb
sudo apt install -y ./bao_${VER}_linux_${ARCH}.deb
bao version
systemctl list-unit-files | grep -i bao

The release page also lists checksums; compare them with sha256sum before installing. The last command shows the systemd unit the package added, normally openbao.service, together with a config folder under /etc/openbao and a data folder under /opt/openbao.

How do you write the server configuration?

A single node needs three things: Raft storage on local disk, a listener on loopback and the public address it should advertise. Overwrite the sample config:

sudo tee /etc/openbao/openbao.hcl >/dev/null <<'EOF'
ui = true
disable_mlock = true

storage "raft" {
  path    = "/opt/openbao/data"
  node_id = "bao-1"
}

listener "tcp" {
  address     = "127.0.0.1:8200"
  tls_disable = true
}

api_addr     = "https://bao.example.net"
cluster_addr = "http://127.0.0.1:8201"
EOF
sudo mkdir -p /opt/openbao/data
sudo chown -R openbao:openbao /opt/openbao /etc/openbao
sudo systemctl enable --now openbao
sudo journalctl -u openbao -n 20 --no-pager

The journal should end with a line saying the server started and is sealed. If it complains about the user, check the account the unit runs as with systemctl cat openbao and match the ownership to it.

How do you initialise and unseal OpenBao?

Initialisation creates the root key, splits it into shares and returns a root token. You do it once per cluster.

export BAO_ADDR=http://127.0.0.1:8200
bao status
bao operator init -key-shares=5 -key-threshold=3
bao operator unseal
bao operator unseal
bao operator unseal
bao status | grep -E 'Sealed|Version'

Each unseal prompts for a different share. Write the five shares and the root token down at once and spread them across people or safe locations: the server never prints them again, and the data is unreadable without enough shares. Every restart (package upgrade, reboot, crash) returns the server to the sealed state, so decide in advance who holds shares and how they will reach the server. Recent releases also offer auto-unseal options; read the seal section of the project documentation before relying on one, because the key that unseals then lives somewhere else.

How do you give an application its secrets?

Store values in a KV version 2 engine and let each service log in with AppRole, which issues short-lived tokens scoped by policy.

bao login                       # root token, only for setup
bao secrets enable -path=kv kv-v2
bao kv put kv/billing/api key='Example-Key-Value'
bao policy write billing - <<'EOF'
path "kv/data/billing/*" { capabilities = ["read"] }
EOF
bao auth enable approle
bao write auth/approle/role/billing token_policies=billing token_ttl=1h token_max_ttl=4h
bao read auth/approle/role/billing/role-id
bao write -f auth/approle/role/billing/secret-id

The application logs in with the role ID and secret ID, receives a token valid for one hour and reads kv/billing/api. Test the flow yourself:

bao write auth/approle/login role_id=ROLE_ID secret_id=SECRET_ID
BAO_TOKEN=s.example bao kv get kv/billing/api

Turn on the audit log with sudo mkdir -p /var/log/openbao && sudo chown openbao /var/log/openbao followed by bao audit enable file file_path=/var/log/openbao/audit.log, and rotate it with logrotate.

How do you publish OpenBao over HTTPS?

Keep the listener on loopback and terminate TLS in a reverse proxy. With Caddy the whole site file is short:

bao.example.net {
    reverse_proxy 127.0.0.1:8200
}

Caddy fetches and renews the certificate itself; the install steps are in Caddy HTTPS. With Nginx, use a plain proxy_pass http://127.0.0.1:8200; location plus proxy_set_header Host $host; and run Certbot as in the Certbot guide. Then open only the web ports:

sudo ufw allow OpenSSH
sudo ufw allow 80,443/tcp
sudo ufw enable
curl -s https://bao.example.net/v1/sys/health; echo

Restrict the UI further if only your office needs it, for example with an allow 203.0.113.0/24; deny all; pair in Nginx, while applications keep reaching the API.

How do you back up and upgrade OpenBao?

Save Raft snapshots regularly and upgrade by installing the next release package over the old one.

bao operator raft snapshot save /root/bao-$(date +%F).snap
VER=2.4.5   # next release
wget https://github.com/openbao/openbao/releases/download/v${VER}/bao_${VER}_linux_amd64.deb
sudo apt install -y ./bao_${VER}_linux_amd64.deb
sudo systemctl restart openbao
bao operator unseal   # repeat until unsealed
bao version

Read the changelog for each release you skip over, since deprecated options can stop the service from starting. Copy snapshots to another machine; the optional daily backups add-on covers the whole disk as a second layer.

How do you fix common OpenBao errors?

  • "server is not yet initialized": run bao operator init; a fresh data folder always starts here.
  • "permission denied" on a KV path: KV version 2 policies must include data/ (for reads) or metadata/ (for listing) in the path.
  • Client errors with "http: server gave HTTP response to HTTPS client": BAO_ADDR uses https against the plain loopback listener; use http://127.0.0.1:8200 locally and the https name remotely.
  • Service will not start after an upgrade: run bao server -config=/etc/openbao/openbao.hcl by hand as the service user to see the config error directly.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A1-2single OpenBao node1 vCPU, 2 GB RAM, 50 GB NVMe$7.20/mo$43.20 for 6 months
A2-4many leases plus audit logging2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months

Questions about OpenBao secrets management

Is OpenBao compatible with Vault clients?

The API paths are largely the same, so many Vault client libraries work by pointing them at the OpenBao address. Check features added to either project after the fork before depending on them.

Can I migrate from Vault to OpenBao?

The project documents a migration path for storage from compatible Vault versions. Test it on a copy of a snapshot first and keep the original server until the new one has run for a while.

How much memory does OpenBao need?

Very little for a small team: a 1 or 2 GB plan runs a single node comfortably. Memory use grows with the number of leases and tokens, not with the number of stored values.

Does OpenBao send email notifications?

No. It has no mail feature. Send alerts from your monitoring system instead, through an authenticated relay on port 587, as covered in the SMTP relay guide.

Should the server have swap?

Keep swap off or small on a secrets server. Decrypted values live in memory while unsealed, and swap would let the kernel write them to disk.