Docker

Vaultwarden Docker

Vaultwarden, formerly known as Bitwarden_RS, is a free, open-source server implementation of the Bitwarden password manager.

If you are not familiar, Bitwarden is an extremely feature-rich and popular password manager that allows you to store your credentials in a secure manner. It also allows you to access your credentials, such as passwords and sensitive information, from any device.

Although Bitwarden does provide a free version of the service, at the time of writing, it does require a paid subscription to get access to the full features. Vaultwarden is designed to be an alternative to Bitwarden, offering a self-hosted instance and absolute control over personal data.

Some of the noticeable features of Vaultwarden include:

  1. Self-hosting
  2. Heavy encryption
  3. Multi-platform.
  4. Extensive browser extension support
  5. Open-Source

In this tutorial, we are going to teach you how you can quickly and efficiently have the Vaultwarden password manager running on your machine by using the Docker engine.

Prerequisites

This tutorial follows a fundamental format for setting up Vaultwarden as a Docker container. However, ensure you have the following:

  1. A Linux, MacOS or Windows host
  2. Docker Engine version 23 and above is installed on the host.
  3. Sufficient permissions to run Docker containers.

With the above requirements met, we can proceed and discuss how to configure Vaultwarden.

Docker Pull Vaultwarden Image

The first step is to download the Vaultwarden image on the host machine. We can do this by running the Docker pull command as follows:

$ docker pull vaultwarden/server:latest

This should download the latest version of the Vaultwarden image on your machine and allow you to create containers from the image.

Docker Create Vaultwarden Container

Once we have downloaded the image, we can proceed and use the Docker run command to create a container using the image. The command is as shown:

$ docker run -d --name vaultwarden -v /vw-data/:/data/ -p 80:80 vaultwarden/server:latest

Once you run the above command, Docker will create a container using the Vaultwarden image. It will also preserve any persistent data under /vw-data and map port 80 on your host machine.

Configuring Vaultwarden

Once the container is running, open your browser and follow the address: http://vaultwarden.orb.local.

This will prompt you to login or create a new account for your Vaultwarden instance.

Since we are setting up the Vaultwarden instance for the first time, select Create Account to set up a new account on the server.

In this section, provide all the details for your account, such as the email, username, and master password.

Click Create Account to set up the account with the provided details. Once done, click login and login to the web interface with the specified credentials.

In some cases, Vaultwarden will prevent you from logging into the vault without an SSL certificate. You can configure the container to use HTTPS by setting the SSL certificate details as shown:

docker run -d --name bitwarden \

  -e ROCKET_TLS='{certs="/ssl/certs.pem",key="/ssl/key.pem"}' \

  -v /ssl/keys/:/ssl/ \

  -v /vw-data/:/data/ \

  -p 443:80 \

vaultwarden/server:latest

Ensure the specified certificate files exist before running the command above. You can learn more about configuring HTTPS for your vault in the resource below:

https://github.com/dani-garcia/vaultwarden/wiki/Enabling-HTTPS

Conclusion

This tutorial provides the basic features of quickly setting up and running a Vaultwarden instance using Docker containers.

About the author

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list