Deploying a Vaultwarden App
Introduction
Vaultwarden is a lightweight Bitwarden-compatible server built in Rust. This guide shows how to containerize Vaultwarden with a Dockerfile, secure it with environment variables, persist your vault data, and deploy it to Klutch.sh over HTTP.
Prerequisites
- GitHub repository containing your Dockerfile.
- Klutch.sh project ready in klutch.sh/app.
- Plan for admin token management and TLS termination at the edge.
Project structure
.└── DockerfileSample Dockerfile
FROM vaultwarden/server:latest
# Default HTTP portENV ROCKET_PORT=80EXPOSE 80Required environment variables
DOMAIN– public URL, e.g.,https://example-app.klutch.shADMIN_TOKEN– strong token for the admin panelROCKET_PORT=80– internal port
Recommended environment variables
SIGNUPS_ALLOWED=false– restrict open registrationINVITATIONS_ALLOWED=true– allow invites while signups are closedWEB_VAULT_ENABLED=trueLOG_LEVEL=info
Persistence
Vaultwarden stores data locally by default (SQLite plus attachments):
- Mount path:
/data - Size: match expected vault size and file attachments
Networking
- Protocol: HTTP
- Internal port:
80 - Users reach
https://example-app.klutch.shwhile Klutch.sh routes to port80inside the container.
Health check (recommended)
curl -I http://localhost:80Deployment on Klutch.sh
- Push your Dockerfile to GitHub.
- In klutch.sh/app, create a new app and select GitHub as the source.
- Klutch.sh automatically detects the Dockerfile in the repository root.
- Select HTTP traffic and set the internal port to
80. - Add environment variables for
DOMAIN,ADMIN_TOKEN, and your signup policy (SIGNUPS_ALLOWED,INVITATIONS_ALLOWED). Mark secrets as sensitive. - Attach a persistent volume at
/datasized for vault data and attachments. - Deploy. Sign in via the public URL and use the admin token to configure your instance.
Verification
- UI: open
https://example-app.klutch.shand confirm the login page loads. - Admin: visit
https://example-app.klutch.sh/adminand authenticate with your admin token.
Next steps
- Enable 2FA and enforce strong master passwords.
- Schedule backups of the
/datavolume. - Rotate the
ADMIN_TOKENperiodically and keep it in a secure secret manager.