24. March 2022

How to Install Bitwarden Password Manager on Debian 11

By H. Cemre Günay

Bitwarden is an open-source solution that lets you manage your accounts and protect them with passwords of varying complexity. For this purpose, the program also offers a two-step authentication process, among other things.

As with most popular password managers, Bitwarden secures data using 256-bit AES encryption. The data vault is then accessed via a master password, which they must assign during the installation process.

The Bitwarden desktop client for Windows, Linux or macOS is available for download on the project’s website. The free app for Android and iOS, on the other hand, can be downloaded directly from the Google Play Store or the Apple Store. Alternatively, you can also open Bitwarden via a web browser and thus, for example, also conveniently retrieve your data recorded on the iPad via the PC.

In this post, we will show you how to install the Bitwarden password manager on Debian 11. Please don’t forget if you are root, you don’t need to use sudo. I recommend to access this VM via root.

Step 1: Install Docker

Bitwarden provides a free version that you can install with Docker. By default, the latest version of Docker is not included in the Debian 11 default repository. So you will need to install it from Docker’s official repository.

# First, install all required dependencies using the following command:
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

# Once all the dependencies are installed, download and add the GPG key with the following command:
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# Next, add the Docker CE repository to the APT using the following command:
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list

# Next, update the repository and install the Docker CE with the following command:
apt-get update -y
apt-get install docker-ce docker-ce-cli containerd.io -y

After Installation

# Once the installation has been completed, you can verify the Docker CE version using the following command:
docker --version

# You will get the following output:
Docker version 20.10.9, build c2ea9bc

You can also check the status of the Docker with the following command:

systemctl status docker

# You should see the following output:
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-02-22 03:38:57 CST; 47min ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 2167 (dockerd)
      Tasks: 57
     Memory: 830.2M
        CPU: 2min 21ms
     CGroup: /system.slice/docker.service
             ├─2167 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
             ├─6809 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 443 -container-ip 172.19.0.9 -container-port 84>
             ├─6816 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 443 -container-ip 172.19.0.9 -container-port 8443
             ├─6828 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 80 -container-ip 172.19.0.9 -container-port 8080
             └─6835 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 80 -container-ip 172.19.0.9 -container-port 8080

Step 2: Install Docker Compose

# Next, download the latest version of Docker Composer with the following command:
wget https://github.com/docker/compose/releases/download/v2.0.1/docker-compose-linux-x86_64

# Next, copy the downloaded binary to the system path using the following command:
mv docker-compose-linux-x86_64 /usr/bin/docker-compose

# Next, set the execution permission to the Docker Compose binary:
chmod 755 /usr/bin/docker-compose

Step 3: Install Bitwarden on Debian 11

First visit https://bitwarden.com/host/ to get your personalized Installation ID and Key, which you will need later in the installation process:

After providing Email Address, click on the submit button. You will get the installation id and key on the following screen.

Now, download the Bitwarden installation script using the following command:

curl -Lso bitwarden.sh https://go.btwrdn.co/bw-sh

# Once the script is downloaded, set the execution permission with the following command:
chmod +x bitwarden.sh

# Next, start the installation using the following command:
./bitwarden.sh install

You will be asked to provide your domain name or IP address, SSL certificate and vault as shown below:

 _     _ _                         _            
