Vaultwarden: a password manager hosted in Canada

A Bitwarden-compatible server on a Nano at 0.018 CAD an hour, in Canada. Tested end to end: HTTPS, hashed admin token, the bw client, fail2ban that actually bans, backup and update.

A laptop and a phone linked to a closed safe, with a padlock and a green light next to it

Vaultwarden is a free server, written in Rust, that speaks the Bitwarden protocol. The official Bitwarden apps (browser extension, mobile, desktop, command line) connect to it as they would to a Bitwarden server. Your password vault then lives on a machine you run, here a Nano in Montréal.

We built and checked the whole setup on an hourly Nano running Debian 13: Vaultwarden 1.37.5 in Docker, HTTPS through Caddy and Let's Encrypt, an admin page behind a hashed token, sign-ups closed, the official bw client logged in and syncing, fail2ban actually banning, a backup restored, and an upgrade from one release to the next.

1. Vaultwarden is not Bitwarden

Vaultwarden is a community project with no tie to Bitwarden the company. It says so itself at startup: "This is an *unofficial* Bitwarden implementation, DO NOT use the official channels to report bugs/features". Problems go to the Vaultwarden GitHub, never to Bitwarden support.

Encryption happens in the official clients. The server only receives data already encrypted with a key derived from your master password. We checked: after creating an entry whose password was essai-blog-07, searching db.sqlite3 for that string finds nothing, and the data column starts with 2., the prefix of Bitwarden's encrypted strings. A forgotten master password cannot be recovered, same as with Bitwarden.

2. Why host it in Canada

A company password manager holds the keys to everything else. Keeping it on a server in Montréal, run by a Canadian company, makes the Quebec Law 25 question about data leaving the province simpler. What the law requires and what the CLOUD Act changes are covered in Hosting data in Canada; we will not repeat it here.

3. The machine and the domain name

A Nano is enough: 1 vCPU, 2 GB of memory, 20 GB of disk, 0.018 CAD an hour or 8.50 CAD a month. Keep the public IPv4: your users' apps need to reach the server from any network.

Every VM gets a domain name, shown in the console and returned by the API in the dns_name field (it looks like vm-xxxxxxxxx.ffxf.zone), with its A and AAAA records already in place. That is the name we used. To serve vault.your-domain.com instead, add an A record pointing to the machine's IPv4 and an AAAA record to its IPv6 at your registrar, then put that name in place of the VM's in DOMAIN and in the Caddyfile.

The catalog also has a Vaultwarden image. We deployed it on a second Nano: it comes up with HTTPS on the VM's name and an admin token generated in /opt/vaultwarden/.env. In our test, two things needed fixing: the token was in plain text (Vaultwarden warns about it in its logs) and sign-ups were open, so anyone could start creating an account. We have fixed the image since: it closes sign-ups, stores the token as an Argon2id hash and passes the real client address on for fail2ban. If you deployed it before November 3, 2026, apply sections 5 and 6 and add - SIGNUPS_ALLOWED=false under environment: in /opt/vaultwarden/compose.yml.

4. Install Docker, Caddy and fail2ban

On Debian 13, Docker comes from its official repository, Caddy and fail2ban from Debian packages. Caddy runs on the host rather than in a container, so fail2ban blocks traffic in the system's input chain without going through Docker's rules.

bash
sudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/debian $(. /etc/os-release && echo $VERSION_CODENAME) stable" \
  | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin \
  caddy fail2ban sqlite3

5. A hashed admin token

The /admin page controls every account. Vaultwarden accepts a plain token but recommends an Argon2id hash. Its hash command asks for the password twice and needs a terminal: without -it it crashes with "No such device or address".

bash
sudo mkdir -p /opt/vaultwarden && cd /opt/vaultwarden
sudo docker run --rm -it vaultwarden/server:1.37.5 /vaultwarden hash

It prints a line ADMIN_TOKEN='$argon2id$v=19$m=65540,t=3,p=4$…' (165 ms of work on the Nano). Keep the single quotes: without them, the $ signs in the hash would be read as variables. The password you typed is the one for /admin; store it in a different vault.

Create /opt/vaultwarden/.env (mode 600) and paste that line into it:

bash
DOMAIN=https://vm-xxxxxxxxx.ffxf.zone
ADMIN_TOKEN='$argon2id$v=19$m=65540,t=3,p=4$…'
SIGNUPS_ALLOWED=false
INVITATIONS_ALLOWED=false
IP_HEADER=X-Forwarded-For
LOG_FILE=/data/vaultwarden.log

