Skip to content

Installing Vaultwarden with Docker Compose

This guide shows a simple way to install Vaultwarden using Docker Compose on Ubuntu.

Vaultwarden is a lightweight, self-hosted password manager compatible with Bitwarden clients.

Official project:

Create the project folder

mkdir -p ~/docker/vaultwarden
cd ~/docker/vaultwarden

Create the Docker Compose file

Create:

nano docker-compose.yml

Paste:

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    ports:
      - "8122:80"
    volumes:
      - ./data:/data
    restart: unless-stopped

Start Vaultwarden

Run:

docker compose up -d

Access Vaultwarden

Open:

http://YOUR_SERVER_IP:8122

Example:

http://192.168.1.50:8122

Notes

  • All Vaultwarden data is stored in the data folder
  • Reverse proxy + HTTPS is strongly recommended for internet access
  • Compatible with official Bitwarden apps and browser extensions

Personal Production Setup (For Reference Only)

This is my current Vaultwarden setup.

It is NOT required for a standard installation.

This is my personal production configuration and may include host-specific settings. It is not intended as a copy-paste template.

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    stop_grace_period: 60s
    user: 1000:1000

    environment:
      - ROCKET_ENV=production
      - ROCKET_PORT=8080
      - ROCKET_WORKERS=10
      #- SIGNUPS_ALLOWED=FALSE #untag these two variables if installing vaultwarden again.
      #- ADMIN_TOKEN=<REDACTED>
      - LOG_FILE=/data/log/my.log
      - TZ=America/Santo_Domingo

      - DATABASE_BACKUP_ENABLED=true
      - DATABASE_BACKUP_INTERVAL=6
      - DATABASE_BACKUP_KEEP=14

    volumes:
      - ./data:/data

    ports:
      - 8122:8080

    security_opt:
      - no-new-privileges:true

    restart: unless-stopped