| |__ (_) |___      ____ _ _ __ __| | ___ _ __  
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \ 
| |_) | | |_ \ V  V / (_| | | | (_| |  __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_|  \__,_|\___|_| |_|

Open source password management solutions
Copyright 2015-2022, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden

===================================================

bitwarden.sh version 2.26.1
Docker version 20.10.12, build c2ea9bc
docker-compose version 2.0.1, build unknown

(!) Enter the domain name for your Bitwarden instance (ex. bitwarden.example.com): 192.168.178.50

(!) Do you want to use Let's Encrypt to generate a free SSL certificate? (y/n): n

(!) Enter the database name for your Bitwarden instance (ex. vault): vault

Provide all required information then press Enter. You will be asked to provide your installation id and key as shown below:

Digest: sha256:29bd0777de8b902bd26a67f74c832c8032f1bea41e716277a98f7d439a8f2912
Status: Downloaded newer image for bitwarden/setup:1.43.0
docker.io/bitwarden/setup:1.43.0

(!) Enter your installation id (get at https://bitwarden.com/host): xxxxxxx-xxxxxx-xxxx-xxxx-xxxxxxxxxx

(!) Enter your installation key: xxxxxxxxxxx

(!) Do you have a SSL certificate to use? (y/n): n

(!) Do you want to generate a self-signed SSL certificate? (y/n): y

Provide all required information then hit the Enter to start the installation. Once the installation has been finished, you will get the following output:

Generating self signed SSL certificate.
Generating a RSA private key
.....++++
...........................................................................................................................++++
writing new private key to '/bitwarden/ssl/self/69.28.84.207/private.key'
-----
Generating key for IdentityServer.
Generating a RSA private key
........................................................................................................................................................................++++
..............................................................................................................++++
writing new private key to 'identity.key'
-----

!!!!!!!!!! WARNING !!!!!!!!!!
You are using an untrusted SSL certificate. This certificate will not be 
trusted by Bitwarden client applications. You must add this certificate to 
the trusted store on each device or else you will receive errors when trying 
to connect to your installation.

Building nginx config.
Building docker environment files.
Building docker environment override files.
Building FIDO U2F app id.
Building docker-compose.yml.

Installation complete

If you need to make additional configuration changes, you can modify
the settings in `./bwdata/config.yml` and then run:
`./bitwarden.sh rebuild` or `./bitwarden.sh update`

Next steps, run:
`./bitwarden.sh start`

Next, start the Bitwarden using the following command:

./bitwarden.sh start

# You will get the following output:
 _     _ _                         _            
| |__ (_) |___      ____ _ _ __ __| | ___ _ __  
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \ 
| |_) | | |_ \ V  V / (_| | | | (_| |  __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_|  \__,_|\___|_| |_|

Open source password management solutions
Copyright 2015-2022, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden

===================================================

bitwarden.sh version 2.26.1
Docker version 20.10.12, build c2ea9bc
docker-compose version 2.0.1, build unknown

Pulling mssql         ... done
Pulling web           ... done
Pulling attachments   ... done
Pulling api           ... done
Pulling identity      ... done
Pulling sso           ... done
Pulling admin         ... done
Pulling portal        ... done
Pulling icons         ... done
Pulling notifications ... done
Pulling events        ... done
Pulling nginx         ... done

Creating network "docker_default" with the default driver
Creating network "docker_public" with the default driver
Creating bitwarden-web           ... done
Creating bitwarden-mssql         ... done
Creating bitwarden-sso           ... done
Creating bitwarden-icons         ... done
Creating bitwarden-attachments   ... done
Creating bitwarden-identity      ... done
Creating bitwarden-notifications ... done
Creating bitwarden-api           ... done
Creating bitwarden-events        ... done
Creating bitwarden-admin         ... done
Creating bitwarden-portal        ... done
Creating bitwarden-nginx         ... done
1.43.0: Pulling from bitwarden/setup
Digest: sha256:29bd0777de8b902bd26a67f74c832c8032f1bea41e716277a98f7d439a8f2912
Status: Image is up to date for bitwarden/setup:1.43.0
docker.io/bitwarden/setup:1.43.0


Bitwarden is up and running!
===================================================

visit https://192.168.178.50
to update, run `./bitwarden.sh updateself` and then `./bitwarden.sh update`

Step 4: Access Bitwarden Web Interface

Now, open your web browser and access the Bitwarden web interface using the URL https://your-server-ip or https://yourdomain.com. You will get the following page:

Click on the Create Account button. You will get the following page:

Provide your email, name, master password and click on the Submit button. You will get to the Bitwarden login screen:

After login you should see the Bitwarden dashboard on the following page:

Congratulations! you have successfully installed Bitwarden password manager on Debian 11. Feel free to ask me if you have any questions. 🙂