What is Bitwarden
Bitwarden is a password manager with client support for most operating systems (Windows, Linux, MacOS). This software is distributed with open source code and gives users the ability to choose to store passwords both on the company's servers and to deploy their own Bitwarden server to store passwords. One of the features of Bitwarden are applications of different formats, web version, browser extension, desktop applications, and mobile applications.
Preparing the system for installation
To install the password manager, you need to update the system's packages.
sudo apt update && apt upgrade
Install the Apache and Curl packages.
sudo apt install apache2 curl -y
Next you need to install Docker, but before that, let's install the dependencies.
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
Add gpg keys from Docker.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add repository of docker to your system.
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
Installing Docker
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose
After installing Docker, you need to add a user to the "docker" group.
sudo usermod -aG docker *username*
Installing Bitwarden
The next step will require asking for a hosting ID and key to install.
Go to the BitWarden website, enter your admin email, and get the information you need.
Note: The ID and key must be kept in a safe place.
Load Bitwarden code.
curl -Lso bitwarden.sh https://go.btwrdn.co/bw-sh
To install BitWarden you will need a normal script that you can open by running the command below.
cat bitwarden.sh
BitWarden uses preinstalled configs, so after installing it you can check its functionality at once and after installing it you can configure it in the way you need.
The script needs to be made executable.
Use the command below to check the rights granted.
Install BitWarden using the installation script.
sudo ./bitwarden.sh install
Enter the required data following the installation.
Wait for BitWarden to install.
When the installation is complete, you are required to enter the installation ID and key that we received earlier.
Do you have ssl keys? If you don't have them, it can be added later.
Do you want to use self-signed ssl certificates ?
The installation was successful.
Starting Bitwarden
You need to configure the config before running it. Set it up with any text editor.
nano ./bwdata/config.yml
To avoid problems with the web interface, change the port of your choice.
In this publication we disabled ssl certificate support by putting "false" to the ssl line.
Note: If you have trouble starting the system, change the port in the docker config to the same port you use for Bitwarden.
nano ./bwdata/docker/docker-compose.yml
The password manager is started thanks to the command.
sudo ./bitwarden.sh start
The first time you run it, you will need to wait for a while for Bitwarden to create everything you need for it to work.
After a successful start, you will see a message that the web interface is ready.
Go to the web interface using the ip address of your server.
When creating a user, note that the password linked to the account is the main key to access all passwords, and you can leave a hint for it not to be forgotten.
Conclusion
With this publication you will easily install Bitwarden and get it up and running for your needs.