Install Vaultwarden on a VPS: Your Own Password Manager

Vaultwarden is an unofficial implementation of the Bitwarden server written in Rust. It works with every official Bitwarden app and browser extension, but instead of a set of heavy containers it is a single one that uses tens of megabytes of memory. For personal use, a family or a small team it is the simplest way to keep passwords on your own server.
What you need
- a VPS with 1 GB of RAM — more than enough;
- Docker and Docker Compose — see the installation guide;
- a domain or subdomain such as
vault.example.comwith an A record pointing to the server.
Step 1. Start the container
mkdir -p ~/vaultwarden && cd ~/vaultwarden
Create docker-compose.yml:
services:
vaultwarden:
image: vaultwarden/server:latest
container_name: vaultwarden
restart: unless-stopped
environment:
DOMAIN: "https://vault.example.com"
SIGNUPS_ALLOWED: "true"
volumes:
- ./vw-data:/data
ports:
- "127.0.0.1:8080:80"
docker compose up -d
The container listens on the loopback address only — a web server with HTTPS will publish it.
Step 2. HTTPS with Nginx
Install Nginx and Certbot:
sudo apt install -y nginx certbot python3-certbot-nginx
Create /etc/nginx/sites-available/vault.example.com:
server {
listen 80;
listen [::]:80;
server_name vault.example.com;
client_max_body_size 525M;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
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_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Enable the site and obtain a certificate:
sudo ln -s /etc/nginx/sites-available/vault.example.com /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d vault.example.com
More server block examples are in the Nginx virtual host guide.
Step 3. Create your account
Open https://vault.example.com, click Create account and set a master password.
Step 4. Close registration
Once every account you need exists, disable sign-ups — otherwise anyone can register on your server. Change the value in docker-compose.yml:
SIGNUPS_ALLOWED: "false"
Apply the change:
docker compose up -d
New users can be invited later from the admin panel.
Step 5. Admin panel
The panel manages users, invitations and mail settings. It is enabled with a token. Generate its hash:
docker exec -it vaultwarden /vaultwarden hash
Enter a strong password twice — the command prints a string starting with $argon2id$. Add it to docker-compose.yml, doubling every $ sign:
ADMIN_TOKEN: "$$argon2id$$v=19$$m=65540,t=3,p=4$$..."
After docker compose up -d the panel is available at https://vault.example.com/admin. Log in with the password you typed when generating the hash.
Connect the apps
Install the Bitwarden browser extension or mobile app. On the login screen choose Self-hosted and enter https://vault.example.com, then log in with your email and master password.
To import passwords from a browser or another manager, use Tools → Import data in the web vault. The process is covered in Switching from LastPass.
Backups
Everything lives in the vw-data directory: the db.sqlite3 database, attachments and keys. Losing it means losing every password, so set up backups right away.
A safe copy of the database without stopping the server:
sudo apt install -y sqlite3
sqlite3 ~/vaultwarden/vw-data/db.sqlite3 ".backup '/root/backup/vaultwarden-$(date +%F).sqlite3'"
Copy the attachments directory and the rsa_key* files along with it. Keep the copies off the server — for example on a separate backup storage. See also self-hosted backup tools.
Updating
cd ~/vaultwarden
docker compose pull
docker compose up -d
Update Vaultwarden regularly: security fixes matter more for a password manager than for most other services.
Extra hardening
- Turn on two-factor authentication in your account settings.
- Restrict
/adminby IP address in the Nginx configuration. - Protect the server itself with two-factor SSH authentication.
Vaultwarden or official Bitwarden
Vaultwarden is not a Bitwarden, Inc. product and is not covered by its security audits. It is the common choice for personal use and small teams; organisations with formal security requirements should consider the official server or Bitwarden’s cloud service.


