
Install Vaultwarden with Docker
This guide shows how to self-host Vaultwarden, a lightweight open-source server compatible with the Bitwarden password manager, with Docker Compose on your Linux server. It covers automatic backups, HTTPS via a reverse proxy and connecting the official Bitwarden apps.
Step 1: Create the Docker Compose File
Log in to your server via SSH, create a directory for Vaultwarden, and open the Compose file:
Paste the following content into the file. This configuration includes Vaultwarden itself and an automatic weekly, password-protected backup of your vault data. Replace vault.yourdomain.com with your domain and YOUR_BACKUP_PASSWORD with a secure password:
Binding to 127.0.0.1:8080 ensures Vaultwarden is only accessible locally. External access is handled by the reverse proxy in Step 3.
Step 2: Start the Containers
The backup container uploads backups via rclone. First create an rclone remote named BitwardenBackup (e.g. SFTP or S3 storage outside the server) with the first command, then start both containers:
Docker will pull the required images and start both containers in the background.
Step 3: Set Up a Reverse Proxy for HTTPS (Required)
A password manager must only be accessed over a secure HTTPS connection. The container exposes the web server on port 8080 locally — this should never be opened directly to the internet.
You must set up a reverse proxy to forward traffic from your public domain (e.g. https://vault.yourdomain.com) to the local Vaultwarden container (http://localhost:8080). The reverse proxy also handles the SSL certificate for HTTPS. Common options are Nginx Proxy Manager, Traefik, or Caddy.
Critical: Never access or use your Vaultwarden instance over an unencrypted HTTP connection. Always use a reverse proxy with a valid SSL certificate before creating any accounts or storing any passwords.
Step 4: Create Your Account
Once your reverse proxy is set up and HTTPS is working, you can create your main account. Afterwards, consider adding SIGNUPS_ALLOWED=false to the environment section and restarting with docker compose up -d, so that nobody else can register:
https://vault.yourdomain.com)Step 5: Connect Bitwarden Clients
All official Bitwarden browser extensions and mobile apps are fully compatible with your self-hosted Vaultwarden instance:
https://vault.yourdomain.com)Further Documentation
For advanced configuration options, environment variables, and admin panel setup, refer to the official Vaultwarden documentation.