Then /opt/vaultwarden/compose.yml. The port only listens on 127.0.0.1, so only Caddy can reach it.

yaml
services:
  vaultwarden:
    image: vaultwarden/server:1.37.5
    container_name: vaultwarden
    restart: unless-stopped
    env_file: .env
    volumes:
      - ./data:/data
    ports:
      - "127.0.0.1:8000:80"
bash
sudo chmod 600 /opt/vaultwarden/.env
sudo docker compose up -d

IP_HEADER=X-Forwarded-For matters. Without it, Vaultwarden looks for an X-Real-IP header, which Caddy does not send, and logs the Docker gateway's address instead. We saw it happen: every failed login was logged as IP: 172.18.0.1, which makes fail2ban useless.

6. HTTPS with Caddy

HTTPS is not optional: Bitwarden clients refuse a plain HTTP server. The bw CLI 2026.10.1 answers "Insecure URL not allowed. All URLs must use HTTPS", even for localhost. Replace the contents of /etc/caddy/Caddyfile:

bash
vm-xxxxxxxxx.ffxf.zone {
	encode zstd gzip
	reverse_proxy 127.0.0.1:8000
}
bash
sudo systemctl reload caddy
curl https://vm-xxxxxxxxx.ffxf.zone/alive

Caddy had its Let's Encrypt certificate four seconds after the reload, and it redirects HTTP to HTTPS on its own.

7. Creating accounts with sign-ups closed

With SIGNUPS_ALLOWED=false, a sign-up from an unknown address is refused ("Registration not allowed or user already exists"). To add someone, open https://your-name/admin, enter the password from step 5, and invite their address in the Users tab. With no mail server configured, no message goes out: the person opens the web vault and registers with that address, which is then accepted. We checked both sides: an invited account went through, an uninvited one was refused.

Once the accounts exist, you can remove ADMIN_TOKEN from .env and restart the container: according to the Vaultwarden documentation, the admin page is then disabled.

8. Checking with the official client

The Bitwarden CLI (npm install -g @bitwarden/cli) is enough to prove an official client works:

bash
bw config server https://vm-xxxxxxxxx.ffxf.zone
bw login you@example.com
export BW_SESSION="…"     # the value printed by bw login
bw sync
bw list items

We created an entry from one client, then opened a fresh session from a second one: the entry was there, password included. A 200 KB attachment and 50 more entries synced the same way. Browser extensions and mobile apps ask for the same address under the "self-hosted" server option; we did not test them here.

9. fail2ban on failed logins

Vaultwarden writes one line per rejected password and per invalid admin token, with the client's address. Two filters, in /etc/fail2ban/filter.d/:

bash
# vaultwarden.local
[INCLUDES]
before = common.conf

[Definition]
failregex = ^.*?Username or password is incorrect\. Try again\. IP: <ADDR>\. Username:.*$
ignoreregex =
bash
# vaultwarden-admin.local
[INCLUDES]
before = common.conf

[Definition]
failregex = ^.*Invalid admin token\. IP: <ADDR>.*$
ignoreregex =

And the jails, in /etc/fail2ban/jail.d/vaultwarden.local. On Debian, fail2ban blocks with nftables; backend = auto makes it read the file rather than the systemd journal.

systemd
[vaultwarden]
enabled  = true
port     = 80,443
filter   = vaultwarden
backend  = auto
logpath  = /opt/vaultwarden/data/vaultwarden.log
maxretry = 5
findtime = 15m
bantime  = 4h

[vaultwarden-admin]
enabled  = true
port     = 80,443
filter   = vaultwarden-admin
backend  = auto
logpath  = /opt/vaultwarden/data/vaultwarden.log
maxretry = 3
findtime = 15m
bantime  = 4h
bash
sudo systemctl restart fail2ban
sudo fail2ban-client status vaultwarden

The test: five bw login attempts with a wrong password. On the fifth, fail2ban banned our IPv6 address and HTTPS over IPv6 stopped working. Our machine also had IPv4, and the client quietly switched to it; four more failures were needed before that address was banned too. One person can arrive from two addresses. Three bad tokens on /admin triggered the second jail. SSH stayed open throughout, since only ports 80 and 443 are blocked. To lift the bans: sudo fail2ban-client unban --all.

