Self-Hosting Vaultwarden Without Trusting the Defaults
Vaultwarden gives you a Bitwarden-compatible password server in one container and about ten minutes. The defaults that make that possible leave org creation open, audit logging off, accounts on PBKDF2, and a rate limiter that trusts a header anyone can set.
Somebody with your email address and your reused password is trying it against forty sites right now. That is not a scare story, it is the business model of every infostealer log ever sold. A password manager is the only practical answer, and running your own means the vault ciphertext lives on hardware you can put your hands on.
It also means you are now the one who gets paged. Here is the whole server:
# /opt/vaultwarden/docker-compose.yml
services:
vaultwarden:
image: vaultwarden/server:1.37.5
container_name: vaultwarden
restart: unless-stopped
environment:
DOMAIN: "https://vault.example.com"
SIGNUPS_ALLOWED: "false"
INVITATIONS_ALLOWED: "true"
ADMIN_TOKEN: '$$argon2id$$v=19$$m=65540,t=3,p=4$$SALT$$HASH'
volumes:
- ./data:/data
ports:
- "127.0.0.1:8080:80"
That's it. One container, one volume, four environment variables. It'll work.
This is week one of Self Hosting Saturday, and Vaultwarden is the right place to start, because it is the service people most reliably set up once and then stop thinking about for a year. It is also the one holding every other credential you own. Everything below is checked against the source at tag 1.37.5, AGPL-3.0, released 1 November 2026 — not against what the settings sound like they do.
What You Are Actually Installing
Vaultwarden is not Bitwarden. It is an independent server written in Rust, started by Daniel García (dani-garcia), with Mathijs van Veluw (BlackDex) cutting a good share of recent releases, and it implements Bitwarden's client API. The official Bitwarden clients — browser extension, desktop, iOS, Android, CLI — talk to it without modification or patching. They don't know the difference.
What you gain is footprint, though less than the usual comparison claims. Bitwarden's standard self-hosted deployment is eleven containers — their own blog says so — and every deployment except one ships an MSSQL Express image by default. That is the version of this argument everybody repeats. It stopped being the whole picture in December 2025, when Bitwarden Lite (previously "unified") went generally available as a single container that will talk to SQLite, PostgreSQL, MySQL or MSSQL. If container count is your objection, Bitwarden has an answer to it now.
What is still true is the shape of the thing. Vaultwarden is one static binary plus the compiled web vault on debian:trixie-slim, defaulting to SQLite, with no licence server in the path and no feature gates. Bitwarden's own documentation positions Lite for personal use and home labs rather than business deployments. Pick on the merits, not on a container count from 2022.
What you inherit is the version treadmill, and it now runs in both directions. Vaultwarden trails the clients — 1.37.0's notes require it for clients at 2026.7.0 or newer, 1.37.2's for 2026.8.0 — and it has also started dropping support behind itself. 1.37.4 broke bw send receive on CLI 2026.4.2 and older, and removed the legacy POST /identity/accounts/register and POST /api/accounts/prelogin endpoints outright. 1.37.5 is required before web vault 2026.7.1 and newer can toggle two-step login methods at all, and before 2026.9.0 and newer can take over an account through emergency access.
Your phone auto-updates. Your server doesn't. Hold the server back far enough and features start failing in the client with no error that points at the server.
One thing worth being clear about, because guides gloss it: the encryption is not Vaultwarden's. Vault items are encrypted and decrypted in the client, with a key derived from your master password, and the server stores ciphertext it cannot read. Compromising the server doesn't hand over your passwords. It hands over encrypted blobs, metadata, and whatever an attacker can do with admin access — which, as the advisory list further down shows, is not nothing.
The Compose File, With the Dead Options Removed
Search for a Vaultwarden compose file and roughly half of what you find still contains this:
WEBSOCKET_ENABLED: "true"
WEBSOCKET_PORT: 3012
ports:
- "3012:3012"
Delete all of it. The separate WebSocket server was folded into the main Rocket process in 1.30.0 and the standalone port was removed outright in 1.31.0. WEBSOCKET_PORT doesn't exist any more. The Dockerfile at 1.37.5 declares exactly one port:
VOLUME /data
EXPOSE 80
Real-time sync now lives on the same port as everything else, at /notifications/hub and /notifications/anonymous-hub, both mounted under the /notifications prefix in src/main.rs. ENABLE_WEBSOCKET defaults to true and there's no reason to touch it.
Here is the version worth typing, expanded from the four-variable stub above:
# /opt/vaultwarden/docker-compose.yml
services:
vaultwarden:
image: vaultwarden/server:1.37.5
container_name: vaultwarden
restart: unless-stopped
environment:
DOMAIN: "https://vault.example.com"
# Registration: closed, invite-only. Read the whitelist section below
# before you add SIGNUPS_DOMAINS_WHITELIST to this block.
SIGNUPS_ALLOWED: "false"
INVITATIONS_ALLOWED: "true"
SIGNUPS_VERIFY: "true"
# Nobody but you creates organisations.
ORG_CREATION_USERS: "none"
# Audit logging for orgs is off by default. Turn it on, and set a
# retention window or the cleanup job never starts.
ORG_EVENTS_ENABLED: "true"
EVENTS_DAYS_RETAIN: "90"
# No password hints on a public instance.
PASSWORD_HINTS_ALLOWED: "false"
ADMIN_TOKEN: '$$argon2id$$v=19$$m=65540,t=3,p=4$$SALT$$HASH'
volumes:
- ./data:/data
ports:
# Bound to loopback. The reverse proxy is the only thing that reaches it.
- "127.0.0.1:8080:80"
Note what is absent. No LOGIN_RATELIMIT_*, because the defaults are already correct and writing them out invites getting them wrong. That section is further down, and it is the one most guides break.
HTTPS Is Not a Recommendation Here
You need HTTPS, and it is worth knowing that two separate mechanisms enforce that, because they fail differently.
The web vault needs a secure context for the browser's Web Crypto API. That is the browser's rule, not Bitwarden's and not Vaultwarden's, and nobody in the chain can waive it. Serve the vault over plain HTTP from anything other than localhost and the crypto calls fail — historically surfacing as Cannot read property 'importKey', which tells you nothing about the actual cause.
The desktop client is a separate and newer restriction. Bitwarden's clients repo added PM-25250 Prevent configuration and access of self-hosted URLs over http, which rejects HTTP self-hosted URLs outright, permitting them only in development mode. So "the app worked over HTTP last year" is a true memory, and no longer a working configuration.
Either way: real certificate, real reverse proxy. The master password hash crosses that connection.
So you need a reverse proxy with a real certificate. If you're starting from nothing, installing nginx on Debian and Ubuntu covers getting it on the box; what follows is only the Vaultwarden-specific part.
server {
listen 443 ssl;
http2 on;
server_name vault.example.com;
ssl_certificate /etc/letsencrypt/live/vault.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/vault.example.com/privkey.pem;
# Attachments and imports. The default 1m rejects a large vault import.
client_max_body_size 128M;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Same upstream, same port. This block exists only to add the
# upgrade headers WebSocket needs.
location /notifications/hub {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Three things people get wrong here. client_max_body_size at nginx's 1MB default will reject a vault import from LastPass or 1Password and produce an error message that says nothing useful. And /notifications/anonymous-hub handles passwordless login approvals; if you only add upgrade headers to /hub, login-with-device silently stops working while everything else looks healthy.
The third is that http2 on; needs nginx 1.25.1 or newer. On anything older it is not ignored, it is fatal:
$ nginx -t
[emerg] unknown directive "http2" in /etc/nginx/conf.d/vault.conf:6
nginx: configuration file test failed
That is nginx 1.24.0, which is what Ubuntu 24.04 LTS and Debian 12 ship — so a large share of the people reading this. On those, use the older listen 443 ssl http2; and drop the separate directive. I tested the block above both ways on 1.24.0: the legacy form passes nginx -t, the modern one refuses to load. Check nginx -v before you copy either.
Verify Before You Trust It
docker compose up -d and the container comes up. Don't stop there.
$ curl -fsS http://127.0.0.1:8080/alive
"2026-09-11T14:22:07.481293Z"
/alive is the endpoint the image's own bundled healthcheck hits, on ROCKET_PORT, every 60 seconds. It returns a timestamp and nothing else.
Now read the first twenty lines of the log, which is the step almost nobody bothers with:
$ docker logs vaultwarden 2>&1 | head -20
[WARNING] The following environment variables are being overridden by the config.json file.
[WARNING] Please use the admin panel to make changes to them:
[WARNING] domain, signups_allowed
That warning comes out of src/config.rs before the logger is initialised, which is why it has no timestamp and scrolls past in the first half-second. It means /data/config.json exists — because somebody once opened the admin panel and clicked Save — and every key in that file beats your environment.
This is the single most expensive gotcha in Vaultwarden. You edit docker-compose.yml, restart, and nothing changes. Not silently failing. Working exactly as designed, on values you can't see from the file you're editing. Either make the change in the admin panel, or delete the key from config.json and restart.
The Admin Token Preset Most Guides Get Backwards
The admin panel at /admin is a single-secret door. Don't put a plaintext token behind it; Vaultwarden will hash one for you. From src/main.rs at 1.37.5:
COMMAND:
hash [--preset {bitwarden|owasp}] Generate an Argon2id PHC ADMIN_TOKEN
backup Create a backup of the SQLite database
You can also send the USR1 signal to trigger a backup
PRESETS: m= t= p=
bitwarden (default) 64MiB, 3 Iterations, 4 Threads
owasp 19MiB, 2 Iterations, 1 Thread
Read the presets. bitwarden is the default and the stronger of the two: 65540 KiB, t=3, p=4, against owasp's 19456 KiB, t=2, p=1. Guides that tell you to run vaultwarden hash --preset owasp are telling you to take 30% of the memory cost and a quarter of the parallelism, whatever they intended. The owasp preset exists for hardware that can't spare 64MiB. Everywhere else, run it bare:
$ docker run --rm -it vaultwarden/server:1.37.5 /vaultwarden hash
Generate an Argon2id PHC string using the 'bitwarden' preset:
Password:
Confirm Password:
Then, in a compose file, escape every $ as $$ and wrap the whole thing in single quotes. This is called out explicitly in the upstream template and it is the most common reason a correctly generated token silently fails to authenticate.
ADMIN_SESSION_LIFETIME defaults to 20 minutes, which is fine. DISABLE_ADMIN_TOKEN should stay false unless something else is actually doing the authentication — a zero-trust access layer in front of the route, not an assumption that nobody will guess the path.
Lock the Door. The Whitelist Unlocks It.
Standard advice is SIGNUPS_ALLOWED=false. Then, because you want your own domain to be able to register, you reach for the whitelist. Here is what the upstream template says about that setting:
## Controls if new users from a list of comma-separated domains can register
## even if SIGNUPS_ALLOWED is set to false
# SIGNUPS_DOMAINS_WHITELIST=example.com,example.net,example.org
Read that second line twice. The whitelist is not a filter narrowing open registration. It is an override that punches straight through SIGNUPS_ALLOWED=false. Set both and you haven't restricted anything. You have re-enabled registration for anyone holding an address at those domains.
If signups are closed, close them. INVITATIONS_ALLOWED=true plus invites from the admin panel requires possession of a link, not a plausible email suffix.
And if you have SSO configured, check the other door. 1.37.3 added SSO_SIGNUPS_ALLOWED, and it defaults to true:
## Allow SSO flow to create account. You probably want to disable it when using a public provider.
# SSO_SIGNUPS_ALLOWED=true
SIGNUPS_ALLOWED=false does not close that path. The upstream comment tells you what to worry about: point Vaultwarden at a provider that will issue a token to anyone, and account creation is open again through a route you closed somewhere else.
Two Settings Named Almost Nothing Like What They Do
REQUIRE_DEVICE_EMAIL is not email verification at signup. It is a new-device login notification, and it is off by default:
## Require new device emails. When a user logs in an email is required to be sent.
## If sending the email fails the login attempt will fail!!
# REQUIRE_DEVICE_EMAIL=false
Those two exclamation marks are upstream, not mine. If your SMTP relay is down, nobody logs in. It couples vault availability to mail availability, permanently. Turn it on only once you are monitoring mail delivery.
The setting you wanted for signup verification is SIGNUPS_VERIFY, also false by default, and in the compose file above.
The one almost nobody enables is worth more than either:
# INCOMPLETE_2FA_TIME_LIMIT=3
An incomplete 2FA login is one where the correct master password was accepted and the second factor was never completed. That is the exact signature of a compromised master password meeting a second factor that held. Vaultwarden emails the user after three minutes. It's on by default; don't set the limit to 0.
A note on the schedule, because the format misleads: INCOMPLETE_2FA_SCHEDULE="30 * * * * *" is a six-field cron, so the leading 30 is the second of each minute. The job runs once a minute, not every thirty seconds. The template says so plainly.
Speaking of second factors — set one up. TOTP and WebAuthn both work with no server configuration at all, and WebAuthn means the passkey in your phone or your hardware key. Email 2FA needs SMTP, and it is the weakest of the three; it also happens to be the subsystem in the CVE below.
Then look at the "remember me" checkbox next to it, because that is where two of the last three releases landed. 1.37.3 shipped a security fix described as revoking 2FA remember tokens when credentials or 2FA settings change — meaning that before it, rotating your master password or replacing your authenticator left previously-remembered devices remembered. 1.37.5 then added a bound on how long that can last:
## Number of days before a remembered 2FA login expires (min: 1, max: 90).
# TWO_FACTOR_REMEMBER_DAYS=30
Thirty days by default, and src/config.rs rejects anything outside 1 to 90 at startup rather than clamping it. If you would rather not have the checkbox at all, DISABLE_2FA_REMEMBER=true ignores it — the template is explicit that the box stays visible either way, which is its own small usability trap.
Your Accounts Are on PBKDF2
This one gets missed because it is not a server setting. New accounts are created server-side with:
pub const CLIENT_KDF_TYPE_DEFAULT: i32 = UserKdfType::Pbkdf2 as i32;
pub const CLIENT_KDF_ITER_DEFAULT: i32 = 600_000;
That is src/db/models/user.rs at 1.37.5. PBKDF2-SHA256 at 600,000 iterations: the Bitwarden-compatible default, and not weak. It is the memory-cheap option, and GPU attackers price memory-cheap KDFs very differently from memory-hard ones.
Argon2id has been supported on the clients since Vaultwarden 1.28.0, and it is a per-account choice made in the client rather than a server flag. Web vault, then Settings, Security, Keys, change KDF to Argon2id. Every device gets logged out afterwards. Do it on a day when you can re-authenticate all of them.
While you are in the source: PASSWORD_ITERATIONS=600000 in the template is the server-side hash of the password hash. Different value, different place, and changing one doesn't change the other.
Org Creation Is Open and Nothing Is Logged
Two defaults that are reasonable for a hosted product and wrong for your box.
## Controls which users can create new orgs.
## Blank or 'all' means all users can create orgs (this is the default):
# ORG_CREATION_USERS=
Every user on your instance can create organisations. Given where the 2026 advisories landed — see the table below, the answer is "the org permission model" — a family instance should set ORG_CREATION_USERS=none and let you create them.
## Controls whether event logging is enabled for organizations
## This setting applies to organizations.
## Disabled by default. Also check the EVENT_CLEANUP_SCHEDULE and EVENTS_DAYS_RETAIN settings.
# ORG_EVENTS_ENABLED=false
Org audit logging is off out of the box. If something happens inside an organisation, there is no record of it unless you turned this on beforehand. There's no retroactive audit log. Pair it with EVENTS_DAYS_RETAIN — unset, the cleanup job never starts and the events table grows without limit.
One housekeeping item if you run orgs and are coming from anything before 1.37.4: that release fixed an advisory covering the organisation API key (GHSA-qwx4-wcv4-mpcv), where Admins could view a key they should not have been able to. Upstream's own upgrade note says to consider rotating it after updating. Patching closes the hole; it does not un-disclose a key that was already readable.
Your Rate Limits Are Rate Limiting a Header
Vaultwarden derives the client address for login and admin rate limits from a header. Which header, and whose word it takes for it, are two different settings:
## Client IP Header, used to identify the IP of the client, defaults to "X-Real-IP"
## Set to the string "none" (without quotes), to disable any headers and just use the remote IP
# IP_HEADER=X-Real-IP
## Which addresses the header above is accepted from, defaults to "local".
## Anyone able to reach Vaultwarden can set the header, and the client IP is used for the login and
## admin rate limits, so it is only trusted when the request comes from a proxy listed here.
## "local" accepts it from any non global address, which covers a reverse proxy running on the same
## host or container network. Use "all" to accept it from anywhere, or list the addresses of your
## proxy as IPs and CIDR ranges if it connects from a public address.
## For a list header like X-Forwarded-For, the client IP is the rightmost address that isn't one of
## these proxies, so with several proxies in a row (a CDN in front of nginx, for example) list all of them.
# IP_HEADER_TRUSTED_PROXIES=local
IP_HEADER_TRUSTED_PROXIES arrived in 1.37.0, in the pull request titled "Trusted proxy support, unauthenticated rate limit & other fixes." It cuts both ways.
Those last two comment lines are new. They were added in 1.37.4, on 5 October 2026, and they document a change in behaviour rather than a new setting — which is the kind of thing that does not look like an upgrade note until it has already cost you something. If you use IP_HEADER=X-Forwarded-For, Vaultwarden now takes the rightmost address in the list that is not a trusted proxy. It used to take the leftmost.
That is the correct direction, and it is correct for the reason the leftmost was wrong: X-Forwarded-For is append-only, every proxy adds to the right, and the leftmost entry is whatever the original client sent — which an attacker controls completely. Taking the leftmost meant the limiter was metering a string from the request. Taking the rightmost-untrusted means it meters the last address a machine you trust actually saw.
The consequence for anyone running more than one hop: every proxy in the chain has to be listed in IP_HEADER_TRUSTED_PROXIES. Cloudflare in front of nginx is two hops. Miss the inner one and Vaultwarden stops at it, deciding your own nginx is the client, and every request on the instance shares one rate-limit bucket and one address in the logs. If you are on X-Real-IP with a single local proxy — the configuration in the nginx block above — none of this touches you.
Set it to all — which forum answers suggest whenever someone's fail2ban is banning the proxy's own address — and every attacker gets a fresh rate-limit bucket per forged X-Real-IP. The limiter still runs. It's metering an attacker-controlled string. If the proxy is on the same host or container network, local is correct; leave it alone. If it arrives from a public address, list those ranges. Never all.
Then the numbers. These are the upstream defaults:
# ADMIN_RATELIMIT_SECONDS=300
# ADMIN_RATELIMIT_MAX_BURST=3
# LOGIN_RATELIMIT_SECONDS=60
# LOGIN_RATELIMIT_MAX_BURST=10
# UNAUTHENTICATED_RATELIMIT_SECONDS=60
# UNAUTHENTICATED_RATELIMIT_MAX_BURST=50
A very widely copied config block sets ADMIN_RATELIMIT_SECONDS: "60" under a comment reading "Admin page rate limiting." The default is 300. Writing 60 there doesn't harden the admin panel. It makes admin login attempts five times cheaper than stock Vaultwarden allows. The login values in that same block are already the defaults, so those two lines do nothing at all. This is why the compose file above omits the section entirely.
UNAUTHENTICATED_RATELIMIT_* is also new in 1.37.0: a shared budget covering password hints, account recovery mail, and Send access, which were not metered as a group before.
The Oracle at /api/two-factor/send-email-login
The rate limiter has been bypassed outright, and recently.
CVE-2026-43914 (GHSA-c5rv-q295-7w4g, CVSS 3.1 base 7.3, AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L, CWE-307) covers Vaultwarden before 1.35.4. The check_limit_login guard was applied to _sso_login, _password_login and _api_key_login. It was not applied to send_email_login, the handler behind /api/two-factor/send-email-login. That endpoint answers differently depending on whether the submitted master password is correct, so it functions as an unmetered password oracle.
The part worth sitting with: per the CVE record, it worked against users who had no email 2FA configured, provided email 2FA was enabled on the server. The exposed population wasn't "people using email 2FA." It was everyone on an instance where email 2FA existed as an option.
The disclosure timeline matters more than the bug. The fix shipped in 1.35.4 on 23 February 2026. The advisory published 25 April. The CVE published 11 May. Seventy-seven days in which the patched release was public and the reason for it was not. Anyone waiting on a CVE feed spent eleven weeks on a known-broken auth path.
That is the operating model, not an anomaly:
| Release | Date | Security content |
|---|---|---|
| 1.35.3 | 10 Feb | Cross-collection item access |
| 1.35.4 | 23 Feb | Cipher access by UUID; two Manager-role collection flaws |
| 1.35.5 | 12 Apr | Unconfirmed owner can purge org vault; cross-org group binding; refresh tokens surviving stamp rotation |
| 1.36.0 | 3 May | SSO login CSRF; user/org enumeration; SSO existing-user binding; icon SSRF |
| 1.37.0 | 24 Jul | Eight entries, ten GHSA IDs: icon SSRF, cross-org cipher access, policy bypass on directory import, Send access-count bypass, unauthenticated WebSocket flood, cross-org secret sharing, org import authz, Manager-role enumeration |
| 1.37.3 | 13 Sep | Two, unnumbered: 2FA remember tokens not revoked on credential or 2FA change; prelogin and auth-request endpoints not rate limited |
| 1.37.4 | 5 Oct | Seven advisories, one High — org member revocation (GHSA-69q9-v8p6-xvx3, 8.1), two-factor authentication (GHSA-7jg8-8m5x-6j9r, 6.8), org invitations (GHSA-v576-3wvq-xh3c, 6.8), attachments (GHSA-q5x6-grh5-fqgc, 6.5), org event logs (GHSA-64mc-4p6f-r7x9, 4.3), cipher sharing (GHSA-7ccc-c43j-4p36, 4.3), org API key (GHSA-qwx4-wcv4-mpcv, 3.8) |
| 1.37.5 | 1 Nov | Two: website icons (GHSA-x9cq-f669-vrr4, 5.3) and emergency access (GHSA-9pjj-f9g5-3x4c, 4.3) |
Three patterns fall out, and the third one is the reason this article got rewritten. First, the org and collection permission model is where the bugs live. Cross-org, cross-collection, Manager-role scope: the boundary keeps turning out wider than intended. Run a single-user instance and you dodged most of 2026. Run organisations and your upgrade window is days, not quarters.
Second, releases carrying security fixes say so before CVEs exist — 1.37.0's notes state the advisories are private pending CVE assignment, and 1.37.4's and 1.37.5's say the same thing word for word. Watch the releases page, not a vulnerability feed. Subscribe to the repo's releases and you get the notification the day it matters.
How long that gap runs is now measurable rather than estimated. 1.37.0 shipped on 24 July with eight advisories named and withheld. Those advisories published on 3 October — all ten of them, same day — which is seventy-one days of a public patch with a private reason. The 1.37.4 and 1.37.5 advisories, seven and two respectively, are still private as of this writing. If your upgrade trigger is a CVE feed, that is the length of your exposure window, and it is not a one-off.
Third: the rate of this has gone up, not down. Between the first version of this article and this one — eight weeks — Vaultwarden shipped three releases carrying eleven security advisories between them, including the first High-severity entry of the year at 8.1. Nothing in the hardening advice below changed. The version you should be running did, three times.
The icon SSRF entries carry their own lesson. Vaultwarden already ships the defence:
## Enabling this will cause the internal HTTP client to refuse to connect to any non-global IP address.
# HTTP_REQUEST_BLOCK_NON_GLOBAL_IPS=true
Default on. So the 2026 bypasses were not missing controls; one is catalogued upstream as a decimal/hex/octal IP encoding bypass. The control was correct. The parser in front of it wasn't, which is SSRF behaving exactly as it always does — the check and the thing being checked disagreeing about what a string means. If your instance has no business fetching favicons, ICON_SERVICE accepts bitwarden, duckduckgo or google to hand the fetch off entirely, or DISABLE_ICON_DOWNLOAD=true with ICON_CACHE_TTL=0 stops it dead.
If You Are on MySQL or MariaDB, Read This Before You Upgrade
Everything above assumes SQLite, which is the default and the right choice for a household. If you moved to MariaDB or MySQL at some point, there is an upgrade that stops your server from starting, and it's much better known about in advance than after.
Vaultwarden 1.36.0 added item archiving, and with it a migration called 2026-03-09-005927_add_archives. On some MariaDB installs it fails and takes the process with it:
Migrations run at startup, and the runner does not handle failure gracefully. From src/db/mod.rs:
diesel::sql_query("SET FOREIGN_KEY_CHECKS = 0")
.execute(&mut connection)
.expect("Failed to disable Foreign Key Checks during migrations");
connection.run_pending_migrations(MIGRATIONS).expect("Error running migrations");
That .expect() is a panic. This is not a degraded feature or a missing archive button — the process dies on boot and your vault is unreachable until you fix the database.
Read the line above it as well, because it matters for what follows. Vaultwarden explicitly turns foreign key checks off before migrating. The reasonable conclusion is that a foreign key problem therefore cannot stop a migration. That conclusion is wrong, and I only know it is wrong because I tested it both ways.
Here is the migration, verbatim from migrations/mysql/2026-03-09-005927_add_archives/up.sql at 1.37.5 — byte-identical to the version that shipped in 1.36.0:
DROP TABLE IF EXISTS archives;
CREATE TABLE archives (
user_uuid CHAR(36) NOT NULL,
cipher_uuid CHAR(36) NOT NULL,
archived_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (user_uuid, cipher_uuid),
FOREIGN KEY (user_uuid) REFERENCES users (uuid) ON DELETE CASCADE,
FOREIGN KEY (cipher_uuid) REFERENCES ciphers (uuid) ON DELETE CASCADE
);
Nothing wrong with it in isolation. The problem is what it doesn't say. Grep every MySQL migration in the repo and not one pins a character set or collation, so every table inherits whatever the database default was on the day it was created. InnoDB requires a foreign key's column to match the referenced column's type and charset and collation exactly. If users and ciphers were created years ago under one default and archives is created today under another, the constraint is rejected.
I reproduced it. MariaDB 10.11.14: create users and ciphers in a database defaulting to utf8mb3_general_ci, move the database default to utf8mb4_general_ci the way a server upgrade or a tidy-minded admin would, then run the real migration file — prefixed with the same statement Vaultwarden's own runner issues.
$ { echo "SET FOREIGN_KEY_CHECKS = 0;"; cat 2026-03-09-005927_add_archives/up.sql; } | mysql vw
ERROR 1005 (HY000) at line 4: Can't create table `vw`.`archives` (errno: 150 "Foreign key constraint is incorrectly formed")
Exit code 1, archives not created, zero foreign keys on it. FOREIGN_KEY_CHECKS = 0 suppresses referential checking — it lets you create a constraint pointing at a table that does not exist yet, which is why migration tooling sets it. It doesn't suppress structural validation. A charset or collation mismatch makes the constraint malformed rather than merely unsatisfied, and InnoDB rejects a malformed constraint whether checking is on or off. I ran it both ways and got the identical error on the identical line.
So check before you pull the new image:
SELECT TABLE_NAME, TABLE_COLLATION
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'vaultwarden';
SELECT @@character_set_database, @@collation_database;
If the existing tables and the database default disagree, you are holding the failure.
The obvious fix doesn't work, which is the part worth knowing. Converting the old tables to match the new default is the first thing anybody tries, and InnoDB refuses:
$ mysql vw -e "ALTER TABLE users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
ERROR 1833 (HY000): Cannot change column 'uuid': used in a foreign key constraint 'vw/ciphers_ibfk_1' of table 'vw/ciphers'
You can't retype a column another table's foreign key points at, and Vaultwarden's schema is full of them. Dropping every constraint, converting, and rebuilding them is a long evening with your vault offline.
Move the database default instead. Point it back at whatever the existing tables already use, let the migration inherit that, and nothing has to be rewritten:
$ mysql -e "ALTER DATABASE vaultwarden DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;"
$ mysql vaultwarden < 2026-03-09-005927_add_archives/up.sql
$ mysql vaultwarden -e "SELECT TABLE_NAME, TABLE_COLLATION FROM information_schema.TABLES WHERE TABLE_SCHEMA='vaultwarden';"
TABLE_NAME TABLE_COLLATION
archives utf8mb3_general_ci
ciphers utf8mb3_general_ci
users utf8mb3_general_ci
Exit code 0, both foreign keys land, Vaultwarden starts. Substitute your own collation — the point is that it matches the tables you already have, not that it is that particular value. In practice you set the database default and then start the new image, letting Vaultwarden run the migration itself.
Two caveats, stated plainly. I reproduced this on a synthetic two-table schema, not on a real years-old Vaultwarden database, so treat the mechanism as confirmed and the specifics of your own install as unknown until you run those two queries. And take a mysqldump before any of it. This is the upgrade where you want a rollback.
One more MySQL item, unrelated but in the same place: 1.37.4 changed the Alpine images so they may fail to reach a MariaDB or MySQL server that has no native TLS. The fix upstream names is MARIADB_TLS_DISABLE_PEER_VERIFICATION=1, and it is an environment variable only — it does not appear in .env.template, so grepping the template for it tells you nothing. If your Alpine container stopped connecting to its database at 1.37.4, that is why.
Backups: The Command in Your Cron Job Does Not Exist
Here is the runtime stage of docker/Dockerfile.debian at 1.37.5:
FROM --platform=$TARGETPLATFORM docker.io/library/debian:trixie-slim
# Create data folder and Install needed libraries
RUN mkdir /data && \
apt-get update && apt-get install -y \
--no-install-recommends \
ca-certificates \
curl \
libmariadb3 \
libpq5 \
openssl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ca-certificates, curl, libmariadb3, libpq5, openssl. There's no sqlite3 binary in that image. Every backup script built on docker exec vaultwarden sqlite3 /data/db.sqlite3 ".backup ..." fails on the official container, and it fails before the tarball is assembled — so what lands in your offsite bucket is a compressed folder of attachments with no database in it. Every night. Quietly. For as long as you let it.
Vaultwarden has had a first-party backup path for a while, and since April 2026 it uses VACUUM INTO rather than the legacy backup API. From src/db/mod.rs:
diesel::sql_query("VACUUM INTO ?")
.bind::<diesel::sql_types::Text, _>(&backup_file)
.execute(&mut conn)
.map(|_| ())
.map_res("VACUUM INTO failed")?;
It opens the database read-only, writes db_YYYYMMDD_HHMMSS.sqlite3 beside the original, and being a single SQLite statement it produces a consistent snapshot with the WAL already folded in. No -wal and -shm juggling. Two ways to trigger it:
# Signal the running process. No downtime, result goes to the log.
docker kill -s USR1 vaultwarden
# Or run the subcommand as a separate read-only process.
docker exec vaultwarden /vaultwarden backup
Then take the snapshot, attachments/, sends/, and rsa_key. That last one isn't optional. It is a 2048-bit RSA key generated on first start and loaded into PRIVATE_RSA_KEY in src/auth.rs; every JWT the server issues is signed with it. Restore without it and Vaultwarden generates a fresh one, invalidating every session and token in existence. Skip icon_cache/. It rebuilds.
#!/bin/bash
# /opt/scripts/vaultwarden-backup.sh
set -euo pipefail
STAMP=$(date +%Y%m%d-%H%M)
DATA=/opt/vaultwarden/data
DEST=/opt/backups/vaultwarden
docker kill -s USR1 vaultwarden
sleep 5
# VACUUM INTO writes db_YYYYMMDD_HHMMSS.sqlite3 alongside the live database.
SNAP=$(find "${DATA}" -maxdepth 1 -name 'db_*.sqlite3' -printf '%T@ %p\n' \
| sort -rn | head -1 | cut -d' ' -f2-)
[ -n "${SNAP}" ] || { echo "no snapshot produced -- check container logs"; exit 1; }
mkdir -p "${DEST}/${STAMP}"
mv "${SNAP}" "${DEST}/${STAMP}/db.sqlite3"
cp -r "${DATA}/attachments" "${DATA}/sends" "${DATA}/rsa_key" "${DEST}/${STAMP}/" 2>/dev/null || true
tar -czf "${DEST}/${STAMP}.tar.gz" -C "${DEST}" "${STAMP}"
rm -rf "${DEST:?}/${STAMP}"
# Encrypt before it leaves the box. age-keygen -o /opt/backup-key.txt, once.
age -r "$(grep '^# public key:' /opt/backup-key.txt | awk '{print $NF}')" \
-o "${DEST}/${STAMP}.tar.gz.age" "${DEST}/${STAMP}.tar.gz"
rm "${DEST}/${STAMP}.tar.gz"
find "${DEST}" -name '*.age' -mtime +30 -delete
The exit 1 on a missing snapshot is the part that matters. A backup script that can't fail loudly will report success for a year.
I have not timed that five-second sleep against a large database. It's a guess at how long VACUUM INTO takes, and on a multi-gigabyte vault it'll be wrong. Run the script by hand, watch the log line, and set it from what you observe rather than from what I wrote.
On PostgreSQL none of this applies. The backup subcommand returns The database type is not SQLite. Backups only works for SQLite databases, and the USR1 handler is never registered at all. Use pg_dump.
And the part everyone skips: restore it. Spin up a second container against a copy of the backup, log in, read one password. A backup you have never restored is a hypothesis.
Drop Root
The container runs as root. There's no USER directive in the Dockerfile, and ROCKET_PORT=80, so dropping privileges means moving the port as well:
user: "1000:1000"
environment:
ROCKET_PORT: "8080"
Chown the data directory to match and repoint the proxy. The bundled healthcheck reads ROCKET_PORT from the environment, so it follows along without changes.
When It Breaks
Config changes have no effect. config.json is winning. Check the startup warning above, then either change it in the admin panel or delete the key from /data/config.json and restart. The environment variable takes over once the key is gone.
Empty vault after changing the database. Before 1.37.0, a DATABASE_URL matching no known scheme fell through to SQLite and created a fresh, empty database — a typo in a Postgres URL produced a working, empty server. 1.37.0 changed that; the source comment is explicit that it "prevents misconfigured URLs (typos, quoted strings) from silently creating a new empty SQLite database." If this already happened on an older version, your real data is still where it was. Fix the URL. Do not let anything write to the new file.
Clients connect but never sync in real time. The /notifications/hub proxy block, or its missing upgrade headers. Vaultwarden logs WebSocket are disabled, realtime sync functionality will not work! at startup if ENABLE_WEBSOCKET is off, which is the other half of the diagnosis.
Login-with-device does nothing. /notifications/anonymous-hub is not proxied with upgrade headers. Worth knowing: the source caps it at MAX_ANONYMOUS_CONNECTIONS_PER_IP: u32 = 25, added as the fix for the unauthenticated WebSocket flooding advisory in 1.37.0. Behind heavy NAT you can legitimately brush that ceiling.
Vault import fails on a big file. client_max_body_size. nginx defaults to 1MB.
fail2ban bans nothing. Three causes, and the third is one I got wrong in a draft of this piece. First, the line you are matching, at the default LOG_LEVEL=info with EXTENDED_LOGGING=true and the [{timestamp}][{target}][{level}] {message} layout from src/main.rs:
[2026-09-05 03:42:15.214][vaultwarden::api::identity][ERROR] Username or password is incorrect. Try again. IP: 203.0.113.42. Username: user@example.com.
Second, an INI section cannot have two failregex = keys; the later silently replaces the earlier, so multiple patterns must be continuation lines.
Third, the three lines you want are written at three different call sites and do not share punctuation:
// src/api/identity.rs:382
err!("Username or password is incorrect. Try again", format!("IP: {}. Username: {log_username}.", ip.ip))
// src/api/admin.rs:224
error!("Invalid admin token. IP: {}", ip.ip);
// src/api/admin.rs:905
error!("Invalid or expired admin JWT. IP: {}.", ip.ip);
The admin token line has no period after the address. The other two do. A pattern ending IP: <ADDR>\. matches two of the three and silently drops the one guarding your admin panel.
That log_username is new in 1.37.5, and it is worth a moment. The line used to interpolate the submitted username raw. It is now username.escape_debug(), from the commit titled "Escape request values in log messages" — which closes log injection, because the username field is attacker-supplied and a newline in it used to let somebody write their own lines into your log file. Anything parsing that log on trust was parsing attacker input.
It does not break the patterns below, and that is worth checking rather than assuming:
user@example.com -> IP: 203.0.113.42. Username: user@example.com.
ad"min@x.com -> IP: 203.0.113.42. Username: ad\"min@x.com.
a[newline]b@x.com -> IP: 203.0.113.42. Username: a\nb@x.com.
josé@example.com -> IP: 203.0.113.42. Username: josé@example.com.
escape_debug leaves ordinary addresses untouched, so the rendered line is byte-identical for every real user. The patterns here stop at the address and never look at the username anyway. But if you wrote a rule that matches on usernames — some people ban on repeated attempts against one account — that rule now sees escaped values, and a hostile username that used to smuggle a newline no longer does.
# /etc/fail2ban/filter.d/vaultwarden.conf
[Definition]
failregex = ^\[[^\]]+\]\[[^\]]+\]\[ERROR\] Username or password is incorrect\. Try again\. IP: <ADDR>\.
^\[[^\]]+\]\[[^\]]+\]\[ERROR\] Invalid admin token\. IP: <ADDR>
^\[[^\]]+\]\[[^\]]+\]\[ERROR\] Invalid or expired admin JWT\. IP: <ADDR>\.
datepattern = ^\[%%Y-%%m-%%d %%H:%%M:%%S
ignoreregex =
Do not take my word for it. fail2ban-regex reports matches per pattern, and a pattern showing zero against a log full of failed logins is the whole bug, visible in one command:
$ fail2ban-regex /opt/vaultwarden/data/vaultwarden.log \
/etc/fail2ban/filter.d/vaultwarden.conf
Check IP_HEADER_TRUSTED_PROXIES at the same time. If Vaultwarden is logging your proxy's address instead of the client's, fail2ban will faithfully ban your proxy.
Logs stop after logrotate. Vaultwarden reopens LOG_FILE on SIGHUP — fern::log_reopen1(path, [SIGHUP]) in src/main.rs. Without a postrotate that signals it, the process keeps writing to the rotated inode and the live log stays empty.
postrotate
docker kill -s HUP vaultwarden
endscript
Nobody can log in and mail is down. REQUIRE_DEVICE_EMAIL=true. That is the coupling described earlier, arriving.
Mobile or the browser extension stopped working after a client update. Compare the server version against the client version before debugging anything else. 1.37.0 is required for clients at 2026.7.0+, 1.37.2 for 2026.8.0+, and 1.37.5 before web vault 2026.7.1+ can toggle two-step login methods or 2026.9.0+ can take over an account via emergency access.
The 2026.8.0 extension release is the example with a second half to it. Users across Chrome, Firefox, Edge and Vivaldi reported the extension failing to log in or showing an empty vault, with the server logging 2FA token not provided. Upgrading the server was necessary but on its own was not sufficient for everyone: the extension held cached state that survived the upgrade, and people got working again only after removing and reinstalling it. If the server is current and one client still misbehaves while others are fine, suspect that client's cache before you suspect your config.
Invites stopped working on 1.37.0. A real regression, fixed in 1.37.1 on 29 July 2026. If you applied a local workaround at the time, upstream's notes ask you to revert it rather than carry it forward. 1.37.1 also fixed an OpenSSL build problem in the Alpine image.
The server refuses to start after upgrading to 1.37.4 or later, complaining about feature flags. 1.37.4 removed several client feature flags. If EXPERIMENTAL_CLIENT_FEATURE_FLAGS still names one, src/config.rs builds this:
let feature_flags_error = format!(
"Unrecognized experimental client feature flags: {invalid_flags:?}.\n\
Please ensure all feature flags are spelled correctly and that they are supported in this version.\n\
Supported flags: {SUPPORTED_FEATURE_FLAGS:?}\n"
);
if on_update {
err!(feature_flags_error);
}
println!("[WARNING] {feature_flags_error}");
Two different outcomes from one condition, which is why the symptom is confusing. At startup it is a [WARNING] — printed before the logger exists, like the config.json notice, so it scrolls past. Through the admin panel (on_update) it is a hard error and your save fails. The message lists the flags it does support, so the fix is in the output. DUO_USE_IFRAME was removed in the same release and is simply ignored if set.
A config value that used to be tolerated now stops startup. 1.37.5 tightened validation: invalid values are rejected at boot rather than silently coerced, and several numeric options gained bounds. TWO_FACTOR_REMEMBER_DAYS outside 1 to 90 and INVITATION_EXPIRATION_HOURS below 1 both fail with a named error rather than clamping. If 1.37.5 will not start on a config that worked on 1.37.4, read the first error line rather than reaching for the previous tag.
One thing worth wiring up while you are here: /alive is a clean scrape target, and a password server going quiet is exactly the failure you want a page for rather than a discovery. If you already run Prometheus and Grafana, a blackbox probe against that endpoint is about four lines of config.
What This Doesn't Cover
SSO. Vaultwarden's OIDC support absorbed a large share of 2026's advisories — CSRF in the authorisation flow, existing-user binding, discovery-endpoint enumeration — and it deserves its own Saturday rather than three paragraphs here. Nothing above addresses it.
Also out of scope: the S3 storage backend added in 1.37.0, PostgreSQL tuning, migrating between database backends, Duo, LDAP sync, and network placement. The MySQL section above is an upgrade warning, not a guide to running on it. Whether this should be on the public internet at all is a real argument with a defensible answer on both sides, and it is a proxy and access-layer question rather than a Vaultwarden one.
The 1.37.4 and 1.37.5 advisories are summarised from the release notes and nothing else, because the advisories themselves are still private. Seven of them have a title and a score and no detail. I have not verified the mechanism behind any of the nine, and nobody outside the project can yet.
I have not benchmarked the Argon2id migration against PBKDF2 on client hardware. The unlock-time cost is real and varies by device. Measure it on your oldest phone before you migrate a family onto it.
The Actual Point
Vaultwarden is good software. Small, fast, seriously maintained, and the advisory cadence above is evidence of that rather than against it — those bugs were found, fixed, and disclosed with affected versions named and scores attached. Compare that with a vendor whose status page says no critical vulnerabilities found.
It also tells you what it is not. The project's own wiki states it targets individuals, families and smaller organisations, and that features aimed mainly at large organisations — single sign-on, directory syncing — are not a development priority. Worth reading before you deploy it as a company password manager and then file issues about SSO.
But the defaults are compatibility defaults, not hardening defaults. They exist so a Bitwarden client connects on the first try, on a Pi, behind whatever somebody has already built. Every setting in this piece has a reason to sit where it sits. None of those reasons is your threat model.
So read the template. Not this guide, not the one you found on Reddit. The 700-line .env.template that ships in the repo, at the tag you are actually running. It takes twenty minutes and it's the only document that can't be out of date.
$ tail -f /forums
Discussion
Comments live on the community forums — sign in there to reply.