๐ Environment Variable Configuration
Overviewโ
Open WebUI provides a large range of environment variables that allow you to customize and configure various aspects of the application. This page serves as a comprehensive reference for all available environment variables, providing their types, default values, and descriptions. As new variables are introduced, this page will be updated to reflect the growing configuration options.
This page is up-to-date with Open WebUI release version v0.6.9, but is still a work in progress to later include more accurate descriptions, listing out options available for environment variables, defaults, and improving descriptions.
Important Note on PersistentConfig
Environment Variablesโ
When launching Open WebUI for the first time, all environment variables are treated equally and can be used to configure the application. However, for environment variables marked as PersistentConfig
, their values are persisted and stored internally.
After the initial launch, if you restart the container, PersistentConfig
environment variables will no longer use the external environment variable values. Instead, they will use the internally stored values.
In contrast, regular environment variables will continue to be updated and applied on each subsequent restart.
You can update the values of PersistentConfig
environment variables directly from within Open WebUI, and these changes will be stored internally. This allows you to manage these configuration settings independently of the external environment variables.
Please note that PersistentConfig
environment variables are clearly marked as such in the documentation below, so you can be aware of how they will behave.
App/Backendโ
The following environment variables are used by backend/open_webui/config.py
to provide Open WebUI startup
configuration. Please note that some variables may have different default values depending on
whether you're running Open WebUI directly or via Docker. For more information on logging
environment variables, see our logging documentation.
Generalโ
WEBUI_URL
โ
- Type:
str
- Default:
http://localhost:3000
- Description: Specifies the URL where the Open WebUI is reachable. Currently used for search engine support.
- Persistence: This environment variable is a
PersistentConfig
variable.
ENABLE_SIGNUP
โ
- Type:
bool
- Default:
True
- Description: Toggles user account creation.
- Persistence: This environment variable is a
PersistentConfig
variable.
ENABLE_LOGIN_FORM
โ
- Type:
bool
- Default:
True
- Description: Toggles email, password, sign-in and "or" (only when
ENABLE_OAUTH_SIGNUP
is set to True) elements. - Persistence: This environment variable is a
PersistentConfig
variable.
This should only ever be set to False
when ENABLE_OAUTH_SIGNUP
is also being used and set to True
. Failure to do so will result in the inability to login.
DEFAULT_LOCALE
โ
- Type:
str
- Default:
en
- Description: Sets the default locale for the application.
- Persistence: This environment variable is a
PersistentConfig
variable.
DEFAULT_MODELS
โ
- Type:
str
- Default: Empty string (' '), since
None
. - Description: Sets a default Language Model.
- Persistence: This environment variable is a
PersistentConfig
variable.
DEFAULT_USER_ROLE
โ
- Type:
str
- Options:
pending
- New users are pending until their accounts are manually activated by an admin.user
- New users are automatically activated with regular user permissions.admin
- New users are automatically activated with administrator permissions.
- Default:
pending
- Description: Sets the default role assigned to new users.
- Persistence: This environment variable is a
PersistentConfig
variable.
PENDING_USER_OVERLAY_TITLE
โ
- Type:
str
- Default: Empty string (' ')
- Description: Sets a custom title for the pending user overlay.
- Persistence: This environment variable is a
PersistentConfig
variable.
PENDING_USER_OVERLAY_CONTENT
โ
- Type:
str
- Default: Empty string (' ')
- Description: Sets a custom text content for the pending user overlay.
- Persistence: This environment variable is a
PersistentConfig
variable.
ENABLE_CHANNELS
โ
- Type:
bool
- Default:
False
- Description: Enables or disables channel support.
- Persistence: This environment variable is a
PersistentConfig
variable.
WEBHOOK_URL
โ
- Type:
str
- Description: Sets a webhook for integration with Discord/Slack/Microsoft Teams.
- Persistence: This environment variable is a
PersistentConfig
variable.
ENABLE_ADMIN_EXPORT
โ
- Type:
bool
- Default:
True
- Description: Controls whether admin users can export data.
ENABLE_ADMIN_CHAT_ACCESS
โ
- Type:
bool
- Default:
True
- Description: Enables admin users to access all chats.
ENABLE_USER_WEBHOOKS
โ
- Type:
bool
- Default:
True
- Description: Enables or disables user webhooks.
- Persistence: This environment variable is a
PersistentConfig
variable.
RESPONSE_WATERMARK
โ
- Type:
str
- Default: Empty string (' ')
- Description: Sets a custom text that will be included when you copy a message in the chat. E.g.
"This text is AI generated"
-> will add "This text is AI generated" to every message, when copied. - Persistence: This environment variable is a
PersistentConfig
variable.
THREAD_POOL_SIZE
โ
- Type:
int
- Default:
0
- Description: Sets the thread pool size for FastAPI/AnyIO blocking calls. By default (when set to 0) FastAPI/AnyIO use
40
threads. In case of large instances and many concurrent users, it may be needed to increaseTHREAD_POOL_SIZE
to prevent blocking.
SHOW_ADMIN_DETAILS
โ
- Type:
bool
- Default:
True
- Description: Toggles whether to show admin user details in the interface.
- Persistence: This environment variable is a
PersistentConfig
variable.
ADMIN_EMAIL
โ
- Type:
str
- Description: Sets the admin email shown by
SHOW_ADMIN_DETAILS
- Persistence: This environment variable is a
PersistentConfig
variable.
ENV
โ
- Type:
str
- Options:
dev
- Enables the FastAPI API documentation on/docs
prod
- Automatically configures several environment variables
- Default:
- Backend Default:
dev
- Docker Default:
prod
- Backend Default:
- Description: Environment setting.
ENABLE_PERSISTENT_CONFIG
โ
- Type:
bool
- Default:
True
- Description: If set to
False
, allPersistentConfig
variables are treated as regular variables.
CUSTOM_NAME
โ
- Type:
str
- Description: Sets
WEBUI_NAME
but polls api.openwebui.com for metadata.
WEBUI_NAME
โ
- Type:
str
- Default:
Open WebUI
- Description: Sets the main WebUI name. Appends
(Open WebUI)
if overridden.
PORT
โ
- Type:
int
- Default:
8080
- Description: Sets the port to run Open WebUI from.
If you're running the application via Python and using the open-webui serve
command, you cannot set the port using the PORT
configuration. Instead, you must specify it directly as a command-line argument using the --port
flag. For example:
open-webui serve --port 9999
This will run the Open WebUI on port 9999
. The PORT
environment variable is disregarded in this mode.
ENABLE_REALTIME_CHAT_SAVE
โ
- Type:
bool
- Default:
False
- Description: When enabled, the system saves each chunk of streamed chat data to the database in real time to ensure maximum data persistency. This feature provides robust data recovery and allows accurate session tracking. However, the tradeoff is increased latency, as saving to the database introduces a delay. Disabling this feature can improve performance and reduce delays, but it risks potential data loss in the event of a system failure or crash. Use based on your application's requirements and acceptable tradeoffs.
BYPASS_MODEL_ACCESS_CONTROL
โ
- Type:
bool
- Default:
False
- Description: Bypasses model access control.
WEBUI_BUILD_HASH
โ
- Type:
str
- Default:
dev-build
- Description: Used for identifying the Git SHA of the build for releases.
WEBUI_BANNERS
โ
- Type:
list
ofdict
- Default:
[]
- Description: List of banners to show to users. The format for banners are:
[{"id": "string", "type": "string [info, success, warning, error]", "title": "string", "content": "string", "dismissible": false, "timestamp": 1000}]
- Persistence: This environment variable is a
PersistentConfig
variable.
When setting this environment variable in a .env
file, make sure to escape the quotes by wrapping the entire value in double quotes and using escaped quotes (\"
) for the inner quotes. Example:
WEBUI_BANNERS="[{\"id\": \"1\", \"type\": \"warning\", \"title\": \"Your messages are stored.\", \"content\": \"Your messages are stored and may be reviewed by human people. LLM's are prone to hallucinations, check sources.\", \"dismissible\": true, \"timestamp\": 1000}]"
USE_CUDA_DOCKER
โ
- Type:
bool
- Default:
False
- Description: Builds the Docker image with NVIDIA CUDA support. Enables GPU acceleration for local Whisper and embeddings.
EXTERNAL_PWA_MANIFEST_URL
โ
- Type:
str
- Default: Empty string (' '), since
None
is set as default. - Description: When defined as a fully qualified URL (e.g., https://path/to/manifest.webmanifest), requests sent to /manifest.json will use the external manifest file. When not defined, the default manifest.json file will be used.
ENABLE_TITLE_GENERATION
โ
- Type:
bool
- Default:
True
- Description: Enables or disables chat title generation.
- Persistence: This environment variable is a
PersistentConfig
variable.
LICENSE_KEY
โ
- Type:
str
- Default:
None
- Description: Specifies the license key to use (for Enterprise users only).
- Persistence: This environment variable is a
PersistentConfig
variable.
SSL_ASSERT_FINGERPRINT
โ
- Type:
str
- Default: Empty string (' '), since
None
is set as default. - Description: Specifies the SSL assert fingerprint to use.
- Persistence: This environment variable is a
PersistentConfig
variable.
DEFAULT_PROMPT_SUGGESTIONS
โ
- Type:
list
ofdict
- Default:
[]
(which means to use the built-in default prompt suggestions) - Description: List of prompt suggestions. The format for prompt suggestions are:
[{"title": ["Title part 1", "Title part 2"], "content": "prompt"}]
AIOHTTP Clientโ
AIOHTTP_CLIENT_TIMEOUT
โ
- Type:
int
- Default:
300
- Description: Specifies the timeout duration in seconds for the AIOHTTP client. This impacts things such as connections to Ollama and OpenAI endpoints.
This is the maximum amount of time the client will wait for a response before timing out.
If set to an empty string (' '), the timeout will be set to None
, effectively disabling the timeout and
allowing the client to wait indefinitely.
AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST
โ
- Type:
int
- Default:
10
- Description: Sets the timeout in seconds for fetching the model list. This can be useful in cases where network latency requires a longer timeout duration to successfully retrieve the model list.
The AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST is set to 10 seconds by default to help ensure that all necessary connections are available when opening the web UI. This duration allows enough time for retrieving the model list even in cases of higher network latency. You can lower this value if quicker timeouts are preferred, but keep in mind that doing so may lead to some connections being dropped, depending on your network conditions.
AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST
โ
- Type:
int
- Description: Sets the timeout in seconds for fetching the model list. This can be useful in cases where network latency requires a longer timeout duration to successfully retrieve the model list.
Directoriesโ
DATA_DIR
โ
- Type:
str
- Default:
./data
- Description: Specifies the base directory for data storage, including uploads, cache, vector database, etc.
FONTS_DIR
โ
- Type:
str
- Description: Specifies the directory for fonts.
FRONTEND_BUILD_DIR
โ
- Type:
str
- Default:
../build
- Description: Specifies the location of the built frontend files.
STATIC_DIR
โ
- Type:
str
- Default:
./static
- Description: Specifies the directory for static files, such as the favicon.
Ollamaโ
ENABLE_OLLAMA_API
โ
- Type:
bool
- Default:
True
- Description: Enables the use of Ollama APIs.
- Persistence: This environment variable is a
PersistentConfig
variable.
OLLAMA_BASE_URL
(OLLAMA_API_BASE_URL
is deprecated)โ
- Type:
str
- Default:
http://localhost:11434
- Docker Default:
- If
K8S_FLAG
is set:http://ollama-service.open-webui.svc.cluster.local:11434
- If
USE_OLLAMA_DOCKER=True
:http://localhost:11434
- Else
http://host.docker.internal:11434
- If
- Description: Configures the Ollama backend URL.
OLLAMA_BASE_URLS
โ
- Type:
str
- Description: Configures load-balanced Ollama backend hosts, separated by
;
. SeeOLLAMA_BASE_URL
. Takes precedence overOLLAMA_BASE_URL
. - Example:
http://host-one:11434;http://host-two:11434
- Persistence: This environment variable is a
PersistentConfig
variable.
USE_OLLAMA_DOCKER
โ
- Type:
bool
- Default:
False
- Description: Builds the Docker image with a bundled Ollama instance.
K8S_FLAG
โ
- Type:
bool
- Default:
False
- Description: If set, assumes Helm chart deployment and sets
OLLAMA_BASE_URL
tohttp://ollama-service.open-webui.svc.cluster.local:11434
OpenAIโ
ENABLE_OPENAI_API
โ
- Type:
bool
- Default:
True
- Description: Enables the use of OpenAI APIs.
- Persistence: This environment variable is a
PersistentConfig
variable.
OPENAI_API_BASE_URL
โ
- Type:
str
- Default:
https://api.openai.com/v1
- Description: Configures the OpenAI base API URL.
- Persistence: This environment variable is a
PersistentConfig
variable.
OPENAI_API_BASE_URLS
โ
- Type:
str
- Description: Supports balanced OpenAI base API URLs, semicolon-separated.
- Example:
http://host-one:11434;http://host-two:11434
- Persistence: This environment variable is a
PersistentConfig
variable.
OPENAI_API_KEY
โ
- Type:
str
- Description: Sets the OpenAI API key.
- Example:
sk-124781258123
- Persistence: This environment variable is a
PersistentConfig
variable.