Back to services

Vaultwarden

An unofficial, lightweight alternative server for the Bitwarden password manager

View alternatives to Vaultwarden
Suggest edit
Open source
Self-hostable
GPL-3.0
Recent reviews

Alternatives

Tech stack

No tech stack added yet. Sign in to suggest some

Vaultwarden is an unofficial implementation of the Bitwarden password manager server, written in Rust. It uses far fewer resources than the official version, making it an ideal choice for self-hosted password management, especially for homes and small organizations.

Key Features

  • Password management: Securely store and manage passwords, secure notes, credit card information, and more
  • Password generator: Create strong, random passwords
  • Cross-platform support: Works with the official Bitwarden clients (web, mobile, desktop, and browser extensions)
  • End-to-end encryption: All data is encrypted on your device, and the server cannot access plaintext
  • Password sharing: Securely share credentials with team members
  • Multi-factor authentication: Supports multiple two-factor methods, including TOTP, Yubikey, and Duo
  • Security audits: Detect weak passwords, reused passwords, and data breaches
  • Emergency access: Authorize someone else to access your vault in an emergency
  • Auto-fill: Automatically fill in login information for websites and apps
  • Attachment support: Store encrypted copies of important documents

Technical Advantages

Compared with the Official Bitwarden

  • Low resource usage: Memory usage is only 1/10 of the official version
  • Simple deployment: Runs in a single Docker container
  • Good compatibility: Fully compatible with the official Bitwarden clients
  • Complete features: Supports all core features and advanced capabilities

Security Features

  • End-to-end encryption: AES-256 encryption standard
  • Zero-knowledge architecture: The server cannot access user data
  • Security audits: Regular security vulnerability detection
  • Open and transparent: The code is fully open source and auditable

Docker Deployment Examples

Basic Deployment

version: '3.7'
services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: always
    environment:
      WEBSOCKET_ENABLED: true
      SIGNUPS_ALLOWED: false
      ADMIN_TOKEN: your-secure-admin-token
      DOMAIN: https://vault.example.com
    volumes:
      - ./vw-data/:/data/
    ports:
      - "80:80"

Full Production Configuration

version: '3.7'
services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: always
    environment:
      # 基础配置
      DOMAIN: https://vault.example.com
      WEBSOCKET_ENABLED: true
      
      # 注册管理
      SIGNUPS_ALLOWED: false
      INVITATIONS_ALLOWED: true
      INVITATION_ORG_NAME: "My Organization"
      
      # 管理员设置
      ADMIN_TOKEN: your-very-secure-admin-token
      
      # 数据库配置(可选 PostgreSQL)
      # DATABASE_URL: postgresql://user:password@postgres:5432/vaultwarden
      
      # SMTP 邮件配置
      SMTP_HOST: smtp.gmail.com
      SMTP_FROM: [email protected]
      SMTP_FROM_NAME: Vaultwarden
      SMTP_PORT: 587
      SMTP_SSL: true
      SMTP_USERNAME: [email protected]
      SMTP_PASSWORD: your-app-password
      
      # 安全配置
      PASSWORD_ITERATIONS: 100000
      ICON_CACHE_TTL: 2592000
      ICON_CACHE_NEGTTL: 259200
      
      # 功能开关
      DISABLE_ICON_DOWNLOAD: false
      DISABLE_2FA_REMEMBER: false
      
      # 文件上传限制
      ROCKET_LIMITS: '{json=10485760,forms=10485760}'
      
    volumes:
      - ./vw-data/:/data/
    networks:
      - traefik
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.vaultwarden.rule=Host(`vault.example.com`)"
      - "traefik.http.routers.vaultwarden.tls=true"
      - "traefik.http.routers.vaultwarden.tls.certresolver=letsencrypt"
      
      # WebSocket 支持
      - "traefik.http.routers.vaultwarden-websocket.rule=Host(`vault.example.com`) && Path(`/notifications/hub`)"
      - "traefik.http.routers.vaultwarden-websocket.tls=true"
      - "traefik.http.routers.vaultwarden-websocket.tls.certresolver=letsencrypt"
      - "traefik.http.services.vaultwarden-websocket.loadbalancer.server.port=3012"

networks:
  traefik:
    external: true

PostgreSQL Database Configuration

version: '3.7'
services:
  postgres:
    image: postgres:15
    container_name: vaultwarden-postgres
    restart: always
    environment:
      POSTGRES_DB: vaultwarden
      POSTGRES_USER: vaultwarden
      POSTGRES_PASSWORD: secure-db-password
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
    networks:
      - vaultwarden

  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: always
    depends_on:
      - postgres
    environment:
      DATABASE_URL: 'postgresql://vaultwarden:secure-db-password@postgres:5432/vaultwarden'
      WEBSOCKET_ENABLED: true
      SIGNUPS_ALLOWED: false
      ADMIN_TOKEN: your-secure-admin-token
      DOMAIN: https://vault.example.com
    volumes:
      - ./vw-data/:/data/
    networks:
      - vaultwarden
      - traefik

networks:
  vaultwarden:
  traefik:
    external: true

Configuration Options in Detail

User Management

# 环境变量配置
SIGNUPS_ALLOWED=false           # 禁用公开注册
INVITATIONS_ALLOWED=true        # 允许邀请注册
SIGNUPS_DOMAINS_WHITELIST=example.com,company.com  # 仅允许特定域名注册
SIGNUPS_VERIFY=true             # 新用户邮件验证
PASSWORD_ITERATIONS=100000      # 密码哈希迭代次数

Security Configuration

