Skip to content
Black Friday · −50 % off your first invoice on Xeon VPS with code BF50XEON, −30 % off our other services with BF30 · domain names and dedicated servers excluded See our plans
CloudFive
Log in

01

Before you start

Vaultwarden is a free, independent project written in Rust that implements the Bitwarden API: you keep the official Bitwarden apps (browser extensions, mobile and desktop apps), but your data stays on your server. It is not affiliated with Bitwarden, Inc.: if something goes wrong, help comes from the project's documentation and community.

  • A Linux VPS, recent, with a sudo user: Debian 12, Ubuntu 22.04 or 24.04. Vaultwarden needs few resources; for one person, a family or a small team, a small plan is enough.
  • Docker and Docker Compose. They run in a container VPS (LXC) when nesting is enabled, as well as in a KVM virtual machine: see KVM or container VPS.
  • A domain name or subdomain, for example vault.example.com, with a DNS A record pointing to the VPS's IPv4 address. The guide choosing a domain name helps if you don't have one yet.
  • HTTPS is mandatory: the web vault uses the browser's cryptography functions, which browsers only provide over HTTPS. Without a certificate, logging in fails.

A password vault is a prime target: first apply the basic security settings (SSH key, updates, firewall) from the guide securing a Linux VPS, and preferably dedicate this VPS to Vaultwarden.

Install the basic tools (dig and curl are often missing from a minimal image), then check that the name points to the server before going further:

sudo apt update
sudo apt install -y curl dnsutils
dig +short vault.example.com
02

Install Vaultwarden and Caddy with Docker Compose

Install Docker with the official script (details in the guide installing Docker on a VPS), then create the service folder:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo mkdir -p /opt/vaultwarden
cd /opt/vaultwarden

Create the compose.yaml file with sudo nano compose.yaml, replacing the domain with yours. This is the setup described in the official Vaultwarden wiki: Vaultwarden is not published on any port, only Caddy can be reached from the Internet.

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: always
    environment:
      DOMAIN: "https://vault.example.com"
      SIGNUPS_ALLOWED: "true"
    volumes:
      - ./vw-data:/data

  caddy:
    image: caddy:2
    container_name: caddy
    restart: always
    ports:
      - 80:80
      - 443:443
      - 443:443/udp
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - ./caddy-config:/config
      - ./caddy-data:/data

Then create the Caddyfile in the same folder (sudo nano Caddyfile):

vault.example.com {
  encode zstd gzip
  reverse_proxy vaultwarden:80 {
    header_up X-Real-IP {remote_host}
  }
}

Start both containers and follow the logs:

sudo docker compose up -d
sudo docker compose logs -f

On first start, Caddy requests a Let's Encrypt certificate for your domain by itself and renews it automatically afterwards. For that, the DNS must already point to the VPS and ports 80 and 443 must be open. Leave the logs with Ctrl+C, then open https://vault.example.com in your browser.

03

Create your account, then close sign-ups

On the vault's home page, create your account. The master password encrypts the whole vault and cannot be recovered by the server: choose a long passphrase and keep it somewhere safe. Then enable two-step login in the account settings (TOTP app or security key).

Once your accounts exist, close public sign-ups; otherwise anyone can open a vault on your server. In compose.yaml, set the variable to "false":

      SIGNUPS_ALLOWED: "false"

then apply the change, which recreates the container without touching the data in vw-data:

sudo docker compose up -d

The admin page (/admin) is used to invite users, view accounts and configure the server. It stays disabled until a token is set. Generate an Argon2-hashed token, the method the wiki recommends: the command asks twice for the password you choose and prints a string starting with $argon2id$.

sudo docker run --rm -it vaultwarden/server /vaultwarden hash

That string contains $ signs that Docker Compose would interpret. The simplest approach is to put it in a .env file in the /opt/vaultwarden folder (sudo nano .env), between single quotes, as the wiki asks: Docker Compose then leaves the $ signs alone.

VW_ADMIN_TOKEN='$argon2id$v=19$m=65540,t=3,p=4$...'

and reference it in the environment section of the vaultwarden service:

      ADMIN_TOKEN: ${VW_ADMIN_TOKEN}

