Self hosting Bitwarden -- suggestions on how to preserve database backups

I’m self hosting bitwarden via the vaultwarden_rs implementation. For trial installations I have vaultwarden setup using the mysql.lite flat file, and have heavier implementations that run either a mariadb or postgresql backend. Although I’m using bitwarden_rs (vaultwarden_rs), I believe the official image uses a formal database backend as well.

I’m wondering what method is the best for backing up the database. I’m running my implementation within either an Arch Linux or UbuntuVM with the host using either ext3 or ext4. Vaultwarden runs via docker with bind mounted directories shared with a docker implemented database – either mariadb or postgresql. I have a backup target of TrueNAS core (which utilizes zfs). I’m a home user with a few users so I’m not thinking the amount of data I have to back up is going to be excessive. Schemes I’ve thought about

  1. Periodic dumping of the database (mysqldump or equivalent). Dumps could either be transferred periodically to NAS or I could mount a nfs share within the VM and share the backup this way. I would just need method or manner to periodically thin the backups. I guess this would fall under data retention. Solution is redundant since a lot of the data is unlikely to change in between the dumps. I suppose a solution like Borg backup could be used that could keep encrypted delta backup according to a retention policy.
  2. Setup some high availability setup where the database could sync across multiple mirrors. This is more a high availability design and not strictly a backup since a corruption on the master node is going to propagate across the mirrors. This is pretty easy to setup although I’m sure this HA solution really doesn’t qualify as a true backup solution
  3. Implement some block backup solution rather than file type backup solution. I’m not exactly sure how this would work.
  4. Use XO or hypervisor to actually just snapshot or delta snapshot the running Bitwarden VM and database and use these snapshots as the backup. A lot more data (unnecessary data) being backed up in the process however very well established programs provide for this capability.

Thanks for any opinion on the matter.

I only use the office Bitwarden which has a database auto backup feature.


Do you know anything about the backups? I believe the full implementation runs a mysql type database? Is this just a timed dump of the entire database or do they offer something more full featured?

It’s in their documentation