This is just a fork from jmqm/vaultwarden_backup with some personal changes
Backs up vaultwarden files and directories to tar.xz
archives automatically. tar.xz
archives can be opened using data compression programs like 7-Zip and WinRAR.
Files and directories that are backed up:
- db.sqlite3
- config.json
- rsa_key.der
- rsa_key.pem
- rsa_key.pub.der
- /attachments
- /sends
Refer to the docker-compose
section below. By default, backing up is automatic.
Pass manual
to docker run
or docker-compose
as a command
.
- Stop the application
- Go to the data directory of your application ex.
cd /vaultwarden/data
(if that is my data folder) - Delete the db.sqlite3-wal
rm db.sqlite3-wal
(you dont need it since the backup was created using.backup
) - Just extract
tar -xJvf <backup-file.tar.xz> -C /vaultwarden/data
- Run the application
You can read more in the oficial wiki
services:
# vaultwarden configuration here if you want share the docker-compose file
backup:
image: ghcr.io/fabricionaweb/vaultwarden_backup
network_mode: none
# user: "1000:1000" # PUID:PGID (change if necessary)
environment:
- TZ=Europe/London # Timezone inside container
- CRON_TIME=0 */24 * * * # Runs at every day 00:00
- DELETE_AFTER=30 # Days to delete
volumes:
- /vaultwarden_data_directory:/data:ro # The Vaultwarden data directory to backup
- /backup_directory:/backups # Directory to save the backups
/data
(read) - Vaultwarden's/data
directory. Recommend setting mount as read-only./backups
(write) - Where to store backups to.
Environment Variable | Info |
---|---|
CRON_TIME | When to run (default is every 12 hours). Info here and editor here. |
DELETE_AFTER | Delete backups X days old. Requires read and write permissions. |