How to install Bitwarden?

Update: bitwarden_rs project has been renamed to vaultwarden. More details can be found here.

I was actually a huge fan of KeePassXC and believe that was likely the best option for most people. However, comparing Bitwarden‘s iOS mobile client with the KeePass iOS options available, the choice was obvious.

The following tutorial will teach you how to install Bitwarden (with Docker) on Debian:

  1. Update your package list

    sudo apt update

  2. Install Docker
  3. Install the required packages

    sudo apt install nginx python3-acme python3-certbot python3-mock python3-openssl python3-pkg-resources python3-pyparsing python3-zope.interface python3-certbot-nginx -y

  4. Install Bitwarden

    docker run -d --name vaultwarden -e SIGNUPS_ALLOWED=false -v /bw-data/:/data/ -p 8080:80 bitwardenrs/server:latest

  5. Create a new server block:

    sudo nano /etc/nginx/sites-available/bitwarden

    Copy and paste the following:

    server {
      listen 443 ssl http2;
      server_name vault.example.com;

      # Allow large attachments
      client_max_body_size 128M;

      location / {
        proxy_pass http://<REPLACE WITH YOUR IP>:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
      }

      location /notifications/hub {
        proxy_pass http://<REPLACE WITH YOUR IP>:3012;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
      }

      location /notifications/hub/negotiate {
        proxy_pass http://<REPLACE WITH YOUR IP>:8080;
      }
    }

  6. Create a symbolic link to enable this server block and restart nginx:

    sudo ln -s /etc/nginx/sites-available/bitwarden /etc/nginx/sites-enabled/
    sudo nginx -t
    sudo systemctl reload nginx

  7. Secure Bitwarden with Let’s Encrypt Free SSL

    sudo ufw allow 'Nginx Full'
    sudo certbot --nginx -d vault.example.com

2021-01-21

index