Vaultwarden secure? Na admin token and backup matter
Vaultwarden dey encrypt vault contents for client, but account metadata dey plaintext. Check your admin token, exposed port, config.json, and backup file.
Vaultwarden secure?
Vaultwarden secure for the main place wey matter pass, because every vault item dey encrypted for your device before e reach the server. The server dey store encrypted vault contents together with plaintext account metadata. Person wey copy the whole database still need the vault encryption keys before e fit read the contents, but e go get account email addresses and password hints immediately.
That answer get plenty details inside, and the parts wey fit fail na the ones wey you configure. Admin panel wey dey behind token wey person fit guess. Container port wey you publish to the whole internet. Plaintext config.json. Backup tarball wey dey inside home directory for the same box. None of these na cryptography problems. All of dem na why self-hosted vaults dey get emptied.
Everything for this guide assume say installation dey work. If you never get one, set am up first with Vaultwarden install guide for VPS, then come back and follow this list from top to bottom.
Wetín server actually dey store
Vaultwarden dey use Bitwarden data model. The client dey encrypt vault item name, username, password, notes, and URIs with randomly generated item key before e send any request. User or organisation symmetric key dey protect that key; password-derived key dey protect the user's symmetric key. Attachment file contents dey use separate attachment key wey item key dey protect. Server dey receive opaque data with UUID (universally unique identifier) attached to am.
Some things no be ciphertext, and you need know exactly which ones:
- Your account email address and master password hint, in plaintext.
- Your KDF (key derivation function) settings and salt, because client need dem to rebuild the key for your next login.
- Server-side hash of the master password hash wey client send, wey server use to authenticate the login itself.
- Metadata: organisation membership, device names, last login times.
- TOTP secret for authenticator-based two-factor login. E dey for the
twofactortable unencrypted, because server need calculate the expected code and compare am with your own. This no be the same as TOTP (time-based one-time password) secret wey you store inside vault item; that one dey encrypted like every other field.
The data folder small. For Docker install, na anything wey you mount at /data.
sudo ls -l /vw-data/db.sqlite3 dey hold almost all state. attachments/ dey hold uploaded files under UUID directories, outside the database tables. sends/ dey hold Send attachments and dem design am to be temporary. icon_cache/ na throwaway. rsa_key.pem and the files wey join am dey sign logged-in users' JWTs (JSON web tokens), so anybody wey get copy of that private key fit forge vault login session. config.json dey store settings wey you save through admin page, including SMTP credentials in plaintext and the configured admin token value. If you follow the Argon2 instructions below, e go store admin token hash instead of the plaintext password.
So, the practical threat model na filesystem access, no be network cryptography. Read access to that one directory go expose every user's email address, their login 2FA secrets, key wey fit forge sessions, and offline copy of every vault wey attacker fit attack at their own time. Every step below dey exist to keep people comot from that directory.
Fix admin token first
/admin na full control panel: user list, invitations, deletion, and every runtime setting. Na one shared secret dey protect am, and nothing else. No username. No per-user two-factor.
Older guides tell you to generate ADMIN_TOKEN with openssl rand -base64 48. E go work, but the secret go remain as plaintext anywhere you configure am. Vaultwarden also accepts Argon2 PHC (password hashing competition) string, so the value wey you store go be hash instead. Generate one against a running container:
docker exec -it vaultwarden /vaultwarden hashOr generate am without touching the running container at all:
docker run --rm -it vaultwarden/server /vaultwarden hashE go ask for password two times, then print one line wey start with $argon2id$. For bare-metal install, run ./vaultwarden hash. If you prefer to use argon2 CLI directly, the project document these OWASP minimum parameters:
echo -n 'MySecretPassword' | argon2 "$(openssl rand -base64 32)" -e -id -k 19456 -t 2 -p 1Now na the trap wey fit waste one hour. PHC string get plenty $ characters, and Docker Compose treats $ as variable interpolation. If you paste am without escaping inside environment: block, the value wey reach the container go spoil, so /admin go reject token wey you know say correct. Two safe ways dey. For docker-compose.yml, double every $:
environment:
ADMIN_TOKEN: $$argon2id$$v=19$$m=19456,t=2,p=1$$UUZxK1FZMkZoRHFQRlVrTXZvS0E3bHpNQW55c2dBN2NORzdsa0Nxd1JhND0$$cUoId+JBUsJutlG4rfDZayExfjq4TCt48aBc9qsc3UIFor .env file, you no need escape anything, but use single quotes:
ADMIN_TOKEN='$argon2id$v=19$m=65540,t=3,p=4$MmeKRnGK5RW5mJS7h3TOL89GrpLPXJPAtTK8FTqj9HM$DqsstvoSAETl9YhnsXbf43WeaUwJC6JhViIvuPoig78'Then rate limit the panel and make its session shorter:
ADMIN_RATELIMIT_SECONDS=300
ADMIN_RATELIMIT_MAX_BURST=3
ADMIN_SESSION_LIFETIME=20This one allow burst of three admin login requests from each client IP, then e dey restore the allowance at one request every five minutes. Correct and incorrect passwords both count, because the limiter dey run before password check. Requests wey pass the limit go receive HTTP 429 with Too many requests, try again later. The admin session go expire 20 minutes after you log in, whether you still dey use the panel or not, because activity no dey extend am.
Better pass all these: turn the page off. Most instances need am once to configure SMTP and invite the first users, then dem no need am again. To disable am, set neither ADMIN_TOKEN nor DISABLE_ADMIN_TOKEN, remove any "admin_token" key from config.json, then recreate the container. E matter to delete the key from the file because the admin page dey write settings there, and the value inside config.json wins over the environment. If you only remove the variable, the page go remain open.
Registration band important person discover the domain
SIGNUPS_ALLOWED=false
SIGNUPS_VERIFY=true
SHOW_PASSWORD_HINT=falseSIGNUPS_ALLOWED default na true. Leave am like that and anybody wey reach your domain fit create account, and dem data go dey for the same db.sqlite3 wey your own data dey. Set am to false and add people through invitations from the admin page; SMTP go deliver the invitation email, but if SMTP no dey, the server go record invitation for that address. INVITATIONS_ALLOWED too na true by default and e allow organisation admins invite other people. This one dey okay when you trust your users, but for single-user instance, e suppose dey false. If na only certain domains suppose register, SIGNUPS_DOMAINS_WHITELIST=example.com dey narrower than open signup and e much weaker than invitations.
SHOW_PASSWORD_HINT na false by default and e suppose remain like that. When e dey on and SMTP no configure, if person type valid email address for login form, e go return that account master password hint. This one expose the hint and confirm say the address dey exist.
If your instance run with open signups for any length of time, open the admin page and check the user list before you assume say na only your account dey there.
Port wey you no intend publish
Docker image dey listen for port 80 inside the container. Bare-metal install default na ROCKET_PORT=8000. The documented run command dey publish am like this:
--publish 127.0.0.1:8000:80The 127.0.0.1: prefix na the main point. If you write -p 8000:80 instead, Docker go bind 0.0.0.0, and e go do am by writing DNAT (destination network address translation) rules inside the nat table. Dem rules dey evaluate before the filter chains wey ufw dey manage, so ufw status fit report say the port dey denied while the port still dey answer internet traffic. The full mechanism dey explained for the guide about Docker ports wey dey bypass ufw.
Check wetin dey really listen:
sudo ss -tlnp | grep 8000Healthy result na one line wey bind to 127.0.0.1:8000. Line wey bind to 0.0.0.0:8000 mean say the vault dey exposed directly. Correct the mapping, then recreate the container, because port binding dey fixed when you create the container, and docker compose restart no go change am:
docker compose up -d --force-recreateAnother port still dey show for old guides: 3012, the separate WebSocket port. Vaultwarden 1.31.0 remove support for am, because notification traffic move go the main HTTP port. WEBSOCKET_ENABLED and WEBSOCKET_PORT don deprecated since 1.29.0, and dem no dey use dem. The current switch na ENABLE_WEBSOCKET, wey default to true. If your firewall or compose file still dey open 3012, close am.
End TLS for reverse proxy, no be for Rocket
Vaultwarden fit serve TLS (transport layer security) by itself through Rocket, wey be im web framework, but the project tell you make you no do am for production. Rocket built-in TLS no get strict SNI (server name indication) support. Na why the hardening advice be say make you reach your instance with hostname and never use bare IP address. Dem dey scan public IP ranges all the time. Any vault wey dey answer for IP address fit get found.
The parts of an nginx server block wey matter:
client_max_body_size 525M;
location / {
proxy_pass http://127.0.0.1:8000;
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;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}nginx defaults client_max_body_size to 1m. So, without override, na only request bodies wey pass that limit go fail. nginx returns HTTP 413 to the client and logs client intended to send too large body: ... bytes. The rejected upload no reach Vaultwarden. The Upgrade and Connection headers carry the WebSocket handshake go /notifications/hub. If you remove dem, the vault still dey work, but WebSocket notifications no go reach browser and desktop clients. Mobile clients dey use push notifications wey you configure separately.
Caddy shorter, and e dey obtain the certificate by itself:
vw.example.com {
reverse_proxy 127.0.0.1:8000 {
header_up X-Real-IP {remote_host}
}
}Then tell Vaultwarden about am:
DOMAIN=https://vw.example.com
IP_HEADER=X-Real-IPIP_HEADER already defaults to X-Real-IP. So the work na to make sure say the proxy really sets that header. Vaultwarden also accepts the header only from addresses wey dey listed for IP_HEADER_TRUSTED_PROXIES. E defaults to local: any non-global address, including proxy wey dey the same host or the same container network. If proxy dey connect from public address, you need add am there. If the header dey missing or e come from untrusted address, every log line and every login rate limit go see the proxy own address. This means say one attacker failures go count against every user for the instance. If you use IP_HEADER=X-Forwarded-For instead, 1.37.4 go take the rightmost address wey no be trusted proxy. So list every proxy for the chain, including CDN wey dey in front of nginx. Set DOMAIN to the real https URL too, because Vaultwarden dey build invitation and account recovery links from am. WebAuthn security keys dey also bind to that origin.
One detail wey people dey miss: the WebSocket connection dey pass the session token for the query string, as /notifications/hub?access_token=[JWT]. That one go enter your proxy access log as clear text. Redact the access_token parameter for the log format, or make sure say you no ship those logs go anywhere wey you no control.
Ban brute force for login endpoint
Rate limits dey on by default (LOGIN_RATELIMIT_SECONDS=60, LOGIN_RATELIMIT_MAX_BURST=10). Dem dey slow attacker down. But dem no dey stop am completely. fail2ban dey stop am, but e need Vaultwarden failed logins for somewhere wey e fit read dem. For Docker, the simple way na log file, and Vaultwarden no dey write one by default:
LOG_FILE=/data/vaultwarden.log
LOG_LEVEL=info
EXTENDED_LOGGING=trueFailed password login dey produce line for this format, and na this string your filter must match:
[2026-08-07 09:14:22.000][vaultwarden::api::identity][ERROR] Username or password is incorrect. Try again. IP: 203.0.113.10. Username: user@example.com.Write the filter to /etc/fail2ban/filter.d/vaultwarden.local:
[INCLUDES]
before = common.conf
[Definition]
failregex = ^.*?Username or password is incorrect\. Try again\. IP: <ADDR>\. Username:.*$
ignoreregex =And the jail to /etc/fail2ban/jail.d/vaultwarden.local:
[vaultwarden]
enabled = true
backend = pyinotify
port = 80,443
filter = vaultwarden
banaction = %(banaction_allports)s
logpath = /vw-data/vaultwarden.log
maxretry = 3
bantime = 14400
findtime = 14400If Vaultwarden dey run as systemd service instead of inside container, you fit skip LOG_FILE: the project fail2ban wiki dey read the journal with backend = systemd and use a journalmatch for the Vaultwarden unit instead of logpath.
If you keep the admin page, add second jail wey get failregex as ^.*Invalid admin token\. IP: <ADDR>.*$, because admin failures dey log with different message and the login filter no go ever see dem. Then check your work:
sudo systemctl restart fail2ban
sudo fail2ban-client status vaultwardenWorking jail dey list your log file under File list and report Currently failed: 0. Type wrong password three times from different network and that counter go rise, then the address go appear under Banned IP list. If the counter no ever move, the usual cause na logpath: e must be the file path for the host, not the /data/... path inside the container. The second usual cause na missing or untrusted X-Real-IP, wey dey make every ban target your own proxy. The remaining setup, including the SSH jail wey you suppose don dey run, dey for fail2ban guide for Ubuntu 24.04.
Master password still na the whole system
Client-side encryption mean say master password dey protect the user's symmetric key. If attacker don copy the instance database, short master password no get protection from anything for this post, because dem fit attack that copy offline at any speed wey their hardware allow. No server setting fit reach attacker's own machine.
PASSWORD_ITERATIONS=600000 easy to misread. E dey set iterations for the server-side hash of the login hash wey client send, and the project's configuration template talk say changed value go apply to existing users when dem log in next time. E no affect client-side KDF, wey be the setting wey decide how expensive offline attack on the vault go be. That setting belong to each account. You fit change am under Settings, Security, Keys for the web vault, and this one go re-encrypt the key. Bitwarden documentation talk say clients since 2026.2.1 dey automatically increase PBKDF2 setting wey dey below 600,000 iterations when user log in or unlock with master password. As of 10 October 2026, nobody don confirm this behaviour against Vaultwarden server, and e never change Argon2id settings. So person wey sign up years ago fit still dey use older, lower KDF setting. Check am and tell dem, because server no fit do am for dem.
Then enable two-factor authentication for each account. E no protect the ciphertext, because e no take part for vault encryption. But e stop stolen password from being enough to log in and sync copy. If email don configure, REQUIRE_DEVICE_EMAIL=true make new-device login email compulsory: if sending fail, login go fail. If mail service disable completely, this setting no block new-device logins.
Backups na where self-hosted vaults dey get problem
A tar czf of the data folder wey you leave for home directory on the same VPS fit cancel every step wey you do before. The archive get db.sqlite3 with every user's ciphertext, rsa_key.pem wey fit forge login sessions, and config.json wey get the configured admin token value and SMTP password. If you follow the Argon2 instructions, na hash of the admin password dem store; but SMTP password still dey plaintext. Read access to that one file fit expose account metadata, server secrets, and encrypted vault data.
Two rules cover am. Move the archive comot from the box. Encrypt am before e comot.
Correctness na another problem. If you copy db.sqlite3 with cp while the service dey run, you fit get file wey still dey write and e no go open. You fit no discover this until restore time. Use SQLite own snapshot instead:
sqlite3 /vw-data/db.sqlite3 ".backup '/tmp/vw-db-backup.sqlite3'"The restore side, wey na the part wey nobody dey test, dey covered for the Vaultwarden backup and restore guide.
Wetín you dey give up compared with hosted Bitwarden
Make we account am honestly. Bitwarden hosted service dey operate by people wey their full-time work na to operate am, and dem publish third-party audits. If you self-host, you replace this with your own patch schedule.
Vaultwarden dey release security fixes as normal releases, and dem dey come often. When dem check am on 2 November 2026 against the project's release feed, the current release na 1.37.5, wey dem publish on 1 November 2026. The release notes cover two Medium security advisories and strongly advise say make you update as soon as possible. You also need am for web vault 2026.7.1 and newer before you fit turn two-step login methods on or off, and for 2026.9.0 and newer before you fit take over account through emergency access. The previous release, 1.37.4, wey dem publish on 5 October 2026, cover seven security advisories; the most serious one get High rating. E be the fourth release since 1.37.0 on 24 July 2026: 1.37.1 follow on 29 July, 1.37.2 on 22 August (clients version 2026.8.0 and newer require am), and 1.37.3 on 13 September. This release revoke 2FA remember tokens when credentials or 2FA change, and e rate-limit the prelogin and auth request endpoints. If you run organisations with admins wey you no trust completely, the 1.37.4 notes also suggest say make you rotate each organisation's API key after updating. 1.37.4 also change the address wey e read from X-Forwarded-For, as the reverse proxy section above explain. Instance wey you set up one year ago and forget about fit still dey run code wey old reach one year. The latest tag no fit help by itself: running container go keep the image wey e start with until you run docker compose pull and recreate am. Set up unattended upgrades for Ubuntu for the host packages, and put the container update for calendar reminder wey you go actually read.
The conclusion wey honest reader suppose reach na this: Bitwarden design the cryptography here, and e still hold up, but the operational risk don move completely come you. If you patch am and back am up for another location, Vaultwarden instance for VPS wey you control na reasonable place to keep your passwords. If those two habits no go happen, pay for the hosted service and use your attention for something else. The feature-by-feature comparison dey for Vaultwarden compared with self-hosted Bitwarden.
Harden the host wey dey underneath the container
Vaultwarden na one process for Linux box, and root for that box fit read /vw-data no matter wetin you configure for the application. Run the container as unprivileged user with user: "1000:1000" for your compose file, and make the data folder ownership match am. Mount anything wey the container no dey write to as read only with :ro. Then close the front door: SSH hardening for VPS covers key-only login and disabling password authentication. Na this one stop the simple attack wey fit bypass everything wey you do above.
FAQ
Person fit read my passwords if dem steal the Vaultwarden database?
No be directly. Every vault item dey encrypted for client with randomly generated key. User or organisation symmetric key dey protect am; password-derived key dey protect the user symmetric key. db.sqlite3 contain the encrypted vault contents together with plaintext account metadata. Wetin dem get immediately na each account email address and password hint, the KDF settings, login and device metadata, plus the login TOTP secrets for twofactor table. Dem dey stored unencrypted because the server must calculate the expected code. Dem fit also attack the vault ciphertext offline for as long as dem want. Na why master password length na the number wey decide the result.
I suppose use ADMIN_TOKEN or disable the admin page completely?
Disable am if you fit, because most instances need am once to configure SMTP and invite users, then dem no need am again. To disable am, set neither ADMIN_TOKEN nor DISABLE_ADMIN_TOKEN, remove any "admin_token" key from config.json, then recreate the container. Removing only the environment variable no dey enough, because settings wey the admin page write dey inside config.json and dem get priority. If you keep the page, store the token as an Argon2 hash wey vaultwarden hash produce instead of plaintext random string, and set ADMIN_RATELIMIT_MAX_BURST=3.
My ADMIN_TOKEN correct but /admin dey reject am. Wetin dey wrong?
Almost always na $ interpolation. Argon2 PHC string get several $ characters, and Docker Compose dey expand dem as variables inside a docker-compose.yml environment: block. So the container dey receive mangled value even though your file look correct. Double every $ to $$ for the compose file, or move the value into an .env file wey single quotes wrap, where you no need escaping. Recreate the container afterwards, because restart no dey apply environment changes.
I still need open port 3012 for notifications?
No. Support for WebSocket traffic on port 3012 was removed for Vaultwarden 1.31.0 because notifications move go the main HTTP port. WEBSOCKET_ENABLED and WEBSOCKET_PORT don deprecated since 1.29.0 and dem dey ignored. The current setting na ENABLE_WEBSOCKET, wey be true by default. Close 3012 for the firewall and remove am from your compose file. Then make sure your reverse proxy forward the Upgrade and Connection headers, because browser and desktop WebSocket notifications depend on dem. Mobile clients dey use push notifications wey dem configure separately.