Published on
What Vaultwarden is - and what it is not
Bitwarden is an open-source password manager with apps for all common systems and browsers. You can run the server yourself, but the official edition is fairly heavyweight. Vaultwarden is an independent reimplementation of the same server protocol: a single, frugal service that works with the official Bitwarden clients.
Two things are worth knowing. First, Vaultwarden is not a Bitwarden product but a community project, so support requests do not belong with Bitwarden. Second, you are responsible for running it: if your server fails and there is no backup, your passwords are gone. The apps do keep an encrypted copy, but you should not rely on that.
Encryption happens on your devices, by the way. Your entries are stored on the server only in encrypted form, and your master password never leaves your device. Someone who takes over the server does not have your passwords yet - but they could tamper with the web interface. That is why hardening and updates are mandatory.
Rent a VPS from €2.95 / month
Prepaid without a contract, full root access.
Which plan fits?
Vaultwarden itself gets by with very little memory. What determines the requirement is everything around it: Docker, a reverse proxy for HTTPS and possibly further services on the same machine.
| Plan | RAM | CPU | NVMe | Price | Best for | Order |
|---|---|---|---|---|---|---|
| VPS XS | 1 GB | 1 vCore | 5 GB | €2.95 / month | works for one person, but tight with Docker | Order XS |
| VPS SOur recommendation | 2 GB | 1 vCore | 10 GB | €4.95 / month | family or small team, with reverse proxy | Order S |
| VPS M | 4 GB | 2 vCore | 20 GB | €6.45 / month | Vaultwarden plus further services such as Nextcloud | Order M |
| VPS L | 8 GB | 4 vCore | 40 GB | €9.45 / month | many services in parallel on one machine | Order L |
| VPS XL | 16 GB | 4 vCore | 80 GB | €15.95 / month | not needed for Vaultwarden alone | Order XL |
For most people, S for €4.95 / month is the right choice. XS works for a single person, but Docker already takes up a noticeable share of its storage there. If Nextcloud or other services are added later, you switch to a larger plan yourself in the customer interface - without data loss.
You also need a domain or subdomain such as vault.yourdomain.com that points to your VPS via an A record. Without HTTPS, the web interface refuses to work, because encryption in the browser only runs over a secure connection.
Prerequisites
- A set-up and hardened server, see First steps and Secure SSH access. A password manager is the last thing that should run on a server with password login for root.
- Docker with the Compose plugin, see Install Docker on your VPS. Nesting is enabled for this on our VPS.
- The DNS record for your subdomain. How to set it is covered in Set up a subdomain.
Installation via Docker Compose
Create a directory for the stack and generate the token for the admin page first. Vaultwarden has its own command for that, which outputs an Argon2 hash instead of plain text:
mkdir -p ~/stacks/vaultwarden && cd ~/stacks/vaultwarden
docker run --rm -it vaultwarden/server /vaultwarden hash --preset owasp
You enter a long password twice and get a line starting with $argon2id$. Store it in a .env file - in single quotes, so the dollar signs are not read as variables:
nano .env
VW_ADMIN_TOKEN='$argon2id$v=19$...'
Then the Compose file:
nano compose.yaml
services:
vaultwarden:
image: vaultwarden/server:latest
restart: unless-stopped
environment:
DOMAIN: "https://vault.yourdomain.com"
SIGNUPS_ALLOWED: "true"
ADMIN_TOKEN: ${VW_ADMIN_TOKEN}
volumes:
- ./data:/data
ports:
- "127.0.0.1:8081:80"
Three lines deserve attention. DOMAIN must match the address you use to open Vaultwarden exactly, including https:// - otherwise links and notifications do not work properly. SIGNUPS_ALLOWED is set to true for now so you can create your own account. And the port mapping 127.0.0.1:8081:80 makes Vaultwarden reachable only from the server itself. Outside access comes through the reverse proxy in a moment.
docker compose up -d
docker compose config | grep ADMIN_TOKEN
The second line shows whether the token arrives correctly - the dollar signs appear doubled in the output, which is correct.
HTTPS through a reverse proxy
The easiest way is Caddy, which fetches and renews the Let's Encrypt certificate on its own. If you already use nginx, add Vaultwarden there as another server block - the pattern is in Set up a web server. For Caddy, install the package from the package sources and add to /etc/caddy/Caddyfile:
vault.yourdomain.com {
reverse_proxy 127.0.0.1:8081
}
sudo systemctl reload caddy
Ports 80 and 443 must be free, and the DNS record must already point to the server. The web interface is then available at https://vault.yourdomain.com. The live notifications the apps use to sync changes immediately run over the same port in current Vaultwarden versions - a separate WebSocket entry is no longer needed.
Create your account and disable sign-ups
Open the web interface, create your account and choose a long master password you use nowhere else. If you forget it, nobody can reset it - not even you as the server operator.
Once all accounts are created, disable sign-ups. Otherwise, anyone who knows the address can create their own account on your server:
sed -i 's/SIGNUPS_ALLOWED: "true"/SIGNUPS_ALLOWED: "false"/' compose.yaml
docker compose up -d
After that, you invite other people via the admin page at /admin, which needs the password from the first step. For invitations to arrive by email, enter an SMTP server there, such as a mailbox from a web hosting plan.
Then connect the apps: in the Bitwarden app or browser extension, choose "self-hosted" as the region before logging in and enter your address. Also enable two-step login in your account settings.
Updates and backup
You apply updates with two commands. Because a password manager is an attractive target, do this regularly:
cd ~/stacks/vaultwarden
docker compose pull && docker compose up -d
Everything important is in the data folder: the database db.sqlite3, attachments, the key rsa_key.pem and the config.json saved via the admin page. Do not back up the database with a plain copy while it is running, but with a consistent snapshot:
sudo apt install sqlite3 -y
sqlite3 ~/stacks/vaultwarden/data/db.sqlite3 ".backup '/root/vw-$(date +%F).sqlite3'"
Push this snapshot and the rest of the data folder to a destination outside the server with a cron job. How to automate that is covered in the guide Set up backups. Try a restore at least once - for a password manager, that is not optional.
If you would rather manage several applications through a web interface than through Compose files, Vaultwarden can also be deployed via Coolify. For a single service, though, the variant shown here is easier to follow.
Frequently asked questions
VPS for your password manager
Vaultwarden itself needs hardly any resources. With Docker and a reverse proxy, plan S is the right size, and M if you run further services next to it. Full root access, prepaid with no contract, located in Frankfurt am Main.
View VPS plans & pricesRent a VPS
from €2.95 / month
Prepaid without a contract, full root access, DDoS protection up to 250 Gbit/s.
Order nowRead more
- VPS - plans & prices
- Install Docker
- Secure SSH access
- Set up backups
- Install Nextcloud
- Install Coolify
- All VPS guides
Discover more