[GH-ISSUE #14754] feat: Add WEBUI_SECRET_KEY_FILE environment variable. #56020

Closed
opened 2026-05-05 18:31:20 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @MicahZoltu on GitHub (Jun 7, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14754

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

Docker Swarm secrets can only be added to the container as files, and only in a specific location (/run/secrets/*). Currently, in order to set the WEBUI_SECRET_KEY, you either need to provide the secret as an environment variable, or by providing a file at /app/backend/.webui_secret_key, neither of which are secure ways to manage secrets in Docker.

Desired Solution you'd like

Add an environment variable called WEBUI_SECRET_KEY_FILE which accepts the path to a file that holds the WebUI Secret Key. If this environment variable isn't present and the WEBUI_SECRET_KEY environment variable isn't present, then it would fallback to looking for the secret key in its current location in /app/backend/.webui_secret_key.

This way, a docker swarm user can setup a Docker Secret and then set WEBUI_SECRET_KEY_FILE to point at /run/secrets/my_secret.

Alternatives Considered

No response

Additional Context

No response

Originally created by @MicahZoltu on GitHub (Jun 7, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/14754 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description Docker Swarm secrets can only be added to the container as files, and only in a specific location (`/run/secrets/*`). Currently, in order to set the `WEBUI_SECRET_KEY`, you either need to provide the secret as an environment variable, or by providing a file at `/app/backend/.webui_secret_key`, neither of which are secure ways to manage secrets in Docker. ### Desired Solution you'd like Add an environment variable called `WEBUI_SECRET_KEY_FILE` which accepts the path to a file that holds the WebUI Secret Key. If this environment variable isn't present and the `WEBUI_SECRET_KEY` environment variable isn't present, then it would fallback to looking for the secret key in its current location in `/app/backend/.webui_secret_key`. This way, a docker swarm user can setup a Docker Secret and then set `WEBUI_SECRET_KEY_FILE` to point at `/run/secrets/my_secret`. ### Alternatives Considered _No response_ ### Additional Context _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#56020