NOC online · 24/7Longview, TX · +1 323 412 0665
KinetikatechServers · Security · Websites
ZH

该详细指南目前仅提供英文版。

English version

Self-Hosted Open Source Infrastructure

Building a Private Enterprise Password Management Architecture Using Self-Hosted Vaultwarden Clusters

Vaultwarden is a lightweight, self-hosted Bitwarden-compatible server. Running it as a cluster with replication and backups provides enterprise password management without cloud dependency. This guide deploys and hardens a Vaultwarden cluster.

要点

  • Deploy with Docker. Vaultwarden has an official image that runs with minimal configuration.
  • Use PostgreSQL for the database. SQLite works for small teams; PostgreSQL scales better.
  • Enable HTTPS. Use a reverse proxy with Let's Encrypt for TLS termination.
  • Configure SMTP. Email is needed for invitations and password recovery.
  • Set up backups. Automate database dumps and test restores regularly.
  • Enable admin panel. The admin panel provides user management and diagnostics.
  • Restrict access. Use firewall rules and fail2ban to protect against brute force.
  • Monitor health. Check the health endpoint and database connectivity.

Architecture

Vaultwarden runs as a container behind a reverse proxy. PostgreSQL stores vault data. SMTP handles email. Backups run on a schedule. The admin panel provides management. All traffic is encrypted via TLS.

Production configuration

Docker Compose for Vaultwarden yaml
version: '3'
services:
  vaultwarden:
    image: vaultwarden/server:latest
    restart: always
    environment:
      DATABASE_URL: postgresql://vw:password@db/vaultwarden
      SMTP_HOST: smtp.example.com
      SMTP_PORT: 587
      SMTP_SECURITY: starttls
      SMTP_USERNAME: noreply@example.com
      SMTP_PASSWORD: change-me
      ADMIN_TOKEN: change-me-admin-token
    volumes:
      - ./vw-data:/data
    ports:
      - 8080:80
  db:
    image: postgres:16
    environment:
      POSTGRES_DB: vaultwarden
      POSTGRES_USER: vw
      POSTGRES_PASSWORD: password
    volumes:
      - ./pg-data:/var/lib/postgresql/data
Backup and restore bash
# backup database
docker exec vw-db pg_dump -U vw vaultwarden > backup.sql
# backup data volume
tar czf vw-data.tar.gz ./vw-data

# restore
docker exec -i vw-db psql -U vw vaultwarden < backup.sql
tar xzf vw-data.tar.gz
Harden with fail2ban bash
# /etc/fail2ban/jail.d/vaultwarden.conf
[vaultwarden]
enabled = true
port = 80,443
filter = vaultwarden
logpath = /var/log/vaultwarden.log
maxretry = 5
bantime = 3600

# verify
fail2ban-client status vaultwarden

Edge cases from production

  • Admin token must be strong; a weak token compromises the entire vault.
  • Database backups must be encrypted; vault data is sensitive.
  • SMTP misconfiguration breaks invitations and recovery; test email delivery.
  • Upgrades can change the database schema; back up before upgrading.

常见问题

Is Vaultwarden compatible with Bitwarden clients?

Yes, all Bitwarden clients work with Vaultwarden.

Can I migrate from Bitwarden cloud?

Yes, export from Bitwarden and import into Vaultwarden.

How do I enable 2FA?

Through the Bitwarden client; Vaultwarden supports all 2FA methods.

Is it secure?

Yes when properly configured with HTTPS, strong tokens, and backups.

How do I scale it?

Vaultwarden is lightweight; a single instance handles thousands of users.

Kinetikatech 如何在self-hosted open source infrastructure方面为您提供帮助

这是我们的日常工作:Running sovereign collaboration, storage, and identity stacks on hardware you control.我们的服务器管理和网站维护服务提供端到端覆盖:评估、实施、24/7 监控,以及 30 分钟内的应急响应。

与工程师交谈

服务器问题?网站被黑?网站缓慢?

严重问题 30 分钟内响应 — 每天 24 小时,每周 7 天。

请求紧急支持 support@kinetikatech.com