[GH-ISSUE #1072] Bitwarden rs isn't finding web-vault when running as non-root #759

Closed
opened 2026-03-03 02:02:55 +03:00 by kerem · 2 comments
Owner

Originally created by @hoshsadiq on GitHub (Jul 25, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1072

Hello, I'm trying to run bitwarden_rs as a non-root user docker, so I've extended the Dockerfile to add the necessary new user, fix the ownership of all relevant directories, then finally start bitwarden_rs. After a lot of trial and error, I am currently stuck where bitwarden_rs complains about not finding the web-vault. It works fine when running as root, but not as the newly created user.

I've even tried setting using export WEB_VAULT_FOLDER=/web-vault/ but to no avail. What am I doing wrong?

The log entries:

[2020-07-25 16:55:32][bitwarden_rs][ERROR] Web vault is not found. To install it, please follow the steps in:
[2020-07-25 16:55:32][bitwarden_rs][ERROR] https://github.com/dani-garcia/bitwarden_rs/wiki/Building-binary#install-the-web-vault
[2020-07-25 16:55:32][bitwarden_rs][ERROR] You can also set the environment variable 'WEB_VAULT_ENABLED=false' to disable it

Note: I've tried increasing logging, but this is all that's being returned.

The dockerfile I'm using:

FROM bitwardenrs/server:alpine

# FROM bitwardenrs/server:raspberry

RUN set -eux; \

    addgroup -g 2977 -S bwrs; \
    adduser -u 2977 -D -S -G bwrs bwrs; \

    rm -rf /data/icon_cache; \
    chown -R bwrs:bwrs /web-vault

COPY ./fix-own.sh /fix-own.sh

ENTRYPOINT [ "/fix-own.sh" ]
CMD [ "/start.sh" ]
#!/usr/bin/env sh
set -e
chown -R "bwrs:bwrs" "/data"
exec su - -s /bin/sh "bwrs" "$@"
Originally created by @hoshsadiq on GitHub (Jul 25, 2020). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1072 Hello, I'm trying to run bitwarden_rs as a non-root user docker, so I've extended the Dockerfile to add the necessary new user, fix the ownership of all relevant directories, then finally start bitwarden_rs. After a lot of trial and error, I am currently stuck where bitwarden_rs complains about not finding the web-vault. It works fine when running as root, but not as the newly created user. I've even tried setting using `export WEB_VAULT_FOLDER=/web-vault/` but to no avail. What am I doing wrong? The log entries: ``` [2020-07-25 16:55:32][bitwarden_rs][ERROR] Web vault is not found. To install it, please follow the steps in: [2020-07-25 16:55:32][bitwarden_rs][ERROR] https://github.com/dani-garcia/bitwarden_rs/wiki/Building-binary#install-the-web-vault [2020-07-25 16:55:32][bitwarden_rs][ERROR] You can also set the environment variable 'WEB_VAULT_ENABLED=false' to disable it ``` Note: I've tried increasing logging, but this is all that's being returned. The dockerfile I'm using: ```Dockerfile FROM bitwardenrs/server:alpine # FROM bitwardenrs/server:raspberry RUN set -eux; \ addgroup -g 2977 -S bwrs; \ adduser -u 2977 -D -S -G bwrs bwrs; \ rm -rf /data/icon_cache; \ chown -R bwrs:bwrs /web-vault COPY ./fix-own.sh /fix-own.sh ENTRYPOINT [ "/fix-own.sh" ] CMD [ "/start.sh" ] ``` ```shell #!/usr/bin/env sh set -e chown -R "bwrs:bwrs" "/data" exec su - -s /bin/sh "bwrs" "$@" ```
kerem 2026-03-03 02:02:55 +03:00
Author
Owner

@BlackDex commented on GitHub (Aug 16, 2020):

Hello @hoshsadiq i would suggest to checkout: https://github.com/dani-garcia/bitwarden_rs/wiki/Hardening-Guide#run-as-a-non-root-user

<!-- gh-comment-id:674531382 --> @BlackDex commented on GitHub (Aug 16, 2020): Hello @hoshsadiq i would suggest to checkout: https://github.com/dani-garcia/bitwarden_rs/wiki/Hardening-Guide#run-as-a-non-root-user
Author
Owner

@BlackDex commented on GitHub (Nov 18, 2020):

Closing this ticket because of inactivity.
Feel free to re-open if the issue isn't resolved using the testing/master version or the mentioned option in the comments above.

<!-- gh-comment-id:729633050 --> @BlackDex commented on GitHub (Nov 18, 2020): Closing this ticket because of inactivity. Feel free to re-open if the issue isn't resolved using the `testing`/`master` version or the mentioned option in the comments above.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#759
No description provided.