Vaultwarden Backup and Restore: SQLite, Attachments and a Test Drill
On this page
Pinned version: Vaultwarden 1.37.5 (GitHub release). Last checked: 2026-11-10.
Vaultwarden's wiki says to back up regularly (preferably automated) and keep at least one copy off the machine. For the default SQLite setup, you must back up db.sqlite3 and the attachments directory; config.json and rsa_key* files are recommended. Avoid relying only on filesystem or VM snapshots.
If Vaultwarden is not installed yet, follow Vaultwarden with Docker + HTTPS. After a restore, common errors cover DOMAIN and volume mistakes.
What lives in /data
From the official Backing up your vault wiki page:
| Path | Required? | Notes |
|---|---|---|
db.sqlite3 (+ WAL handling) | Required | Almost all vault state |
attachments/ | Required | File attachments are not in the DB |
sends/ | Optional | Ephemeral Send files |
config.json | Recommended | Admin-page settings (may hold secrets in plaintext) |
rsa_key* | Recommended | JWT signing; losing them logs everyone out |
icon_cache/ | Optional | Can be refetched |
Encrypt backups that include config.json or rsa_key.pem if they leave your host (admin token, SMTP secrets, signing key).
Step 1 — Consistent SQLite backup (Docker)
Since Vaultwarden 1.32.1 the binary can back up SQLite itself. With Docker:
docker exec -it vaultwarden /vaultwarden backupThat uses SQLite's online backup API while the server runs. The wiki also shows host-side sqlite3 … ".backup '…'" if you install sqlite3 on the host; official images do not ship sqlite3 or cron inside the container, so schedule jobs on the host.
Copy the resulting db_*.sqlite3 (or your dated backup file) out of the data volume to another disk or object storage.
Step 2 — Copy attachments and recommended files
While the container can stay up for the DB backup command, also copy:
attachments/(required if you use file attachments)config.jsonandrsa_key*(recommended)- optionally
sends/
Example host-side rsync of everything except live SQLite sidecars, after a /vaultwarden backup:
rsync -a --exclude 'db.sqlite3-shm' ./vw-data/ /path/to/backups/vw-$(date +%Y%m%d)/Keep the dated db_*.sqlite3 from Step 1 with that tree. Tools the wiki mentions for offsite copies include rclone, restic and rustic.
Step 3 — Automate daily
Run Step 1 (and the file copy) from cron on the Docker host at least daily. The wiki's example of stopping Compose, zipping /opt/vw-data and scp-ing offsite is valid when you want a cold copy; the built-in /vaultwarden backup avoids downtime for the database portion.
Step 4 — Restore drill
- Stop Vaultwarden (
docker compose stop vaultwardenor equivalent). - Replace files under the data directory with the backup.
- If the DB backup came from
.backup,VACUUM INTO, or/vaultwarden backup, **delete any existingdb.sqlite3-wal** before start — a stale WAL can corrupt the restored DB. Rename your backup file todb.sqlite3. - If you instead copied
db.sqlite3+ matchingdb.sqlite3-walas a pair while the DB was idle, restore both together. You do not needdb.sqlite3-shm. - Start Vaultwarden and log in with a test client.
The wiki recommends practising restore periodically and keeping the previous data directory aside until the drill succeeds.
Restore on a new server
To restore Vaultwarden on a new server, stop the container, put your backed-up db.sqlite3, attachments/, rsa_key* files and config.json into the new /data folder, delete any stale db.sqlite3-wal, and start the same image tag you backed up from. Then check that DOMAIN still matches the URL your apps use. The Vaultwarden wiki covers what to back up; this page is the restore side. For making the backups, see Vaultwarden backup.
Quick answer
- Install Docker on the new server and pin the old tag, for example
vaultwarden/server:1.37.5. Don't start it yet.- Copy the backup into the new data folder: the database (renamed to
db.sqlite3),attachments/,rsa_key*,config.jsonand optionallysends/.- Delete any
db.sqlite3-walif your database backup came from/vaultwarden backup,.backuporVACUUM INTO.- Start the container with the same
DOMAINand reverse proxy setup, then log in and check items and attachments.- Update to the latest release only after the restore works.
What each file does on restore
From the wiki's Backing up your vault page:
| File or folder | If you restore it | If it's missing |
|---|---|---|
db.sqlite3 | Users, items, organizations, 2FA settings come back | Nothing to restore; this is the vault |
attachments/ | File attachments open again | Attachments are not in the database, so they're gone |
rsa_key* | Logged-in apps stay logged in | Every user is logged out and must log in again; open email invitations stop working |
config.json | Admin-page settings come back | You re-enter settings; environment variables apply instead |
sends/ | Existing file Sends keep working | Only Send files are lost; Send text lives in the database |
icon_cache/ | Not needed | Icons are fetched again |
Step 1: the database and the WAL file
The wiki's restore rule is short and important:
- If your database backup came from
/vaultwarden backup, SQLite's.backuporVACUUM INTO, **delete any existingdb.sqlite3-wal** before you start. A stale or mismatched WAL file "could potentially result in database corruption". - If you backed up by copying
db.sqlite3together with its matchingdb.sqlite3-wal, restore both files as a pair. - You never need
db.sqlite3-shm.
On a brand-new server there's usually no old WAL file, but check anyway: if you started the container once to test it, it may have created an empty database and a WAL next to it. Stop the container and replace them.
Before you start, you can check the file with SQLite's own integrity check on the host: sqlite3 db.sqlite3 "PRAGMA integrity_check" should print ok (SQLite docs). The official Docker image doesn't include sqlite3, so run this on the host.
Step 2: match the version
Start the new server on the same image tag you ran when you made the backup, for example vaultwarden/server:1.37.5 instead of latest. Once it works, update the normal way described in the wiki's Updating the vaultwarden image page: pull the new image and recreate the container with the same data folder.
Don't restore a database from a newer Vaultwarden onto an older image. The wiki doesn't document running an older release on a newer database, so treat it as unsupported. See Vaultwarden release notes for what changed between 1.37.x releases.
Step 3: DOMAIN, config.json and HTTPS
- DOMAIN: set it to the same base URL as before, such as
https://vault.example.com. The wiki warns that without the rightDOMAIN, "some functionality might break mysteriously" (Configuration overview). - config.json wins. Settings in a restored
config.jsonoverride environment variables, and Vaultwarden warns at startup which settings were overwritten. If you changed your domain or SMTP on the new server, edit them in the admin page or they'll stay at the old values. - HTTPS: the web vault needs a secure context, so put the new server behind the same kind of reverse proxy. See Vaultwarden with Docker and HTTPS.
- DNS: point the domain at the new server's IP once the restore checks pass.
Step 4: check it worked
- Log in with a test account, or your own, and compare the item count with what you expect.
- Open one item with an attachment.
- Check an organization collection if you use them.
- Log in from a phone app. If you restored
rsa_key*, existing sessions should keep working. - Keep the old server's data folder untouched until you're sure. The wiki recommends keeping a copy of the original data whenever you practice a restore.
If logins fail with "failed to fetch" or a 502, see Vaultwarden errors.
Keep these steps where you'll find them during an outage: add Vaultwarden to Lab Lifeboat, our free offline restore planner, or print the Vaultwarden restore checklist.
FAQ
Is copying the whole Docker volume enough?
Only if Vaultwarden is stopped (or you accept crash-consistent risk). For a live SQLite file, use /vaultwarden backup or sqlite3 .backup so pages are consistent.
Do I need the icon cache?
No. It is optional; icons can be fetched again.
Does this replace Bitwarden.org cloud export?
This backs up your self-hosted Vaultwarden data directory. Client-side encrypted exports are a separate Bitwarden client feature and are not a substitute for server attachments/ and SQLite.
How do I restore Vaultwarden from a backup?
Stop Vaultwarden, replace the files in the data folder with your backup (db.sqlite3, attachments/, rsa_key*, config.json), delete any stale db.sqlite3-wal if the database came from /vaultwarden backup, .backup or VACUUM INTO, then start the same image tag you backed up from.
Should I delete db.sqlite3-wal when restoring Vaultwarden?
Yes, if your backup came from /vaultwarden backup, .backup or VACUUM INTO. The wiki warns a stale WAL file could corrupt the restored database. If you copied db.sqlite3 and its matching WAL file together, restore them as a pair.
Sources
- https://github.com/dani-garcia/vaultwarden/wiki/Configuration-overview (checked 2026-11-11)
- https://github.com/dani-garcia/vaultwarden/wiki/Updating-the-vaultwarden-image (checked 2026-11-11)
- https://www.sqlite.org/pragma.html#pragma_integrity_check
- Vaultwarden wiki, Backing up your vault: https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault (checked 2026-11-10)
- Vaultwarden 1.37.5: https://github.com/dani-garcia/vaultwarden/releases/tag/1.37.5 (checked 2026-11-10)
Printable restore checklist: Vaultwarden restore checklist. One page with what to back up, the restore steps, gotchas and how to check it worked. Or build a full recovery pack for your lab.

