The Simplest Way to Make Bitwarden and Longhorn Work Like They Should
Running bitwarden and longhorn together gives your Kubernetes cluster safe secret storage and reliable block volumes. Bitwarden holds your team keys, while Longhorn replicates the persistent disks that store your vault database. This setup helps teams host their own password manager on bare metal or cloud nodes. It keeps vault data online even when a worker node fails or reboots. How bitwarden and longhorn share data and roles Self-hosted Bitwarden needs a database and file storage to keep e
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Running bitwarden and longhorn together gives your Kubernetes cluster safe secret storage and reliable block volumes. Bitwarden holds your team keys, while Longhorn replicates the persistent disks that store your vault database.
This setup helps teams host their own password manager on bare metal or cloud nodes. It keeps vault data online even when a worker node fails or reboots.
How bitwarden and longhorn share data and roles
Self-hosted Bitwarden needs a database and file storage to keep encrypted vault items safe. Longhorn provides this storage by turning local node disks into replicated Kubernetes volumes.
When a Bitwarden pod starts, Kubernetes claims a persistent volume from the Longhorn storage driver. Longhorn writes every database change across multiple nodes at the same time.
The flow also works in the other direction for cluster secrets and backup keys. Longhorn needs keys to encrypt disks and send snapshots to remote object storage.
Teams store those master keys inside Bitwarden collections so operators can manage them in one place. A cluster secret operator fetches those keys from Bitwarden and writes them into Kubernetes secrets.
Longhorn then reads those Kubernetes secrets to manage volumes and sign backup requests. Each tool has a clear job in the cluster.
Common failure modes and how to scope roles
Many teams fail by using one shared account to fetch all cluster secrets from Bitwarden. If that broad token leaks, an attacker can read every key in the vault.
Instead, create a dedicated machine account scoped only to the Longhorn backup and encryption collection. Give that account read-only rights so it can never alter or delete vault items.
Another common mistake is leaving Longhorn volumes unencrypted on the host disk. Anyone with physical node access can read the raw Bitwarden database files from the drive.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Always turn on Longhorn volume encryption for the database claim and rotate the keys often. You must also watch out for circular boot dependencies during a full cluster outage.
If Bitwarden lives on a Longhorn disk, Longhorn cannot pull its own startup keys from that vault. Store the bootstrap encryption key for the Bitwarden volume in an external secret store.
Network paths between the secret sync pods, the Bitwarden API, and the storage nodes also need tight rules. Use Kubernetes network policies so only the secret controller can talk to the Bitwarden server.
Block regular app pods from reaching the Longhorn manager API or the storage replica ports. Log every secret read and every volume mount so your team can audit all cluster changes.
Keeping backups and recovery fast
Disk replication protects against a single node crash, but it is not a true backup. You still need off-site snapshots to recover from bad updates or storage bugs.
Set Longhorn to take daily snapshots of the Bitwarden database volume and push them to object storage. Test these backups every month by restoring the snapshot into a separate test namespace.
Before Longhorn takes a snapshot, pause database writes for a brief moment or run a clean dump. This step prevents corrupt tables when you restore the volume on a new cluster.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can I host Bitwarden directly on a Longhorn volume?
Yes, you can run the Bitwarden database on a persistent volume backed by Longhorn. Make sure you keep at least three replicas across separate worker nodes for high availability.
How do I avoid a lock-out during cluster recovery?
Do not store the encryption key for the Bitwarden volume inside the same Bitwarden instance. Keep that specific bootstrap key in a separate cloud vault or offline safe.
How should I back up the Bitwarden database on Longhorn?
Run a scheduled database dump job before Longhorn takes its volume snapshot. Send the encrypted snapshot to an external audit storage outside your main Kubernetes cluster.
Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.
Related guides
In this post