No Docker Installation help

Hello,

I am trying to install bitwarden_rs alongside an existing WordPress installation (all no docker, since my current WordPress and Nginx are not setup in docker). In order to try I setup a clone of my current server as testserver. I followed:

https://www.reddit.com/r/Bitwarden/comments/dg78bi/building_selfhosted_bitwarden_via_bitwarden_rs/?utm_source=amp&utm_medium=&utm_content=post_body

And

https://nickhuber.ca/blog/bitwarden-rs-without-docker

As far as I can tell successfully and installed rust and nodejs latest versions (I adjusted the versions to 14.15.3 for nodejs and 12.17.1 for bitwarden_rs).

Additionally I setup a bitwarden nginx config however without SSL since I am running it on a testserver and I am accessing the testserver directly via it’s IP and not a domain name.

Problem is, I am getting a 502 Bad Gateway error.
After further investigation and running the bitwarden_rs binary located in /opt/bitwarden

I am getting the following:

/--------------------------------------------------------------------
| Starting Bitwarden_RS |
| Version 1.17.0-175f2aea |
|--------------------------------------------------------------------|
| This is an unofficial Bitwarden implementation, DO NOT use the |
| official channels to report bugs/features, regardless of client. |
| Send usage/configuration questions or feature requests to: |
| *removed due to new user link restriction |
| Report suspected bugs/issues in the software itself at: |
| *removed due to new user link restriction |
--------------------------------------------------------------------/
[INFO] No .env file found.
[2020-12-21 14:52:12.323][bitwarden_rs][INFO] JWT keys don’t exist, checking if OpenSSL is available…
OpenSSL 1.1.1f 31 Mar 2020
[2020-12-21 14:52:12.331][bitwarden_rs][INFO] OpenSSL detected, creating keys…
genrsa: Can’t open “data/rsa_key.pem” for writing, No such file or directory
Can’t open data/rsa_key.pem for reading, No such file or directory
140238282646848:error:02001002:system library:fopen:No such file or directory:…/crypto/bio/bss_file.c:69:fopen(‘data/rsa_key.pem’,‘r’)
140238282646848:error:2006D080:BIO routines:BIO_new_file:no such file:…/crypto/bio/bss_file.c:76:
unable to load Private Key
Can’t open data/rsa_key.der for reading, No such file or directory
140316403193152:error:02001002:system library:fopen:No such file or directory:…/crypto/bio/bss_file.c:69:fopen(‘data/rsa_key.der’,‘rb’)
140316403193152:error:2006D080:BIO routines:BIO_new_file:no such file:…/crypto/bio/bss_file.c:76:
unable to load Private Key
[2020-12-21 14:52:12.356][bitwarden_rs][ERROR] Error creating keys, exiting…

I don’t know where to go from here. I also got to admit I am a hobbyist and tech enthusiast, but not a professional programmer or web developer.
I like self hosting and I have setup quite a few VPS. This just to let you know to what degree my knowledge extends. So please be patient with me if I am not directly able to follow your responses right away.

Any help is appreciated. Also if I should be doing it a total different way please let me know. My ultimate goal is Wordpress and Bitwarden_RS on the same VPS on two different subdomains.

Thank you for your help! Happy Holidays!

1 Like

Ok, I think I got a step closer. I created a “data” directory under /opt/bitwarden now it looks like this:

/--------------------------------------------------------------------
| Starting Bitwarden_RS |
| Version 1.17.0-175f2aea |
|--------------------------------------------------------------------|
| This is an unofficial Bitwarden implementation, DO NOT use the |
| official channels to report bugs/features, regardless of client. |
| Send usage/configuration questions or feature requests to: |
| https://vaultwarden.discourse.group/ |
| Report suspected bugs/issues in the software itself at: |
| * removed due to the new user link restriction |
--------------------------------------------------------------------/

[INFO] No .env file found.

[2020-12-23 02:32:05.765][bitwarden_rs][ERROR] Web vault is not found at ‘web-vault/’. To install it, please follow the steps in:
[2020-12-23 02:32:05.766][bitwarden_rs][ERROR] Building binary ¡ dani-garcia/vaultwarden Wiki ¡ GitHub
[2020-12-23 02:32:05.766][bitwarden_rs][ERROR] You can also set the environment variable ‘WEB_VAULT_ENABLED=false’ to disable it

Got it to work.

For whatever reason following these tutorials the web-vault was in an additional folder called web-vault so ultimately after I removed that additional folder and changed the structure

From:
/opt/bitwarden/web-vault/web-vault

To:
/opt/bitwarden/web-vault

It all works now.

So ultimately these tutorials worked for me, however
I had to make a few changes:

  1. Had to create a “data” directory /opt/bitwarden/data
  2. Had to install gcc linker for rust which in Ubuntu 20.04 was achieved by executing the following:

sudo apt install build-essential
sudo apt install libssl-dev
sudo apt install pkg-config

  1. Copy web-vault to /opt/bitwarden/web-vault
  2. Had to change the proposed systemd

From:

[Install]
WantedBy=local.target

To:

[Install]
WantedBy=multi-user.target

The question that remains is if it is better this way or if I should have migrated my Wordpress to Docker. Just don’t know enough about it (e.g. will a Docker container work with a non containerized nginx etc etc. ). Now I kind of worked it all out but I hope I could at least document it so that someone else won’t have the same issues that I had!

Love bitwarden_rs!