Monday, July 15, 2024

Deploy Bitwarden server locally using Docker

Date:

Bitwarden is one of the best password managers on the market. He just doesn’t Features include Which makes it ideal at home with teams and organizations, but you can also deploy your own tool instance, so you don’t have to worry about your company’s most sensitive data being synced, shared, or saved on a third party server. This is a great option for companies that work with very sensitive account details, notes, and identities.

Thank you dockerThe process of deploying Bitwarden in-house is actually very easy. I will walk you through the steps, so that you can use this password manager service within your LAN. You can deploy it on a single machine in your data center or even a virtual machine hosted on an external cloud service.

What will you need

Here’s what you’ll need to make this work:

  • A running instance of a Docker-enabled operating system (I’ll demonstrate this on Ubuntu Server 22.04).
  • A user with sudo privileges.
  • SMTP server (I will explain the use of the Gmail SMTP service).

That’s it. Let’s get to work.

How to install Docker CE

If you haven’t installed Docker, here are the steps to do so.

First, add the official Docker GPG key with the command:

Next, add the Docker repository:

Before you can install Docker, you have to install some dependencies with the command:

proper update with:

Finally, we can install the latest version of the Docker CE runtime engine:

Add your user to the docker group with:

Sign out and sign back in for the changes to take effect.

Deploy Bitwarden with Docker

We are now ready to deploy Bitwarden. First, download the helpful script the company created for this process with the command:

Once downloaded, run the install command with:

During installation, you will be asked the following questions:

  • Enter the domain name of your Bitwarden instance – if you don’t have a domain, you can use your hosting server’s IP address.
  • Want to use Let’s Encrypt to generate a free SSL certificate? (y / n) – if you do not have a domain associated with this server, you must specify n.
  • Enter your installation ID – this can be accessed by visiting https://bitwarden.com/host
  • Enter the installation key – this key will be presented on the same page as the installation ID.
  • Do you have an SSL certificate to use? (y / n) – If you have an SSL certificate, write y, otherwise write n.
  • Do you want to generate a self-signed SSL certificate? (y/n) – If you don’t have an SSL certificate, answer yes.
See also  Devolver makes fun of Sonic Origins' weird DLC and pre-order bonuses

It is crucial that you use an SSL certificate, otherwise you will not be able to create an account or use a number of Bitwarden’s features.

Once the installation is complete, you will need to configure the environment variables for the SMTP server. If you are using Gmail SMTP servers and 2FA is enabled for your account, you will need to create an app password, which can be done here.

SMTP server configuration

To configure the SMTP server, open the global env file with the command:

In this file, find the following lines:

If you are using Gmail SMTP servers, change everything marked REPLACE to:

  • Replace replyTo_email with your email address.
  • Replace smtp__host with smtp.gmail.com.
  • Replace smtp__username with your Gmail address.
  • Replace smtp__password with the application password you created.

If you are using a different SMTP server, make sure to configure it as necessary.

Save and close the file.

Restart the Bitwarden instance with:

Once the Bitwarden service has restarted, open a web browser and point it to https://SERVER (where SERVER is the IP address or domain of your hosting server). You will be greeted by the Bitwarden login screen (Fig. 1).

Figure 1: Bitwarden login screen.

Click Create Account, and in the resulting window (Fig. 2), fill in the information needed for the new account and click Create Account.

Figure 2: Creating a new account for your on-premises Bitwarden instance.

You will then be taken back to the login screen, where you can log in with your new account. In the resulting window (Fig. 3), click Send Email in the Email Verification box. An email will be sent where you can then verify the new account.

Figure 3: The main Bitwarden window, showing the need for initial account verification.

And that’s all it takes to deploy a local instance of the Bitwarden password manager server. Enjoy that extra level of privacy for your most important secrets.

groupCreated with Sketch.
Ignacio Javier
Ignacio Javier

"Lifelong beer expert. General travel enthusiast. Social media buff. Zombie maven. Communicator."

POPULAR

RELATED ARTICLES