Skip to main content
Back to Category

Vaultwarden Setup: Self-Hosted Password Manager

Vaultwarden (Bitwarden-compatible) Docker installation, HTTPS configuration, admin panel, organization and collection management, usage with Bitwarden clients.

Read time: 13 min Self-Hosting
vaultwardenbitwardenpassword managerself-hostingdockersecurity
Author
REXE Teknoloji Network & Security Team
Editor
REXE Teknoloji Technical Editorial
First published
Last updated

Vaultwarden Setup: Self-Hosted Password Manager

Vaultwarden is a lightweight, community-supported alternative to the official Bitwarden server, written in Rust. Compared to the official Bitwarden server, it consumes far fewer resources and is fully compatible with all Bitwarden clients (web, desktop, mobile, browser extension). By hosting it on your own server, you retain complete control over your passwords.

What is Vaultwarden?

Vaultwarden (formerly bitwarden_rs) is an open-source project that reimplements the Bitwarden API in Rust. Key features:

  • Low Resource Usage: Runs comfortably with 512 MB RAM
  • Bitwarden Compatibility: All official Bitwarden clients are supported
  • Organization Support: Create organizations and collections for free
  • TOTP Support: Two-factor authentication
  • Web Vault: Browser-accessible web interface
  • Send Feature: Secure file and text sharing

System Requirements

  • Server with Docker and Docker Compose installed
  • Minimum 512 MB RAM
  • Valid domain name (required for HTTPS)
  • SSL certificate (Let's Encrypt recommended)

Installation with Docker

Creating docker-compose.yml

hljs yaml
version: '3.8'

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    environment:
      DOMAIN: "https://vault.example.com"
      SIGNUPS_ALLOWED: "true"
      ADMIN_TOKEN: "strong-admin-token-here"
      WEBSOCKET_ENABLED: "true"
      LOG_LEVEL: "warn"
    volumes:
      - ./vw-data:/data
    ports:
      - "127.0.0.1:8080:80"
      - "127.0.0.1:3012:3012"
hljs bash
# Start the container
docker compose up -d

# Check logs
docker logs vaultwarden -f

Use a strong and random value for ADMIN_TOKEN. You can generate a secure token with openssl rand -base64 48.

Generating Admin Token

hljs bash
# Generate secure admin token
openssl rand -base64 48

# More secure token with Argon2 hash (recommended)
docker run --rm -it vaultwarden/server /vaultwarden hash --preset owasp

Nginx Reverse Proxy and SSL Configuration

Since Vaultwarden requires HTTPS, setting up an Nginx reverse proxy is mandatory.

Nginx Configuration

hljs nginx
server {
    listen 80;
    server_name vault.example.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name vault.example.com;

    ssl_certificate /etc/letsencrypt/live/vault.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/vault.example.com/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;

    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";
    }

    location /notifications/hub/negotiate {
        proxy_pass http://127.0.0.1:8080;
    }
}

Let's Encrypt SSL Certificate

hljs bash
# Install Certbot
apt install certbot python3-certbot-nginx -y

# Obtain SSL certificate
certbot --nginx -d vault.example.com

# Test automatic renewal
certbot renew --dry-run

Admin Panel Configuration

Access the admin panel at https://vault.example.com/admin.

Important Admin Settings

hljs bash
# Disable registration after setup
SIGNUPS_ALLOWED=false

# Allow registration only for specific domains
SIGNUPS_DOMAINS_WHITELIST=example.com,company.org

# Invitation system
INVITATIONS_ALLOWED=true

# Email verification
SIGNUPS_VERIFY=true

SMTP Email Configuration

hljs yaml
environment:
  SMTP_HOST: "smtp.gmail.com"
  SMTP_FROM: "vault@example.com"
  SMTP_PORT: "587"
  SMTP_SECURITY: "starttls"
  SMTP_USERNAME: "vault@example.com"
  SMTP_PASSWORD: "app-password"

User Management

Inviting Users

From the admin panel, go to UsersInvite User to send email invitations.

hljs bash
# Invite user via CLI
docker exec vaultwarden /vaultwarden invite --email user@example.com

Creating Organizations and Collections

Organizations are free in Vaultwarden (paid in official Bitwarden):

  1. Log in to the web vault
  2. OrganizationsNew Organization
  3. Enter organization name and billing email
  4. Use Collections to categorize passwords
  5. Invite members and assign roles (Admin, Manager, User, Custom)

Connecting Bitwarden Clients

Browser Extension

  1. Install the Bitwarden extension (Chrome, Firefox, Edge)
  2. Click Server URL on the login screen
  3. Enter https://vault.example.com
  4. Log in with your account

Mobile App

1. Open the Bitwarden app
2. Tap the region selector on the login screen
3. Select "Self-hosted"
4. Server URL: https://vault.example.com
5. Save and log in

Desktop App

File → Settings → Server URL
https://vault.example.com

Backup

hljs bash
# Backup Vaultwarden data
tar -czf vaultwarden-backup-$(date +%Y%m%d).tar.gz ./vw-data/

# Automated backup script
cat > /etc/cron.daily/vaultwarden-backup << 'EOF'
#!/bin/bash
BACKUP_DIR="/backups/vaultwarden"
mkdir -p $BACKUP_DIR
tar -czf $BACKUP_DIR/backup-$(date +%Y%m%d-%H%M%S).tar.gz /opt/vaultwarden/vw-data/
# Delete backups older than 30 days
find $BACKUP_DIR -name "backup-*.tar.gz" -mtime +30 -delete
EOF
chmod +x /etc/cron.daily/vaultwarden-backup

Vaultwarden runs great on REXE VPS servers. 1 GB RAM and 1 vCPU is sufficient for small teams.

Frequently Asked Questions

What is the difference between Vaultwarden and official Bitwarden?

Vaultwarden is a community project that reimplements the Bitwarden API in Rust. It consumes far fewer resources than the official Bitwarden server (512 MB RAM is sufficient). Organizations and premium features are free in Vaultwarden, while they are paid in the official server. It is fully compatible with all Bitwarden clients.

Can I use Vaultwarden without HTTPS?

No, Bitwarden clients require HTTPS for security reasons. Without a valid SSL certificate, clients will refuse to connect. You can get a free SSL certificate with Let's Encrypt. Self-signed certificates also work for local network use, but you'll need to manually add trust in the clients.

I can't access the admin panel, the token doesn't work.

Check that the ADMIN_TOKEN value is correctly defined in docker-compose.yml. If you used an Argon2 hash, '$' characters may need to be escaped in YAML. Wrap the token in single quotes: ADMIN_TOKEN: '$$argon2id$$...'. Restart the container: docker compose restart vaultwarden.

WebSocket notifications aren't working, no real-time sync.

Make sure the /notifications/hub location in your Nginx config is proxied to port 3012. Check that WEBSOCKET_ENABLED=true environment variable is set. Verify that 'proxy_set_header Upgrade $http_upgrade' and 'proxy_set_header Connection upgrade' directives are added in Nginx.

How do I back up Vaultwarden data?

All data is stored in the ./vw-data/ directory. Back up this directory regularly: tar -czf backup.tar.gz ./vw-data/. You can take backups while the container is running for the SQLite database. Critical files: db.sqlite3 (database), rsa_key* (encryption keys), attachments/ (attachments). Losing the keys makes all passwords inaccessible.

How do I share passwords with organization members?

Create an organization and add collections. Edit the password you want to share and select the relevant collection in the 'Collections' section. Invite members to the organization and grant collection access permissions. Members can see shared passwords in their own Bitwarden clients.

Related Articles

Network TrafficInbound GbpsOutbound Gbps