← How-Tos
raspberry-pi 2 days ago ◑ 4 views ◯ 5 min read

Self-Hosting Vaultwarden on Raspberry Pi: A Private Password Manager

raspberry pivaultwardenbitwardenpassword managerself hostingdocker

Bitwarden's official server is written in .NET and is heavier than a Raspberry Pi really wants to run continuously. Vaultwarden is a from-scratch, community-maintained reimplementation of the Bitwarden server API in Rust — same client apps, same browser extensions, same sync protocol, a fraction of the resource footprint. It idles at a few megabytes of RAM and single-digit percent CPU on a Pi 4 or Pi 5, making it one of the more practical "actually run this on a Pi full-time" self-hosted services, provided you take backups and remote access seriously, since this is the one self-hosted service on most people's network where data loss or a security misstep has real consequences.

Why Vaultwarden Instead of the Official Bitwarden Server

Every official Bitwarden client — browser extensions, mobile apps, desktop apps — works against Vaultwarden without modification, because Vaultwarden implements the same client-facing API rather than asking you to use different software. The entire vault is encrypted client-side before it ever reaches the server; Vaultwarden (like official Bitwarden) only ever stores and syncs already-encrypted blobs, so a compromise of the Pi itself does not hand over plaintext passwords without also having your master password, which never leaves the client.

Step 1: Install via Docker Compose

Docker is the simplest path to keeping Vaultwarden updated without fighting Rust toolchain versions on ARM. A minimal docker-compose.yml:

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    environment:
      - WEBSOCKET_ENABLED=true
      - SIGNUPS_ALLOWED=false
      - DOMAIN=https://vault.yourdomain.example
    volumes:
      - ./vw-data:/data
    ports:
      - "8080:80"
      - "3012:3012"

Set SIGNUPS_ALLOWED=false from the start and create your own account first, then flip it off — leaving signups open on anything reachable from the internet is asking for someone else's vault to end up on your Pi.

Step 2: Put It Behind HTTPS — Non-Negotiable

Bitwarden's web clients and browser extensions refuse to operate against a non-HTTPS origin except on localhost, and more importantly, a password manager is exactly the kind of service you never want transmitting over plain HTTP even on your own LAN. Use a reverse proxy (Caddy or nginx with a Let's Encrypt or self-signed certificate, or Nginx Proxy Manager if you're already running it for other services) in front of Vaultwarden rather than exposing port 8080 directly:

# Caddy example (Caddyfile)
vault.yourdomain.example {
    reverse_proxy localhost:8080
    reverse_proxy /notifications/hub localhost:3012
}

Step 3: Remote Access Without Exposing a Port to the Internet

You will want vault access away from home — a phone on cellular data, a work laptop — which means deciding how to reach a service running on a Pi behind your home router. Three reasonable options, roughly in order of what most self-hosters should reach for first:

Whichever you choose, do not port-forward Vaultwarden directly to the internet without at minimum a reverse proxy, fail2ban or equivalent brute-force protection, and a plan for applying updates promptly.

Step 4: Enable Two-Factor and Admin Lockdown

Set an ADMIN_TOKEN environment variable to protect the /admin diagnostics page (unprotected by default on some configurations, and it exposes user management), and enable two-factor authentication (TOTP, a hardware key, or Duo depending on your preference) on your Vaultwarden account itself, the same as you would on any Bitwarden account. Losing access to a self-hosted vault because of a forgotten master password with no recovery path is also worth planning for — Bitwarden's recovery code, generated at account setup, should be printed or stored somewhere entirely separate from the vault it protects.

Step 5: Back Up the Data Directory — This Is the Part People Skip

Everything meaningful lives in the ./vw-data volume: the SQLite database, attachments, and RSA keys used for the vault's cryptography. A Pi's SD card or boot drive failing without a backup of this directory means losing every stored credential permanently, not just an inconvenience. At minimum:

Safety and Risk Notes

Self-hosting your password manager trades a large, well-funded company's security team for your own diligence about updates, backups, and network exposure. This is a reasonable trade for many hobbyists, but go in clear-eyed: unlike a photo server or a media library, there is no "just restore from last week's backup, no harm done" outcome if this specific service is compromised or lost without a backup — treat the update cadence and backup discipline for this one service more seriously than for the rest of your self-hosted stack.

Done properly, Vaultwarden gives you the exact Bitwarden experience your devices already expect, with your encrypted vault living on hardware you own rather than a third party's servers — a meaningful trade-off for anyone already comfortable maintaining a home server.