# Self-host OpenBao

> OpenBao, the open source secrets manager forked from Vault, with integrated Raft storage. It is reachable only from services in this project at openbao:8200 over plain HTTP and is not published on the host.

- Page: https://levelrail.com/templates/openbao/
- JSON: https://levelrail.com/templates/openbao.json
- Category: Security
- Licence: MPL-2.0 (Copyleft license)
- Source: https://github.com/openbao/openbao
- Upstream docs: https://openbao.org/docs/

## Requirements
- Memory: about 256 MiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 2.7.2

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| openbao | ghcr.io/openbao/openbao | 2.7.2 | 8200 | openbao_data -> /openbao/file |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| openbao | BAO_ADDR | preset |
| openbao | BAO_LOCAL_CONFIG | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy openbao --name my-openbao
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/openbao/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## First run
1. OpenBao starts uninitialized and sealed. Open the app console and run bao operator init, then bao operator unseal with the printed keys. Keep the unseal keys and root token offline.
2. Plain HTTP is for the internal network only. Attach a domain with HTTPS before anything outside this project talks to it.

## Questions

### Can I deploy OpenBao on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id openbao for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image ghcr.io/openbao/openbao:2.7.2 is what you deploy there.

Self-host OpenBao, OpenBao docker compose file, deploy OpenBao on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
