Guide

Vaultwarden on a VPS

Last updated: 15 November 2026

Vaultwarden is a small server that works with the official Bitwarden apps and browser extensions, so you keep your passwords on your own server. It needs HTTPS, a locked-down sign-up and regular backups. This guide uses Docker (see Docker on a VPS) and nginx (see nginx with HTTPS). If you are logged in as root, leave out sudo.

Fast VPS from $7.99 a month

See Fast VPS plansHow ordering works

1. Compose file

sudo mkdir -p /opt/vaultwarden && cd /opt/vaultwarden
sudo nano compose.yaml
services:
  vaultwarden:
    image: vaultwarden/server:latest
    restart: unless-stopped
    environment:
      DOMAIN: "https://vault.example.com"
      SIGNUPS_ALLOWED: "true"
    volumes:
      - ./vw-data:/data
    ports:
      - "127.0.0.1:8080:80"

Use your own domain in DOMAIN. The port is bound to 127.0.0.1, so it is reachable only through nginx. Start it with sudo docker compose up -d.

2. nginx and HTTPS

Point a DNS name at the server, then follow the nginx guide with this location block, and get the certificate with Certbot:

location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

The web vault and the Bitwarden apps need HTTPS to work, so do not skip the certificate. Do step 3 right away: until you close sign-ups, anyone who finds the address can register.

3. Create your account, then close sign-ups

  1. Open your HTTPS address, choose "Create account" and register yourself (and anyone you trust). Use a long master password you will not forget: it cannot be recovered.
  2. Edit compose.yaml and set SIGNUPS_ALLOWED: "false", then sudo docker compose up -d again. Nobody else can register now.
  3. Install the Bitwarden app or browser extension and, before logging in, set the self-hosted server URL to your address.

4. Back it up

All data is in /opt/vaultwarden/vw-data. A copy taken while the server runs can be inconsistent, so stop it for a moment:

cd /opt/vaultwarden
sudo docker compose stop vaultwarden
sudo tar czf /root/vw-backup-$(date +%F).tar.gz vw-data
sudo docker compose start vaultwarden

Send the file to another place: scp and rsync, or regular encrypted backups with restic. Also export your vault from the app now and then and keep that file safe.

Good to know

The smallest plan (1 vCPU, 2 GB RAM) is plenty: Fast VPS from $7.99 a month.

Questions and answers

What is Vaultwarden?
A small server that works with the official Bitwarden apps and browser extensions, so you can host your own password vault.

Does Vaultwarden need HTTPS?
Yes. The web vault and the Bitwarden apps need HTTPS to work, so put nginx with a free certificate in front of it.

How do I stop others from registering?
After creating your accounts set SIGNUPS_ALLOWED to false in the compose file and restart the container.

What do I need to back up?
The whole vw-data folder, copied while the container is stopped, and also an export of your vault now and then.

Ready to try it? Fast VPS from $7.99 a month

See Fast VPS plansHow ordering works