# 双因素认证
DISABLE_2FA_REMEMBER=false      # 启用 2FA 记住功能
YUBICO_CLIENT_ID=12345          # Yubikey 客户端 ID
YUBICO_SECRET_KEY=secretkey     # Yubikey 密钥

# IP 限制
IP_HEADER=X-Forwarded-For       # 获取真实 IP 的头部
ICON_BLACKLIST_NON_GLOBAL_IPS=true  # 禁用非全局 IP 图标下载

Feature Controls

# 功能开关
DISABLE_ICON_DOWNLOAD=false     # 启用网站图标下载
ICON_CACHE_TTL=2592000          # 图标缓存时间(秒)
DISABLE_2FA_REMEMBER=false      # 启用 2FA 记住设备
EMERGENCY_ACCESS_ALLOWED=true   # 启用紧急访问功能

# 文件限制
ROCKET_LIMITS='{json=10485760,forms=10485760}'  # 10MB 上传限制
ATTACHMENT_LIMIT=10485760       # 附件大小限制
USER_ATTACHMENT_LIMIT=104857600 # 用户总附件限制
ORG_ATTACHMENT_LIMIT=1073741824 # 组织总附件限制

Administration and Maintenance

Admin Panel

Visit https://vault.example.com/admin to manage your instance:

  • User management: View, edit, and delete users
  • Organization management: Manage shared vaults
  • System diagnostics: Check system status and configuration
  • Invite users: Send registration invitations

Backup Strategy

# 数据备份
docker run --rm -v vaultwarden_data:/data -v $(pwd):/backup alpine \
  tar czf /backup/vaultwarden-backup-$(date +%Y%m%d).tar.gz /data

# 数据库备份(PostgreSQL)
docker exec postgres pg_dump -U vaultwarden vaultwarden > backup.sql

# 恢复数据
docker run --rm -v vaultwarden_data:/data -v $(pwd):/backup alpine \
  tar xzf /backup/vaultwarden-backup-20240115.tar.gz -C /

Updates and Upgrades

# 更新到最新版本
docker pull vaultwarden/server:latest
docker-compose down
docker-compose up -d

# 查看更新日志
docker logs vaultwarden

Client Integration

Official Clients

  • Web Vault: Full functionality through your browser
  • Browser extensions: Chrome, Firefox, Safari, Edge
  • Desktop apps: Windows, macOS, Linux
  • Mobile apps: iOS, Android

Server Configuration

All clients use the same server address: https://vault.example.com

Mobile App Setup

  1. Download the official Bitwarden app
  2. Choose the "self-hosted" server option
  3. Enter the server URL
  4. Log in and use it as normal

Advanced Features

Organization Management

  • Shared vaults: Share sensitive information within a team
  • Role permissions: Admin, user, and custom permissions
  • Collection management: Organize passwords by department or project
  • Access control: Fine-grained permission management

Emergency Access

  • Trusted contacts: Designate people authorized for emergency access
  • Waiting period settings: Prevent malicious access
  • Automatic notifications: Get notified of emergency access requests

API Integration

# 获取 API 密钥
curl -X POST https://vault.example.com/identity/connect/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials&scope=api&[email protected]&client_secret=password"

# 使用 API 获取密码库
curl -H "Authorization: Bearer ACCESS_TOKEN" \
  https://vault.example.com/api/sync

Security Best Practices

Server Security

  • Enforce HTTPS: Use a valid SSL certificate
  • Regular updates: Keep the software up to date
  • Access control: Restrict access to the admin panel
  • Firewall rules: Open only the necessary ports

User Security

  • Strong password policy: Enforce complex password requirements
  • Two-factor authentication: Enable TOTP or hardware keys
  • Regular audits: Check for weak and reused passwords
  • Security training: Raise user security awareness

Monitoring and Alerts

# Prometheus 监控示例
- job_name: 'vaultwarden'
  static_configs:
    - targets: ['vault.example.com:80']
  metrics_path: '/admin/diagnostics'
  params:
    token: ['admin-token']

Troubleshooting

Common Issues

  1. Cannot access the admin panel

    • Check that ADMIN_TOKEN is correct
    • Verify your firewall settings
    • Check your reverse proxy configuration
  2. Email sending fails

    • Check your SMTP configuration
    • Verify your email credentials
    • Confirm network connectivity
  3. Client connection problems

    • Check the DOMAIN setting
    • Verify your SSL certificate
    • Confirm WebSocket support

Debugging

# 查看详细日志
docker logs -f vaultwarden

# 启用调试模式
RUST_BACKTRACE=1
ROCKET_LOG_LEVEL=debug

Deployment Requirements

Minimum Configuration

  • CPU: 1 core
  • Memory: 256MB RAM
  • Storage: 500MB (basic installation)
  • Network: HTTPS access support

Recommended Configuration

  • CPU: 2 cores or more
  • Memory: 512MB+ RAM
  • Storage: 10GB+ (including attachment storage)
  • Backups: A regular data backup strategy

Use Cases

Individual Users

  • Family password management: Manage all account passwords in one place
  • Privacy protection: Full control over where your data is stored
  • Cost savings: Use premium features for free

Small Teams

  • Team collaboration: Securely share work-related credentials
  • Permission management: Flexible user role configuration
  • Compliance requirements: Meet local data storage needs

Enterprise Use

  • Security compliance: Align with corporate security policies
  • Cost control: No need to buy expensive licenses
  • Customization: Adjust feature configuration to your needs

Vaultwarden gives users a powerful, secure, and economical password management solution. Its lightweight design and complete feature set make it an ideal choice for individuals and small organizations, greatly reducing deployment and maintenance costs while preserving security.