Check the value with sudo docker compose config, restart with sudo docker compose up -d, then log in at https://vault.example.com/admin with the password (not the hashed string). Note: settings saved from that page go into vw-data/config.json and take precedence over the variables in the Compose file. Run sudo chmod 600 .env so only root can read it.

E-mails (invitations, address verification, login codes by e-mail) need an SMTP server: set the SMTP_HOST, SMTP_FROM, SMTP_PORT, SMTP_SECURITY, SMTP_USERNAME and SMTP_PASSWORD variables, or configure them from the admin page.

Bitwarden apps: on the login screen of the extension or app, choose a self-hosted server and enter https://vault.example.com.

04

Ports and firewall

Only three ports need to be open:

  • 22/TCP for SSH (or the port you chose);
  • 80/TCP, which Caddy uses for Let's Encrypt's HTTP-01 challenge (obtaining and renewing the certificate), then to redirect to HTTPS;
  • 443/TCP for the vault, and 443/UDP if you want HTTP/3 (optional).
sudo apt install -y ufw
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 443/udp
sudo ufw enable

Docker writes its own filtering rules ahead of UFW's: any port published under ports: is open to the world, even if UFW blocks it. That is why the vaultwarden service has no ports: section: Caddy reaches it over Docker's internal network. If you want to reach it directly from the VPS for a test, publish it on the loopback only, for example "127.0.0.1:8000:80".

To go further, the Vaultwarden wiki describes a Fail2ban setup that blocks addresses after several failed logins to the vault or the admin page.

05

Back up, restore and update

Everything lives in /opt/vaultwarden/vw-data. The wiki ranks the files as follows: the db.sqlite3 database and the attachments folder are required; config.json and the rsa_key* files are recommended (without them, everyone is logged out); sends and icon_cache are optional. Don't copy the live database with cp: SQLite first writes to a db.sqlite3-wal file. Use SQLite's .backup command, designed for a database in use.

Install SQLite and cron, then create the script /usr/local/bin/vw-backup.sh with sudo nano:

sudo apt install -y sqlite3 cron
#!/bin/sh
set -e
D=$(date '+%Y%m%d-%H%M')
B=/opt/vaultwarden/backups
mkdir -p "$B"
sqlite3 /opt/vaultwarden/vw-data/db.sqlite3 ".backup '$B/db-$D.sqlite3'"
tar czf "$B/data-$D.tar.gz" --exclude='db.sqlite3*' --exclude='icon_cache' -C /opt/vaultwarden vw-data
find "$B" -type f -mtime +14 -delete

Make it executable, test it, then schedule it every night at 3:30 am:

sudo chmod 700 /usr/local/bin/vw-backup.sh
sudo /usr/local/bin/vw-backup.sh
ls -lh /opt/vaultwarden/backups
echo '30 3 * * * root /usr/local/bin/vw-backup.sh' | sudo tee /etc/cron.d/vw-backup

The script keeps 14 days of copies on the VPS. That is not enough: also copy the backups folder to another machine (with rsync or scp), because a backup left on the server disappears with it. Vault items are encrypted by the master passwords, but the database also holds the accounts' e-mail addresses: protect these copies.

Restore: stop Vaultwarden, delete the leftover db.sqlite3-wal file (the wiki warns it can damage the restored database), put the copy in place, then restart. For attachments and the other files, extract the data-….tar.gz archive from the same day.

cd /opt/vaultwarden
sudo docker compose stop vaultwarden
sudo rm -f vw-data/db.sqlite3-wal vw-data/db.sqlite3-shm
sudo cp backups/db-YYYYMMDD-HHMM.sqlite3 vw-data/db.sqlite3
sudo docker compose start vaultwarden

Update: the Bitwarden apps change often, and the newest ones may misbehave, or even refuse to connect, with a Vaultwarden version that is too old. Back up, read the project's release notes, then:

cd /opt/vaultwarden
sudo /usr/local/bin/vw-backup.sh
sudo docker compose pull
sudo docker compose up -d
sudo docker image prune -f
06

What CloudFive offers

