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.
Today we are going to look at how to self-host bitwarden on a Synology NAS! Bitwarden is a password manager that can be self-hosted if desired. The benefit of self-hosting is that you are in control of your data and don’t need to rely on a third party to manage it. Docker top 10 bitwarden rocket chat grafana portainer ghost blog commento ttrss radarr sonarr tautuli self host synology nas.
Setting up backup container
Where: SMTPUSERNAME and SMTPFROM it is my gmail SMTPPASSWORD this is not the password for my gmail account, but the password generated on my gmail for bitwarden, please use the link below. BitWarden - On-prem - Docker - Synology NAS - SMTP Variables Greetings, Can you someone please help modify the following docker compose file to include SMTP environment variables please.
In the Docker app, let’s search for bruceforce/bw_backup
container. Just search for bw_backup
.
After downloading the image, we’ll just run it. During the initialisation, we need to adjust some settings.
In order to access the Bitwarden Admin site on the Synology you will need to perform the following: Modify the bitwarden-admin container Stop the container.
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
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.
As script/command I just simply run a rsync
to sync the bitwarden folder to a cloud storage folder in Synology.
Ie. External HTTPS reverse proxies to -> External Docker HTTP -> Internal Docker HTTP.We use the same Internal ports and the External reverse proxy ports.
Ports used:
Synology Bitwarden Docker Ssl
- HTTPS
- HTTP
- WSS (WebSocket)
- WS
Note: currently websockets are not working.
Create Folders
Install Bitwarden Docker Synology
/docker/bitwarden/bitwarden
Bitwarden Docker Synology Download
Install Server
Apps > Docker > Registry > Search > bitwardenrs/server
Install Bitwarden On Docker
Create HTTPS Reverse proxy
Control Panel -> Application Portal -> Reverse Proxy -> Create
Bitwarden HTTPS
Bitwarden WebSocket HTTPS
Install Bitwarden browser plugin
- Settings
- API URL =
https://<ip address>:<HTTPS>
- API URL =
TODO
- Get websockets workinghttps://github.com/dani-garcia/bitwarden_rs/wiki/Enabling-WebSocket-notifications