How to Self-Host Vaultwarden (Bitwarden) on Contabo VPS: Ultra-Secure Password Management
Contabo High-Performance Cloud VPS
Massive 4 vCPU cores, 8GB RAM, and 32TB monthly traffic. Ideal for Linux developers.
Take 100% control of your digital identity and team passwords. Learn how to self-host Vaultwarden with Docker, automated backups, and SSL on Contabo VPS.
- 100% compatible with official Bitwarden browser extensions, desktop apps, and iOS/Android clients
- Written in Rust: consumes less than 40MB of server RAM while supporting thousands of user vaults
- Includes premium Bitwarden features free: two-factor authentication (TOTP/WebAuthn), organization sharing, and emergency access
The Dangers of Commercial Password Managers
High-profile security breaches at major commercial password managers like LastPass demonstrated the vulnerability of centralizing millions of corporate vaults in a single proprietary cloud database. Once attackers breached internal storage buckets, encrypted master vaults were exfiltrated for offline brute-force attacks.
Bitwarden solved this with an open-source, zero-knowledge architecture: data is encrypted and decrypted locally on your client device using AES-CBC 256-bit encryption before ever touching a server. Vaultwarden is a lightweight, open-source reimplementation of the Bitwarden API written in Rust. While the official upstream Bitwarden server requires heavy enterprise .NET and Microsoft SQL stacks demanding 4GB+ RAM, Vaultwarden runs effortlessly on just 40MB of RAM.
Prerequisites on Contabo Cloud VPS
A standard Contabo Cloud VPS 1 ($4.95/mo) running Ubuntu 24.04 LTS can easily host Vaultwarden alongside your web apps, Nextcloud, and analytics daemons.
ssh root@YOUR_SERVER_IP
apt update && apt upgrade -y
apt install -y curl ufw nginx certbot python3-certbot-nginx
curl -fsSL https://get.docker.com | sh
systemctl enable --now docker
Step 1: Setting Up the Vaultwarden Directory
Create a dedicated directory to store your persistent vault database and file attachments:
mkdir -p /opt/vaultwarden/data && cd /opt/vaultwarden
nano docker-compose.yml
Step 2: Docker Compose Configuration
Paste the following secure Docker Compose configuration:
services:
vaultwarden:
image: vaultwarden/server:latest
container_name: vaultwarden
restart: always
environment:
- WEBSOCKET_ENABLED=true
- SIGNUPS_ALLOWED=true
- INVITATIONS_ALLOWED=true
- ADMIN_TOKEN=GENERATE_A_VERY_LONG_64_CHARACTER_RANDOM_SECRET_KEY!
- DOMAIN=https://vault.yourdomain.com
volumes:
- ./data:/data
ports:
- "127.0.0.1:8080:80"
- "127.0.0.1:3012:3012"
Start the container:
docker compose up -d
docker compose ps
Step 3: Nginx SSL Reverse Proxy with WebSocket Support
Browser cryptography APIs (Web Crypto) strictly refuse to unlock password vaults without a trusted TLS/HTTPS connection. Configure Nginx with WebSocket proxying for real-time vault synchronization across devices:
cat << 'EOF' > /etc/nginx/sites-available/vaultwarden.conf
server {
server_name vault.yourdomain.com;
client_max_body_size 128M;
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;
}
location /notifications/hub {
proxy_pass http://127.0.0.1:3012;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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;
}
location /notifications/hub/negotiate {
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;
}
}
EOF
ln -s /etc/nginx/sites-available/vaultwarden.conf /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx
certbot --nginx -d vault.yourdomain.com --non-interactive --agree-tos -m admin@yourdomain.com
Step 4: Creating Your Vault & Disabling Public Signups
Visit https://vault.yourdomain.com in your browser and register your master administrator account with a memorable, ultra-strong passphrase.
Lock Down Public Registration Immediately!
Leaving public registrations open allows strangers to create accounts on your server. As soon as you and your team have created accounts, edit docker-compose.yml and change SIGNUPS_ALLOWED=false, then run docker compose up -d. Future teammates can still be invited via the secure Admin panel at /admin.
Step 5: Connecting Bitwarden Apps & Extensions
Install the official Bitwarden browser extension on Chrome, Firefox, Safari, or the iOS/Android apps:
- On the login screen, click the Gear icon (Settings).
- Under Self-hosted Environment > Server URL, enter:
https://vault.yourdomain.com - Click Save, then log in normally with your email and master password.
Step 6: Automated Encrypted Database Backups
Protect your vault database with an automated daily cron job that backs up the SQLite database using SQLite's safe online backup API:
cat << 'EOF' > /usr/local/bin/backup-vault.sh
#!/bin/bash
BACKUP_DIR="/backups/vaultwarden/$(date +%F)"
mkdir -p "$BACKUP_DIR"
sqlite3 /opt/vaultwarden/data/db.sqlite3 ".backup '$BACKUP_DIR/db.sqlite3'"
tar -czf "$BACKUP_DIR/attachments.tar.gz" -C /opt/vaultwarden/data attachments
find /backups/vaultwarden -type d -mtime +30 -exec rm -rf {} +
EOF
chmod +x /usr/local/bin/backup-vault.sh
(crontab -l 2>/dev/null; echo "0 2 * * * /usr/local/bin/backup-vault.sh >/dev/null 2>&1") | crontab -
Recommended Reading & Related Guides
Summary
With Vaultwarden self-hosted on Contabo VPS, you eliminate monthly per-seat SaaS costs, retain cryptographic ownership over your passwords, and enjoy seamless autofill across all your desktop and mobile devices.
Video Walkthrough & Official References
How to Use Docker Compose to Manage Containers on Linux VPS • syncbricks
Editorial Verdict: Pros & Cons
What We Love (Pros)
- 100% compatible with official Bitwarden browser extensions, desktop apps, and iOS/Android clients
- Written in Rust: consumes less than 40MB of server RAM while supporting thousands of user vaults
- Includes premium Bitwarden features free: two-factor authentication (TOTP/WebAuthn), organization sharing, and emergency access
Drawbacks (Cons)
- HTTPS is strictly required by browser crypto APIs; will not function over insecure HTTP
Deploy Your Contabo Cloud Server
Includes 4 vCPU Cores, 8GB RAM, 50GB NVMe SSD, and 32TB Outbound Traffic.
Written by Alex Vance
Cloud Infrastructure Architect
Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.
Recommended Next Reads
How to Deploy Docker & Docker Compose on Contabo VPS (Production Ready)
A complete guide to installing Docker Engine 26 and Docker Compose on Contabo Ubuntu 24.04 VPS. Includes Docker daemon tuning, UFW firewall integration, and a Traefik reverse proxy demo.
How to Build a Private Cloud with Nextcloud on Contabo VPS (Complete Guide)
Replace Google Drive and Dropbox with a self-hosted Nextcloud server on a Contabo high-storage VPS. Full guide with Docker, PostgreSQL, Redis caching, and Let's Encrypt SSL.
How to Set Up Mailcow: Dockerized Email Server on Contabo VPS (Self-Hosted Guide)
Stop paying per-inbox fees to Google Workspace or Microsoft 365. Learn how to deploy Mailcow Dockerized on a Contabo VPS with SOGo webmail, rDNS, SPF, DKIM, and DMARC.