Address already in use when starting Bitwarden_rs #1880

Closed
opened 2025-10-09 17:34:21 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @Jungack on GitHub.

Hello,
I am trying to run bitwarden_rs without docker on my server. However, I come to this error :
[bitwarden_rs][ERROR] Launch error Bind(Io(Os { code: 98, kind: AddrInUse, message: "Address already in use" }))
I am quite a noob sorry... In fact I think I don't know how to manage the .env file. After having compiled bitwarden_rs and installed the web-vault, I have copied the .env.template file to /bitwarden_rs/target/release/ and renamed It to bitwarden_rs.env. Then, I have modified WEBSOCKET_PORT=3012 to WEBSOCKET_PORT=3013 and ROCKET_PORT=8000 to ROCKET_PORT=8001. However, the same error is still there. What is wrong?
Thank you

Originally created by @Jungack on GitHub. Hello, I am trying to run bitwarden_rs without docker on my server. However, I come to this error : `[bitwarden_rs][ERROR] Launch error Bind(Io(Os { code: 98, kind: AddrInUse, message: "Address already in use" })) ` I am quite a noob sorry... In fact I think I don't know how to manage the `.env` file. After having compiled bitwarden_rs and installed the web-vault, I have copied the `.env.template` file to `/bitwarden_rs/target/release/` and renamed It to `bitwarden_rs.env`. Then, I have modified `WEBSOCKET_PORT=3012` to `WEBSOCKET_PORT=3013` and `ROCKET_PORT=8000` to `ROCKET_PORT=8001`. However, the same error is still there. What is wrong? Thank you
Author
Owner

@Jungack commented on GitHub:

How are you planning on starting the bitwardenrs process? If you are using systemd, the you could also load the env file into the environment with it: https://serverfault.com/a/413408

Thanks for replying ! I first wanted to start bitwarden_rs using cargo run --features sqlite --release. However you are right, after being able to use the previous command, I planned to use systemd to start bitwarden_rs on boot !
So how can I load the .env file first without systemd ?

@Jungack commented on GitHub: > How are you planning on starting the bitwardenrs process? If you are using systemd, the you could also load the env file into the environment with it: https://serverfault.com/a/413408 Thanks for replying ! I first wanted to start bitwarden_rs using `cargo run --features sqlite --release`. However you are right, after being able to use the previous command, I planned to use systemd to start bitwarden_rs on boot ! So how can I load the` .env` file first without systemd ?
Author
Owner

@Jungack commented on GitHub:

Hi @Jungack, bitwarden_rs is expecting file named .env so your file is very likely ignored and then bitwarden_rs defaults to port 80 which seems to be used.

Hello,

Thank you ! So you mean that I have to rename my bitwarden_rs.env file to just .env and put It in /bitwarden_rs/target/release/?

I have a LEMP stack on my server actually with Nextcloud (and Onlyoffice which is running port 8000). How can I change the default port used by Bitwarden_rs to remove all the conflicts?

Thank you !

@Jungack commented on GitHub: > Hi @Jungack, `bitwarden_rs` is expecting file named `.env` so your file is very likely ignored and then `bitwarden_rs` defaults to port `80` which seems to be used. Hello, Thank you ! So you mean that I have to rename my `bitwarden_rs.env` file to just `.env` and put It in `/bitwarden_rs/target/release/`? I have a LEMP stack on my server actually with Nextcloud (and Onlyoffice which is running port `8000`). How can I change the default port used by Bitwarden_rs to remove all the conflicts? Thank you !
Author
Owner

@mprasil commented on GitHub:

Hi @Jungack, bitwarden_rs is expecting file named .env so your file is very likely ignored and then bitwarden_rs defaults to port 80 which seems to be used.

@mprasil commented on GitHub: Hi @Jungack, `bitwarden_rs` is expecting file named `.env` so your file is very likely ignored and then `bitwarden_rs` defaults to port `80` which seems to be used.
Author
Owner

@fbartels commented on GitHub:

How are you planning on starting the bitwardenrs process? If you are using systemd, the you could also load the env file into the environment with it: https://serverfault.com/a/413408

@fbartels commented on GitHub: How are you planning on starting the bitwardenrs process? If you are using systemd, the you could also load the env file into the environment with it: https://serverfault.com/a/413408
Author
Owner

@fbartels commented on GitHub:

Like you would source any other file in your shell ;-)

source .env

@fbartels commented on GitHub: Like you would source any other file in your shell ;-) `source .env`
Author
Owner

@Jungack commented on GitHub:

Like you would source any other file in your shell ;-)

source .env

Ok tanks all is working ! Thank you for your patience !

@Jungack commented on GitHub: > Like you would source any other file in your shell ;-) > > `source .env` Ok tanks all is working ! Thank you for your patience !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1880