How to install Bitwarden Server with Sendgrid SMTP on Ubuntu 20.04

Install Bitwarden server with sendgrid smtp with ubuntu 20.04 & 22.04
  • 2GB RAM
  • 15GB Storage
  • A user with administrative privileges
  • Sendgrid account

Step 1: Update the system

sudo apt update

Step 2: Install Dependencies

sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Step 3: Install Docker and Docker Compose

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose

Step 4: Create a User for Bitwarden

sudo adduser bitwarden
sudo usermod -aG docker bitwarden
sudo mkdir /opt/bitwarden
sudo chown -R bitwarden:bitwarden /opt/bitwarden
sudo chmod -R 700 /opt/bitwarden
su bitwarden

Step 5: Download Bitwarden Installation Script

curl -Lso bitwarden.sh https://go.btwrdn.co/bw-sh && chmod 700 bitwarden.sh
./bitwarden.sh install
  • Enter the domain name you would like to use to access your bitwarden server ie bitwarden.your-domain.com
  • When it asks to issue a free SSL certificate, type n
  • Now enter the database name for your Bitwarden instance ie vault.
Request Bitwarden Installation ID and Key
Copy bitwarden installation ID and Key

Step 6: Configuring Sendgrid SMTP Mail Server

  • Create a Sendgrid account to generate an apikey also verify sender authentication under your account settings.
  • Now lets edit our global.override.env file to set our SMTP values.
nano ~/bwdata/env/global.override.env
Configuring Sendgrid smtp with bitwarden

Step 7: Start the Server

./bitwarden.sh start
Starting the bitwarden server
Bitwarden starting page
  • Create a new account in order to access your vault
Bitwarden user account creation
  • Now login with your details to access your vault
Bitwarden vault
Bitwarden admin login page
  • Enter the email you added to the global.override.env under adminSettings__admins and a login link will be sent to your email.

Step 8: Setting Up the Client Application

  • Download the Bitwarden client from their official website as per your operating system.
  • After installing the client, run it and click on the Gear icon.
  • Add your Bitwarden Server URL where you have installed it. And click on the Save button.
  • Then create an account or login to your pre-existing account.
Sign in to bitwarden password manager client

Delete or reinstall the Bitwarden server

  • To delete
./bitwarden.sh stop
rm -r ~/bwdata
  • To reinstall run
./bitwarden.sh install
  • To delete all containers build for the server run,
docker stop $(docker ps -a -q)
docker rm -f $(docker ps -a -q)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store