Skip to content

beasthouse-au/vaultwarden_backup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

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

Usage

Automatic Backups

Refer to the docker-compose section below. By default, backing up is automatic.

Manual Backups

Pass manual to docker run or docker-compose as a command.

How to restore

  1. Stop the application
  2. Go to the data directory of your application ex. cd /vaultwarden/data (if that is my data folder)
  3. Delete the db.sqlite3-wal rm db.sqlite3-wal (you dont need it since the backup was created using .backup)
  4. Just extract tar -xJvf <backup-file.tar.xz> -C /vaultwarden/data
  5. Run the application

You can read more in the oficial wiki

docker-compose

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

Volumes (permissions required)

  • /data (read) - Vaultwarden's /data directory. Recommend setting mount as read-only.
  • /backups (write) - Where to store backups to.

Environment Variables

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.

About

Backups vaultwarden database (in the proper way) and files automatically

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 88.4%
  • Dockerfile 11.6%