How to install Vaultwarden with Docker

Vaultwarden Logo

Vaultwarden is a lightweight, open-source password manager and a Bitwarden-compatible server. It allows you to self-host your own secure vault for passwords, notes, and other sensitive information. The easiest way to install Vaultwarden is by using its official Docker image.

Prerequisites:
  • A server running a modern Linux distribution (e.g., Ubuntu 22.04). Vaultwarden is very lightweight.
  • Docker and Docker Compose installed. You can find the official guide here: Install Docker Engine on Ubuntu.
  • A domain name pointing to your server's IP address. This is required for a secure setup with HTTPS.

Installation Steps

First, log into your server via SSH. Create a directory for your Vaultwarden project and then create the docker-compose.yml file within it.

Create Directory and File
mkdir vaultwarden cd vaultwarden nano docker-compose.yml

Paste the following content into the docker-compose.yml file. This configuration also includes an automatic weekly backup of your vault data.

docker-compose.yml
version: '3' services: vaultwarden: image: vaultwarden/server:latest restart: always volumes: - ./vw-data:/data ports: - 127.0.0.1:8080:80 backup: image: ttionya/vaultwarden-backup:latest restart: always volumes: - ./vw-data:/data - ./backups:/backups environment: - CRON=0 0 * * 0 - BACKUP_ZIP=true - BACKUP_DAYS=7