Bitwarden is an open souce password vault, that uses both cloud and selfhosted solutions. You can store encrypted notes or credit cards inside, and it uses a master password to lock, encrypt, and decrypt all the data. It also includes a pretty useful tool to create passwords with different options, so you don’t have to worry about being ingenious or memorizing all of them.
Requirements
To properly install Bitwarden, you will need:
- A Linux machine or VM.
- Internet access.
- Admin privileges.
In my case, I’ll be using an Ubuntu 20.04 VM hosted on Proxmox.
Preparing the system
Once you logged in on your machine, we need to install docker and docker-compose:
sudo apt install -y docker docker-compose
Let’s create the bitwarden user. Use the following command to do it, and follow the required steps.
sudo adduser bitwarden
Add the bitwarden user to the docker group:
sudo usermod -aG docker bitwarden
Create a bitwarden directory, where the application will be deployed:
sudo mkdir /opt/bitwarden
Set the needed permissions to the directory created below:
sudo chmod -R 700 /opt/bitwarden
And now, set bitwarden as the owner of that same directory:
sudo chown -R bitwarden:bitwarden /opt/bitwarden
Download and installing Bitwarden
Bitwarden offers a script to easy installation on Linux (also other OS). So it’s time to download that Bitwarden’s script:
curl -Lso bitwarden.sh https://go.btwrdn.co/bw-sh && chmod 700 bitwarden.sh
And now, execute it with the install option:
sudo ./bitwarden.sh install
This last command, will prompt some questions, so we will cover them:
Enter the domain name for your Bitwarden instance:
Just the domain name you want to use. This should be configured on a DNS.Do you want to use Let’s Encrypt to generate a free SSL certificate? (y/n):
If you want to use a free trusted SSL certificate, type y or yes and it will ask you an email to warn about the SSL Certificate expiration to renew it.Enter your installation ID:
Retrieve an installation ID using an email address at https://bitwarden.com/host.Enter your installation key:
Retrieve an installation KEY using an email address at https://bitwarden.com/host.Do you have a SSL certifiacte to use? (y/n):
If you already have your own, type y or yes and go to ./bwdata/ssl/your.domain and place there the necessary files.
If you specify n or no:Do you want to generate a self-signed SSL certificate? (y/n):
This option allows you to have an SSL certificate to secure connections. If you type n or no, you will need to redirect bitwarden with an HTTPS Proxy.
With all this steps covered, and the installation finished, just start Bitwarden:
sudo ./bitwarden.sh start
Here you have all the commands with the bitwarden.sh script:
Command | Description |
install | Start the installer. |
start | Start all containers. |
restart | Restart all containers (same as start). |
stop | Stop all containers. |
update | Update all containers and the database. |
updatedb | Update/initialize the database. |
updateself | Update this main script. |
updateconf | Update all containers without restarting the running instance. |
renewcert | Renew certificates. |
rebuild | Rebuild generated installation a ssets from config.yml. |
help | List all commands. |
Now, just connect to your Bitwarden’s IP with your web browser!