[Docker] Unable to connect to database when using non-root user #155

Closed
opened 2025-11-07 06:26:07 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @JuniorJPDJ on GitHub (Dec 13, 2018).

I wanted to use non-root user and container didn't start.

bitwarden_1  | thread 'main' panicked at 'Can't conect to DB: BadConnection("Unable to open the database file")', src/libcore/result.rs:1009:5
Originally created by @JuniorJPDJ on GitHub (Dec 13, 2018). I wanted to use non-root user and container didn't start. ``` bitwarden_1 | thread 'main' panicked at 'Can't conect to DB: BadConnection("Unable to open the database file")', src/libcore/result.rs:1009:5 ```
GiteaMirror added the enhancementbug labels 2025-11-07 06:26:07 -06:00
Author
Owner

@dani-garcia commented on GitHub (Dec 17, 2018):

I'm not very knowledgeable in docker, but I imagine this is because the non-root user doesn't have permission in the data folder.

@dani-garcia commented on GitHub (Dec 17, 2018): I'm not very knowledgeable in docker, but I imagine this is because the non-root user doesn't have permission in the data folder.
Author
Owner

@bassarf commented on GitHub (Jan 16, 2019):

As far as I know, and as far as my 2 minute google research goes, this is a docker thing.
The docker deamon runs as root. But on the docker website there is a manual for non-root users to manage docker: https://docs.docker.com/install/linux/linux-postinstall/

IMO this issue should be closed because it is not specific to bitwarden_rs but rather being a docker thing

@bassarf commented on GitHub (Jan 16, 2019): As far as I know, and as far as my 2 minute google research goes, this is a docker thing. The docker deamon runs as root. But on the docker website there is a manual for non-root users to manage docker: https://docs.docker.com/install/linux/linux-postinstall/ IMO this issue should be closed because it is not specific to bitwarden_rs but rather being a docker thing
Author
Owner

@JuniorJPDJ commented on GitHub (Jan 16, 2019):

@bassarf that issue is not about starting container as non-root user, it's about dropping privileges of bitwarden_rs running in docker container to other (non-root) user.
Still, thank you for your interest, my description was misleading.

@JuniorJPDJ commented on GitHub (Jan 16, 2019): @bassarf that issue is not about starting container as non-root user, it's about dropping privileges of bitwarden_rs running in docker container to other (non-root) user. Still, thank you for your interest, my description was misleading.
Author
Owner

@Sohalt commented on GitHub (Feb 3, 2019):

You will have to set the correct permissions on the /data volume. In addition you need to adjust the ROCKET_PORT to something above 1024, as everything below is a privileged port and can only be opened by root.

@Sohalt commented on GitHub (Feb 3, 2019): You will have to set the correct permissions on the `/data` volume. In addition you need to adjust the `ROCKET_PORT` to something above 1024, as everything below is a privileged port and can only be opened by root.
Author
Owner

@mprasil commented on GitHub (Feb 24, 2019):

I've documented the procedure in wiki page, so I believe this is resolved. I ran the container as nobody following the wiki, but feel free to re-open or open new issue if you encounter any problems.

@mprasil commented on GitHub (Feb 24, 2019): I've documented the procedure in [wiki page](https://github.com/dani-garcia/bitwarden_rs/wiki/Running-docker-container-with-non-root-user), so I believe this is resolved. I ran the container as `nobody` following the wiki, but feel free to re-open or open new issue if you encounter any problems.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#155