Synology Bitwarden

Posted on  by 



In the last post, I wrote about installing bitwarden_rs per Docker on Synology and how to activate live sync. Now I’ll show you how to backup the data. I’ll use bruceforce/bw_backup docker to dump the sqlite database automatically, since just copying the sqlite3 file is not really backing up the database. I also found out, that the created dump file won’t be automatically uploaded to cloud by the Cloud Sync. Some how Cloud Sync doesn’t notice that there’s a new file.

How to self host bitwarden

Bitwarden, the open source password manager, makes it easy to generate and store unique passwords for any browser or device. Create your free account on the platform with end-to-end encryption and flexible integration options for you or your business. Did you add a firewall rule in the Syno Firewall? If oyu respond to both with yes as well, then there should be no reason that bitwarden is not accessible. Though, the original bitwarden is realy a waste of ressources. While the original is more like a bolder, mprasil/bitwarden is more like a feather. The installation is easier as well. Synology NAS provides a build-in functionality to configure your domain like fisenko.net even you don't have a static IP address. You just need to open: Control Panel, External Access, and click on Add in DDNS section. It is working fine on Synology both docker containers which I tested: BitwardenRS standard or mysql edition (with mariaDB on Synology). See bellow the screen capture on my settings for reverse proxy and websocket active. Port 32772 is port of docker container.

Setting up backup container

In the Docker app, let’s search for bruceforce/bw_backup container. Just search for bw_backup.

Synology Password Vault

After downloading the image, we’ll just run it. During the initialisation, we need to adjust some settings.

In the volume tab, we mount the bitwarden folder, in which the bitwarden files are stored. My Bitwarden data are saved in docker/bitwardenrs. This folder must be mount as /data.

In the environment tab, we need to adjust the UID and GID. I set them to 0 (root).
Crontime can be set to how often the Bitwarden data should be backed up. If you don’t familiar with crontab format, you can use crontab.guru to check the time.

A useful parameter is DELETE_AFTER. I set this parameter to 7, so older than 7 backup files will be removed automatically. The complete documentation on the image can be found on the Github page.

Backup to cloud storage

Bitwarden

When the backup script in the container is finished, you’ll find the dump file in the db_backup folder. Adding this folder to a Cloud Sync task to automatically upload the file to a cloud provider (Google Drive, Dropbox, etc.) won’t work. Somehow Cloud Sync ignores the files.

The only way to upload the files to a cloud storage per Cloud Sync is to manually copy them. After manual copying the files, Cloud Sync notices the files and sync these with cloud storage. To automate the copying process, we set a “User-defined script” task in Task Scheduler to copy the files.

Password

Synology Bitwarden Admin

As script/command I just simply run a rsync to sync the bitwarden folder to a cloud storage folder in Synology.