Vaultwarden (formerly bitwarden_rs) is a Rust reimplementation of the Bitwarden server, compatible with every official Bitwarden client. For a team of ten to a hundred users it is the calm, low-resource alternative to running the full official stack with its MS SQL Server and dozen containers. The article below is the install we use when a client wants a private password vault that two engineers can operate without a full-time security team.
How to verify
Before installing, confirm the host can host a password vault — that means encrypted disk, a separate hostname, and a reverse proxy that already terminates TLS:
lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINT
systemctl status systemd-cryptsetup@*.service 2>/dev/null | head -5
dig +short vault.example.com
docker --version || echo "no docker yet"
ss -ltnp | grep -E ':(80|443)\b'
A vault server with no LUKS-encrypted data partition is one stolen disk away from a breach. Confirm the disk encryption is real before you proceed.
What’s happening
Vaultwarden is a single Rust binary that serves the Bitwarden API, the web vault UI, and a WebSocket endpoint for live sync between clients. Data lives in a single SQLite file by default — perfectly fine up to a few hundred users — or in Postgres if you want point-in-time recovery and replication. The reverse proxy in front of it does TLS, HTTP/2, and forwards the WebSocket upgrade for the /notifications/hub path.
The two architectural mistakes we see most often: terminating TLS inside the container (don’t — let Nginx or Caddy do it) and skipping the WebSocket proxy block (mobile clients will sync only when they re-poll the API, which feels broken to users). Both are covered below.
The procedure
-
Docker compose layout. Create
/srv/vaultwarden/docker-compose.yml:services: vaultwarden: image: vaultwarden/server:latest container_name: vaultwarden restart: unless-stopped environment: DOMAIN: "https://vault.example.com" SIGNUPS_ALLOWED: "false" INVITATIONS_ALLOWED: "true" ADMIN_TOKEN: "${ADMIN_TOKEN}" WEBSOCKET_ENABLED: "true" SMTP_HOST: "smtp.example.com" SMTP_FROM: "vault@example.com" SMTP_PORT: "587" SMTP_SECURITY: "starttls" SMTP_USERNAME: "${SMTP_USER}" SMTP_PASSWORD: "${SMTP_PASS}" volumes: - ./data:/data ports: - "127.0.0.1:8222:80" - "127.0.0.1:3012:3012" -
Generate the admin token. This is the bearer that protects the
/adminpanel. Generate with argon2 hashing:docker run --rm -it vaultwarden/server /vaultwarden hashPaste the output into
.envasADMIN_TOKEN=.... The argon2 form means a leaked admin token cannot be brute-forced offline. -
Nginx reverse proxy. Create
/etc/nginx/sites-available/vault.example.com:server { listen 443 ssl http2; 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; client_max_body_size 525M; location / { proxy_pass http://127.0.0.1:8222; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location /notifications/hub { proxy_pass http://127.0.0.1:3012; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /notifications/hub/negotiate { proxy_pass http://127.0.0.1:8222; } } -
TLS via Certbot.
certbot --nginx -d vault.example.com. -
Start and verify.
cd /srv/vaultwarden docker compose up -d curl -s https://vault.example.com/alive -
First admin login. Visit
https://vault.example.com/admin, paste the plain admin token (not the hash), and create the first organization. Then disable signups inSettings → General settingsand require email verification. -
Backup the data volume. A password vault that is not backed up is a single-point-of-failure for the entire client. Add a cron:
# /etc/cron.daily/vaultwarden-backup #!/bin/bash set -e cd /srv/vaultwarden/data sqlite3 db.sqlite3 ".backup /var/backups/vw-$(date +%F).sqlite3" tar czf /var/backups/vw-attachments-$(date +%F).tar.gz attachments/ sends/ rsa_key*Then ship
/var/backups/to off-host storage with restic or borg. -
Rotate the admin token quarterly. Generate a new hash, update
.env,docker compose up -d. The token-in-environment pattern is fine; the token-in-git-repo pattern is not.
Common pitfalls
- TLS terminated inside the container breaks the WebSocket upgrade because the inner HTTP server expects plain HTTP — leave TLS at the reverse proxy.
- Skipping
WEBSOCKET_ENABLED=truemeans mobile clients only sync on the next poll, which users perceive as “saves are losing my passwords”. - Leaving
SIGNUPS_ALLOWED=truein production is the most common mistake — anyone who finds the URL can create accounts. Use invitations only. - The admin token in plaintext in
.envworks but is brute-forceable if the file leaks; always use the argon2 hash form. - Backing up the SQLite file with
cpwhile Vaultwarden is running can produce a corrupt snapshot; always use thesqlite3 .backupcommand which takes a consistent copy.
Stack Harbor runs Vaultwarden as part of the security platform for clients who want a private password vault — TLS terminated correctly, WebSocket healthy on mobile, backups encrypted off-host, the admin token rotated, and SMTP wired so invitations actually arrive. The install above is the same one we put on day one and own through admin token rotations, version upgrades, and the backup drills we run every quarter. For clients running this as part of a larger compliance posture, our managed operations service is the operating model.