On this page
- What is OpenBao and when does it fit?
- How do you install the OpenBao package?
- How do you write the server configuration?
- How do you initialise and unseal OpenBao?
- How do you give an application its secrets?
- How do you publish OpenBao over HTTPS?
- How do you back up and upgrade OpenBao?
- How do you fix common OpenBao errors?
- Questions
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 baoThe 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-pagerThe 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-idThe 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/apiTurn 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; echoRestrict 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 versionRead 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) ormetadata/(for listing) in the path. - Client errors with "http: server gave HTTP response to HTTPS client":
BAO_ADDRuses https against the plain loopback listener; usehttp://127.0.0.1:8200locally and the https name remotely. - Service will not start after an upgrade: run
bao server -config=/etc/openbao/openbao.hclby 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.
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.
More in Self-hosted apps
- Nextcloud on Nginx
- ownCloud Infinite Scale
- Seafile file sync
- Vaultwarden password vault
- Passbolt team password manager
- Gitea Git hosting
- Forgejo Git server
- GitLab Community Edition
- Gogs Git service
- Wiki.js
- BookStack documentation
- Outline knowledge base
- Paperless-ngx documents
- n8n workflow automation
- Activepieces automation
- Plausible Analytics (Community Edition)
- Umami analytics
- Mattermost team chat
- Matrix Synapse with Element
- Jitsi Meet video calls
- ONLYOFFICE Docs with Nextcloud
- HashiCorp Vault secrets server
- Infisical secrets manager
- Authelia SSO and forward auth
- Zitadel identity platform
- VS Code in the browser (code-server)
- Joplin Server for notes sync
- Firefly III personal finance
- Snipe-IT asset tracking
- Odoo ERP on Ubuntu or Debian
- ERPNext with frappe_docker
- Dolibarr ERP and CRM with Nginx
- Penpot design tool with Docker
- Planka kanban boards
- Leantime project management
- Wekan boards with Docker
- Cal.com scheduling
- Chatwoot support inbox
- Mautic marketing automation
- DocuSeal document signing
- Metabase dashboards
- Appwrite backend server
- Self-hosted Supabase
- PocketBase backend
- RustDesk relay server
- Traccar GPS tracking
- Redmine project tracker
- The Lounge IRC client
- CyberChef data toolbox
- Typebot chat forms
- AFFiNE workspace
- Overleaf Community Edition
- Neko shared virtual browser
- imgproxy image resizing
- NetBox network inventory
- UVdesk help desk
- YetiForce CRM