10. Backing up the database and attachments

Everything is in /opt/vaultwarden/data: db.sqlite3, the attachments folder, sends if present, and rsa_key.pem, the key that signs sessions. Do not copy db.sqlite3 while the server is writing to it: SQLite's .backup command makes a consistent copy without stopping anything. The script, /usr/local/bin/vw-backup:

bash
#!/bin/sh
set -eu
umask 077
SRC=/opt/vaultwarden/data
DEST=/var/backups/vaultwarden
STAMP=$(date +%Y%m%d-%H%M)
TMP=$(mktemp -d)
mkdir -p "$DEST"
sqlite3 "$SRC/db.sqlite3" ".backup '$TMP/db.sqlite3'"
sqlite3 "$TMP/db.sqlite3" "PRAGMA integrity_check;" | grep -qx ok
cp -a "$SRC/rsa_key.pem" "$TMP/"
for d in attachments sends config.json; do
  [ -e "$SRC/$d" ] && cp -a "$SRC/$d" "$TMP/"
done
tar -C "$TMP" -czf "$DEST/vaultwarden-$STAMP.tar.gz" .
rm -rf "$TMP"
find "$DEST" -name "vaultwarden-*.tar.gz" -mtime +14 -delete

Without umask 077, our first archive was readable by every account on the machine. Make the script executable (sudo chmod 700) and schedule it nightly with a systemd timer:

vw-backup.service
# /etc/systemd/system/vw-backup.service
[Unit]
Description=Vaultwarden backup

[Service]
Type=oneshot
ExecStart=/usr/local/bin/vw-backup
vw-backup.timer
# /etc/systemd/system/vw-backup.timer
[Unit]
Description=Nightly Vaultwarden backup

[Timer]
OnCalendar=*-*-* 03:15
RandomizedDelaySec=15m
Persistent=true

[Install]
WantedBy=timers.target
bash
sudo systemctl daemon-reload
sudo systemctl enable --now vw-backup.timer

With 51 entries and one attachment, the archive is 240 KB and takes well under a second. We restored it: container stopped, data folder emptied, archive unpacked, container started. A fresh client found all 51 entries and the attachment, byte for byte (same SHA-256). A copy on the same machine does not survive losing the machine: send the archive elsewhere (rsync or scp to another server) and keep the console's machine backups as a second safety net.

11. Upgrading

Pin an exact version in compose.yml rather than latest, so you choose when things change. Vaultwarden releases often, and 1.37.5, out on November 1, fixes two vulnerabilities. Read the release notes, take a backup, change the tag, then:

bash
sudo vw-backup
cd /opt/vaultwarden
sudo docker compose pull
sudo docker compose up -d

We did this on a test instance moved from 1.37.4 to 1.37.5, an upgrade that adds a database migration: the entry created under 1.37.4 was intact afterwards. Going back to the older version after a migration is not a supported path; the backup is your way back.

12. What it uses

Docker weighs more than the password manager. The Nano keeps over 1.5 GiB available, plenty for a small team; we did not measure load with dozens of simultaneous users.

13. The limits

Vaultwarden follows Bitwarden with some lag: a new client feature can require a recent server, as the 1.37.5 notes point out. Support comes from the community, not a contract. Without a mail server there are no emailed invitations, no address verification and no login alerts. And you are the administrator: Debian, Docker and Vaultwarden updates, off-machine backups, monitoring. Our guide to securing a VPS covers the rest of the machine. Turn on two-step login in each account as well; we did not test it for this article.

A login window, a row of ten failed attempts and an open padlock

Windows Server 2025 lockout after 10 failed logins

Ten wrong passwords in ten minutes and Windows Server 2025 locks the Administrator account, so the bots scanning Remote Desktop lock you out. What we measured, what we changed on our images, and how to check your own server.

Read the article 5 min read

A data vault inside a dotted boundary, with outside streams stopped at its edge

Hosting data in Canada: Law 25, PIPEDA, CLOUD Act

No law makes a private business host its data in Canada. Law 25 requires an assessment before data leaves Quebec, PIPEDA keeps you accountable wherever it goes, and the CLOUD Act follows the company, not the server.

Read the article 7 min read

Support & discussions

Technical questions, incident reports, or infrastructure discussions, the team is reachable on Discord, Telegram, X, Instagram, Reddit, and IRC.