Log inSign up

Your own Vaultwarden password vault over HTTPS

Run the vaultwarden/server container with Docker Compose, publish it only on 127.0.0.1:8080, and let Caddy serve it at https://vault.example.net with an automatic certificate. Create your account, then set SIGNUPS_ALLOWED=false, protect /admin with an Argon2 hashed token and back up the /data folder every night. The official Bitwarden apps and browser extensions connect to it directly.

Topic: Self-hosted apps · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

What is Vaultwarden and what do you need?

Vaultwarden is a lightweight server written in Rust that speaks the Bitwarden client API. It runs in a single container, uses SQLite by default and needs very little memory, which makes it a good fit for the smallest plans.

  • Ubuntu 24.04 or Debian 12/13 with Docker and Compose. The Docker app image already has both; otherwise follow Docker Engine install.
  • A host name such as vault.example.net with A and AAAA records. HTTPS is not optional: the browser clients refuse to use their crypto functions on plain HTTP.
  • A firewall that allows SSH, 80 and 443 only.
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable

How do you create a hashed admin token?

Generate the token with the hash helper built into the image; it asks for a password twice and prints an Argon2 string you store instead of the plain password.

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

Copy the line that starts with $argon2id$ into /opt/vaultwarden/.env, wrapped in single quotes so Compose does not try to expand the dollar signs:

VW_ADMIN_TOKEN='$argon2id$v=19$m=65540,t=3,p=4$...rest-of-the-hash...'
sudo chmod 600 /opt/vaultwarden/.env

The password you typed is what you enter on the admin page later. Keep it in a separate place from the vault itself, since you might need the admin page to recover from a problem with your own account.

What goes into the Compose file?

A single service with the public URL, sign-up switch, admin token and a data volume is all Vaultwarden needs. Save this as /opt/vaultwarden/docker-compose.yml:

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    environment:
      DOMAIN: "https://vault.example.net"
      SIGNUPS_ALLOWED: "true"
      ADMIN_TOKEN: ${VW_ADMIN_TOKEN}
      LOG_LEVEL: warn
    volumes:
      - /opt/vaultwarden/data:/data
    ports:
      - "127.0.0.1:8080:80"
cd /opt/vaultwarden
sudo docker compose up -d
curl -s http://127.0.0.1:8080/alive

The /alive endpoint returns a timestamp when the server is ready. Binding the port to loopback matters, because Docker port rules bypass ufw; only Caddy should reach the container. Recent releases serve WebSocket notifications on the same port, so no second port is needed.

How do you serve it over HTTPS with Caddy?

Install Caddy from its official repository and add one site block that proxies to the container; Caddy requests and renews the certificate itself.

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install -y caddy
vault.example.net {
    encode zstd gzip
    reverse_proxy 127.0.0.1:8080 {
        header_up X-Real-IP {remote_host}
    }
}
sudo systemctl reload caddy
curl -I https://vault.example.net

Open the address in a browser, choose Create account, and set a long master password. The Caddy HTTPS tutorial explains logging and adding more sites.

How do you close sign-ups and use the admin page?

Once your own account exists, turn public registration off and invite other people from the admin page instead.

cd /opt/vaultwarden
sudo sed -i 's/SIGNUPS_ALLOWED: "true"/SIGNUPS_ALLOWED: "false"/' docker-compose.yml
sudo docker compose up -d

Visit https://vault.example.net/admin and enter the admin password from the hash step. From there you can invite users by email, disable accounts, view the diagnostics page and change many settings. Settings saved in the admin page go to /data/config.json and take priority over environment variables, which surprises people later; check that file when an environment change seems to have no effect.

Encourage every user to enable two-step login in their account settings, and consider adding fail2ban rules that read the Vaultwarden log for repeated failed logins.

How do you configure mail for invitations?

Add SMTP variables for an authenticated relay on port 587 with STARTTLS, recreate the container, and send a test mail from the admin diagnostics page.

      SMTP_HOST: smtp.example.net
      SMTP_FROM: vault@example.net
      SMTP_FROM_NAME: Vault
      SMTP_PORT: "587"
      SMTP_SECURITY: starttls
      SMTP_USERNAME: vault@example.net
      SMTP_PASSWORD: change-me

Invitations, new device notices and email two-step codes all rely on this. Direct sending from the VPS over port 25 is not promised, so ask support in a ticket before you plan it; the relay route on 587 is the dependable path. Send app mail through an SMTP relay covers the relay account and SPF and DKIM records.

How do you back up the vault?

Take a consistent SQLite copy with the .backup command and archive it together with the attachment folder, keys and config, every night.

sudo apt install -y sqlite3
sudo sqlite3 /opt/vaultwarden/data/db.sqlite3 ".backup '/root/vw-db-$(date +%F).sqlite3'"
sudo tar -czf /root/vw-files-$(date +%F).tar.gz -C /opt/vaultwarden/data \
  attachments sends config.json rsa_key.pem
ls -lh /root/vw-*

Some folders only appear after first use, so drop any that tar reports as missing. Put the two commands in a root cron job, then copy the files off the server with restic or rsync. Vault contents are encrypted with each user's master password, yet the backup still deserves care because it holds metadata and the server keys. The daily backups tutorial pairs the add-on with restic.

How do you update and troubleshoot Vaultwarden?

Pull the new image and recreate the container; database migrations run automatically on start.

cd /opt/vaultwarden
sudo docker compose pull
sudo docker compose up -d
sudo docker image prune -f
sudo docker compose logs --tail 50 vaultwarden
  • Browser extension shows a crypto or secure context error: you opened the vault over HTTP or through a mismatched DOMAIN.
  • Admin page says the token is invalid: the hash lost characters because the dollar signs were expanded; put it back in single quotes.
  • Changes in Compose do nothing: the same key exists in config.json from the admin page.

Read release notes before large version jumps, and take a backup first.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A1-1personal or family vault1 vCPU, 1 GB RAM, 25 GB NVMe$3.60/mo$43.20 for 12 months
A1-2vault plus a few other containers1 vCPU, 2 GB RAM, 50 GB NVMe$7.20/mo$43.20 for 6 months

Questions about Vaultwarden password vault

Do the normal Bitwarden apps work with Vaultwarden?

Yes. In the app or extension, choose the self-hosted server option before logging in and enter https://vault.example.net.

How much memory does it use?

Very little: a family instance usually stays well under 100 MB. The smallest plans run it comfortably alongside a few other containers.

Should I use PostgreSQL or MySQL instead of SQLite?

For a personal or family vault SQLite is simpler to back up. Larger groups can set DATABASE_URL to a PostgreSQL or MySQL database.

Can I keep the vault private to my VPN?

Yes. Bind Caddy only to the VPN interface or use a WireGuard tunnel and restrict ports 80 and 443 to it; you then need a DNS challenge for the certificate.

What if I forget my master password?

Nobody can decrypt the vault without it, including the admin. Use the emergency access feature or keep a sealed copy of the password offline.