Important
WAL is an SQLite-specific setting. It is not applicable to MySQL or PostgreSQL; if you are using one of these backends, the
ENABLE_DB_WAL
config option has no effect.
By default during the startup vaultwarden
will try to enable WAL for the DB. Adding this improves performance and in the past helped preventing failed requests under some circumstances.
Reasons to turn WAL off
Generally speaking, unless you're absolutely sure that you need to turn WAL off, you should leave it enabled. However, there might be some valid cases to turn it off. For example:
- Some filesystems don't support WAL - this is especially true for network filesystems. If you're using such filesystem, the service will fail to start with
Failed to turn on WAL
error message. - The database requires sqlite version
3.7.0
or newer, so if you for any reason (for example backups) require to access the DB directly with some other tool that cannot be updated, you might need to disable WAL. - One of the disadvantages described here affects you
How to turn WAL off
0. Make backup
These changes are generally safe and can be done without data loss, however backing up your data prior to any changes is strongly advised.
1. Disable WAL on old DB
If you have old DB, that was used with WAL enabled, you need to disable it using sqlite:
- Stop
vaultwarden
- Locate your data folder. Normally there will be
db.sqlite3
file there unless you specified some other name to use. - Open the file using sqlite:
sqlite3 db.sqlite3
- Disable WAL by typing
PRAGMA journal_mode=delete;
and pressing enter:
sqlite> PRAGMA journal_mode=delete;
delete
- Quit sqlite utility by typing
.quit
and pressing enter. (notice the dot at the beginning)
2. Disable WAL in vaultwarden
To turn WAL off, you need to start vaultwarden
with ENABLE_DB_WAL
variable set to false
:
docker run -d --name vaultwarden \
-e ENABLE_DB_WAL=false \
-v /vw-data/:/data/ \
-p 80:80 \
vaultwarden/server:latest
Make sure to always start with this variable present as starting even once without it will enable WAL again. (if that happens start at the first step to disable it again)
How to turn WAL on
Generally speaking you just start vaultwarden
without ENABLE_DB_WAL
set to false and server will automatically enable WAL for you. You can verify this by running:
sqlite3 db.sqlite3 'PRAGMA journal_mode'
Where db.sqlite3
is the DB file used by vaultwarden
. It should return back the mode that is currently used, so in our case it's wal
. Disabled WAL will typically report back delete
as this is the default.
FAQs
Troubleshooting
Container Image Usage
- Which container image to use
- Starting a container
- Using Docker Compose
- Using Podman
- Updating the vaultwarden image
Reverse Proxy
HTTPS
Configuration
- Overview
- Enabling admin page
- SMTP configuration
- Disable registration of new users
- Disable invitations
- Enabling WebSocket notifications
- Enabling Mobile Client push notification
- Other configuration
Database
- Using the MariaDB (MySQL) Backend
- Using the PostgreSQL Backend
- Running without WAL enabled
- Migrating from MariaDB (MySQL) to SQLite
Security
- Hardening Guide
- Password hint display
- Enabling U2F and FIDO2 WebAuthn authentication
- Enabling YubiKey OTP authentication
- Fail2Ban Setup
- Fail2Ban + ModSecurity + Traefik + Docker
Performance
Customization
- Translating the email templates
- Translating admin page
- Customize Vaultwarden CSS
- Disabling or overriding the Vault interface hosting
Backup
Development
- Building binary
- Building your own docker image
- Git hooks
- Differences from the upstream API implementation
Alternative deployments
- Pre-built binaries
- Creating a systemd service
- Third-party packages
- Deployment examples
- Disable the admin token