-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Running without WAL enabled
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.
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
These changes are generally safe and can be done without data loss, however backing up your data prior to any changes is strongly advised.
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)
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)
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.
- Which container image to use
- Starting a container
- Updating the vaultwarden image
- Using Docker Compose
- Using Podman
- Building your own docker image
- Building binary
- Pre-built binaries
- Third-party packages
- Deployment examples
- Proxy examples
- Logrotate example
- Overview
- Disable registration of new users
- Disable invitations
- Enabling admin page
- Disable the admin token
- Enabling WebSocket notifications
- Enabling Mobile Client push notification
- Enabling U2F and FIDO2 WebAuthn authentication
- Enabling YubiKey OTP authentication
- Changing persistent data location
- Changing the API request size limit
- Changing the number of workers
- SMTP configuration
- Translating the email templates
- Password hint display
- Disabling or overriding the Vault interface hosting
- Logging
- Creating a systemd service
- Syncing users from LDAP
- Using an alternate base dir (subdir/subpath)
- Other configuration