Running Bitwarden on a Raspberry Pi using Docker is Easy!

Bitwarden

Introduction

Bitwarden is an open-source password manager that can be self-hosted at home to keep your passwords and other private data secure. The official Bitwarden image only supports the amd64 architecture and I needed a container that I could run on my Raspberry Pi 4 cluster. Luckily I found Bitwarden_rs which is not as resource intensive as the official image and is perfect for small self-hosted environments. You can check out my Bitwarden review here. If you do not have Docker installed on your Raspberry Pi you can view the steps to get it up and running here.

In order to locate which container to run I checked their Github Wiki and found that I need the bitwardenrs/server:raspberry image which is armv7hf compatible. This container image also includes an SQLite database which works well for one or two users.

Creating a Volume to Store Data

First, create a docker volume specifically for Bitwarden:

docker volume create bitwarden

Run command for Bitwarden_RS

Then, run the following command:

docker run \
-p 8005:80 \
-v bitwarden:/config \
--name bitwarden \
--restart always \
bitwardenrs/server:raspberry

Once the container is running, you can access your installation by visiting http://RASPBERRYPIIP:8005. You should see this screen:

Bitwarden Login Screen

Create your account and login. Because this installation is pre-configured to use an SQLite back end, no additional configuration is needed.

Enabling the Admin Page

If you want to enable the Bitwarden admin page to make changes to the configuration you need to redeploy the container and add -e ADMIN_TOKEN=random_token to your run command. It is recommended that you generate a random token by opening your terminal app and running openssl rand -base64 48. Keep that code and place it in place of random_token in the below docker run command:

docker run \
-p 8005:80 \
-e ADMIN_TOKEN=random_token \
-v bitwarden:/config \
--name bitwarden \
--restart always \
bitwardenrs/server:raspberry

Once the container is back up and running, you can access the admin interface by visiting http://RASPBERRYPIIP:8005/admin/. You will be prompted to enter the token that you previously generated. Once you enter the token you should have access to the admin interface.

4 Comments

  1. Thanks for this post – giving it a go now.
    I found that I was getting an issue pasting your script int “docker: invalid reference format.” – there is a tab or a space on the end of row 6 of your script. Popping it into notepad, tidying it up and pasting it into a terminal fixed it for me.

    • Jon,

      Great catch! Thank you for the fix. I updated the code. If it continues to give you problems, please let me know! I hope you were able to get Bitwarden up and running.

      -Patrick

  2. Patrick,
    Thanks for the wonderful tutorial. I had no trouble getting up and running. Only problem is: how do I run it with https:// ? Android apps insist it be run with SSL. If I can get a certificate where do I put it.

    Thanks again.
    Alan

Leave a Reply

Your email address will not be published.


*