CloudFive has no ready-made Vaultwarden plan: you install it yourself on a VPS, following this guide. Our Linux VPS are well suited to it:

  • Intel VPS: Xeon E5-2687W v4 and DDR4 ECC memory, our cheapest VPS, more than enough for a service as light as Vaultwarden.
  • Ryzen VPS: Ryzen 9 9950X, DDR5 and NVMe disk, if the same VPS must also run other services.

Both are Linux containers (LXC) with nesting enabled: Docker and Docker Compose install with the official script, with no extra setting. Every VPS comes with root access, a dedicated IPv4 address, a 1 Gb/s port and basic anti-DDoS protection included. The customer area provides an emergency console if the firewall locks you out, snapshots to roll back before an update, and system reinstallation. A snapshot stays on our infrastructure: also keep your database copies elsewhere.

The servers are in France, on CloudFive's network (AS218808), run by the French company CLOUD FIVE. The VPS is rented monthly, with no commitment, and support answers in French 7 days a week by tickets, on Discord and by phone. To compare plans, see the VPS page; for questions about the law that applies to your data, the guide French sovereign host.

07

When it is not the right choice

  • You don't want to administer a server: a self-hosted password vault is only safe if it is updated, backed up and monitored. If nobody will take care of it, a password service run by its vendor is the more prudent choice.
  • You need official support or contractual guarantees from the vendor: Vaultwarden is a community project, with no support from Bitwarden, Inc.
  • Your business requires certified hosting (HDS, SecNumCloud): CloudFive holds neither of these qualifications.
  • You want to put everything on one machine with several exposed services: it is possible, but a password vault is better off alone on its VPS. To host many isolated services, a dedicated server with several virtual machines is a better fit.
08

Frequently asked questions

How do I install Vaultwarden on a VPS?

Install Docker, then use Docker Compose to run the vaultwarden/server image behind Caddy, which gets a Let's Encrypt HTTPS certificate for your domain on its own. Create your account, then set SIGNUPS_ALLOWED to false to close sign-ups.

Is Vaultwarden safe for storing passwords?

Vault items are encrypted on your device with your master password before being sent to the server. Security then depends on you: HTTPS, closed sign-ups, two-step login, regular updates and backups kept off the server.

Does Vaultwarden work with the Bitwarden apps?

Yes. The Bitwarden browser extensions and apps connect to Vaultwarden: on the login screen, choose a self-hosted server and enter your server's HTTPS address.

Why doesn't Vaultwarden work without HTTPS?

The web vault uses the browser's cryptography functions, which browsers only provide on HTTPS pages. You therefore need a domain name and a certificate, for example one obtained automatically by Caddy.

How do I back up a Vaultwarden database?

Use the sqlite3 .backup command on db.sqlite3 rather than a plain copy, and add the attachments folder, config.json and the rsa_key files. Schedule the backup every night and copy it to another machine.

Which VPS should I choose to host Vaultwarden?

Vaultwarden is very light: a small Linux VPS is enough for one person, a family or a small team, as long as Docker runs on it. At CloudFive, the Intel and Ryzen VPS are LXC containers with nesting enabled, in France, with a dedicated IPv4.

Support CloudFive AI

An answer right away, a real team behind it.

CloudFive AI answers you at any hour, in seconds. When it doesn’t know, or as soon as you ask, the team that runs the machines takes over. No offshore call centre.

  • TicketThe team replies in under 2 hours, 7 days a week.
  • CloudFive AIAt any hour, on ia.cloudfive.fr, Discord and in your customer area.
  • DiscordThe team, the AI and other customers, in the help channel.
  • Your data stays with usAI runs on our servers in France; e-mails, IPs and passwords are masked.
A ticket in the customer area: a customer’s question about a Minecraft plugin, and the CloudFive team’s reply
A real ticket in the customer area, answered by the team (demo account; shown in French).
CUSTOMER AREA · APP

Your servers.
At your fingertips.

Restart a server, watch its resources live, pay an invoice or open a ticket — and get an alert when something goes wrong.

  • The status of all your services at a glance
  • Blocked attacks, filtered traffic, monthly peak
  • A notification when a server goes down or an invoice is due

App coming soon · in the meantime, everything works in your browser at manager.cloudfive.fr

The CloudFive app: the list of your services, with their status
The CloudFive app: the home screen, your services’ status, blocked attacks and an invoice to pay