Vaultwarden is a lightweight password vault service compatible with Bitwarden clients. In this project, vaultwarden/server:latest (1.37.4) is deployed with Docker on a NAS (.164), mapping host port 8091 to container port 80, storing data in /opt/web/vaultwarden-data, and integrating with sync.sh for daily backups. Externally, it provides access at https://vault.xiejun-server.top through a Cloudflare DNS-only A record, frpc web-https/web-http proxies, and an NPM reverse proxy, reusing a Let's Encrypt multi-domain certificate, supporting WebSocket, and with an upload size limit of 525M. This allows duplicate/weak passwords for NPM, Gitea, Memos, PhotoPrism, Open WebUI, the blog admin, the Windows host, and the router to be centralized and changed to random strong passwords, with TOTP gradually enabled. The site and API have currently been verified as working properly, the first account has been registered, SIGNUPS_ALLOWED has been disabled, and only invitation-based registration remains enabled; changing the master password and migrating service passwords are still to-do.
Features
- 自建 Bitwarden 兼容密码库,Web Vault 与 API 已验证正常
- Docker 部署,数据目录持久化并纳入每日备份
- Cloudflare、frpc、NPM 全链路 HTTPS 访问
- NPM 反代支持 WebSocket,上传体积上限 525M
- 管理面板通过 ADMIN_TOKEN 登录
- 注册关闭后保留邀请注册能力
Stack: Vaultwarden · Docker · Cloudflare · frpc · Nginx Proxy Manager · Let's Encrypt · SQLite
Deployment and Usage Steps
- DNS: In Cloudflare, add an A record for
vaultpointing to38.76.200.139, and keep it DNS only (grey cloud). - Container: On NAS
.164, prepare the data directory/opt/web/vaultwarden-data, use the imagevaultwarden/server:latest, and map port8091:80. Set the environment variablesDOMAIN=https://vault.xiejun-server.top,SIGNUPS_ALLOWED=true(for initial registration),INVITATIONS_ALLOWED=true, andTZ=Asia/Shanghai, and putADMIN_TOKENin/root/.vaultwarden-admin-token(permissions 600). For the specific startup command, follow the existing Docker configuration. - Reverse proxy: Create a new proxy in NPM. Port 80 uses ACME, and port 443 reverse-proxies to
127.0.0.1:8091. Enable WebSocket and setclient_max_body_size 525M; the configuration file is located at/opt/web/npm-data/nginx/proxy_host/23-vault.conf. - Intranet penetration: In
frpc.tomlon.164, addvault.xiejun-server.toptoweb-https/web-http. - Certificate: Reuse the Let's Encrypt multi-domain certificate for
xiejun-server.top, and configurerenew_hookto executedocker exec npm nginx -s reload. - Verification and initialization: Accessing
https://vault.xiejun-server.top/should return 200; check the domain in/api/config; after registering the first account, changeSIGNUPS_ALLOWEDtofalseand restart the container. Access the admin panel at/adminand log in withADMIN_TOKEN. - Usage: Change existing service passwords one by one to random strong passwords and store them in Vaultwarden; enable TOTP for important services; confirm weekly that backups include
vaultwarden-data.