Install and deploy Bitwarden on Ubuntu 20.04 LTS

Install and deploy Bitwarden on Ubuntu 20.04 LTS

November 18, 2021 Linux Security Ubuntu 0
bitwarden

Today we will install Bitwarden server on-premise on Ubuntu 20.04 LTS as a KeePassXC alternative

What is Bitwarden?

Prerequisites:

  • VM with Ubuntu 20.04 LTS (2xCPU, 4GB RAM, 50GB HDD)
  • Docker Engine
  • Docker Compose
  • Bitwarden

Task:

  • Install Docker Engine
  • Install Docker Compose
  • Create bitwarden user and directory
  • Install Bitwarden

Install Docker Engine

1. Update and Install dependiencies

sudo apt-get update
sudo apt-get install 
    ca-certificates 
    curl 
    gnupg 
    lsb-release

2. Add Docker’s offcial GPG key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

3. Install Docker

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

4. Test the installation od Docker

docker --version
docker run hello-world

Install Docker Compose

1. Download stable Docker Compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

2. Set permissions

sudo chmod +x /usr/local/bin/docker-compose

3. Test the installation

docker-compose --version

Create bitwarden user and directory

1. Create bitwarden user

sudo adduser bitwarden

2. Set password for new bitwarden user

sudo passwd bitwarden

3. Create a docker group

sudo groupadd docker

4. Add the bitwarden user to the docker group

sudo usermod -aG docker bitwarden

5. Create a bitwarden directory

sudo mkdir /opt/bitwarden

6. Set permissions

sudo chmod -R 700 /opt/bitwarden
sudo chown -R bitwarden:bitwarden /opt/bitwarden

Install Bitwarden

1. Download Bitwarden installation script – bitwarden.sh

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

2. Run installation script

sudo ./bitwarden.sh install

Official Documentation

Install Bitwarden on-premise

Install Docker Engine on Ubuntu

Install Docker Compose

How to use Bitwarden Browser Extension

 

Leave a Reply

Your email address will not be published. Required fields are marked *