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:
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.
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.
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.
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.
Looks like the Bitwarden_RS people provide a nice tutorial on how to enable HTTPS here. I run it behind a reverse proxy.
Hi Patrick, I followed the Bitwarden_RS wiki to enable HTTPS, which points to another page to help generating the certificates and keys and so on.
The part I’m missing is to know where to put the files so that they are “accessible” by the docker machine.
Also I don’t understand (yes it is a lack of knowledge on my side) the need of being behind a reverse proxy (and also what is a reverse proxy)…
Thanks for your help.
You can access the files inside the docker volume on the host machine. Docker volumes are typically stored on the host file system at the following path: /var/lib/docker/volumes/ . A reverse proxy gives you a secure way to access your self-hosted applications without using a VPN. You can read more about them Here.
Using your tutorial, I setup Bitwarden, except I am unable to create an account. It throws an error within the JS. I have version 2.15.1 installed. Anyone seeing the same issue.
What browser are you using?
Hello. I have encountered the same problem. Hello. I ran into the same problem. I can’t create an account.
My browser is Chrome 84, Windows.
When I got the site to support HTTPS, the problem went away!
I used a Nginx reverse proxy.
How do you update this? If I run the bitwarden_rs update process with the docker image bitwardenrs/server:raspberry I don’t get the latest version.