[Skip to main content](https://docs.openwebui.com/reference/env-configuration/#__docusaurus_skipToContent_fallback)

On this page

## Overview [​](https://docs.openwebui.com/reference/env-configuration/\#overview "Direct link to 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.

info

This page is up-to-date with Open WebUI release version [v0.10.0](https://github.com/open-webui/open-webui/releases/tag/v0.10.0), 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 `ConfigVar` Environment Variables [​](https://docs.openwebui.com/reference/env-configuration/\#important-note-on-configvar-environment-variables "Direct link to important-note-on-configvar-environment-variables")

note

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 `ConfigVar`, their values are persisted and stored internally.

After the initial launch, if you restart the container, `ConfigVar` 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 `ConfigVar` 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 `ConfigVar` environment variables are clearly marked as such in the documentation below, so you can be aware of how they will behave.

To disable this behavior and force Open WebUI to always use your environment variables (ignoring the database), set `ENABLE_PERSISTENT_CONFIG` to `False`.

**CRITICAL WARNING:** When `ENABLE_PERSISTENT_CONFIG` is `False`, you may still be able to edit settings in the Admin UI. However, these changes are **NOT saved**.

### Troubleshooting Ignored Environment Variables 🛠️ [​](https://docs.openwebui.com/reference/env-configuration/\#troubleshooting-ignored-environment-variables-%EF%B8%8F "Direct link to Troubleshooting Ignored Environment Variables 🛠️")

If you change an environment variable (like `ENABLE_SIGNUP=True`) but don't see the change reflected in the UI (e.g., the "Sign Up" button is still missing), it's likely because a value has already been persisted in the database from a previous run or a persistent Docker volume.

#### Option 1: Using `ENABLE_PERSISTENT_CONFIG` (Temporary Fix) [​](https://docs.openwebui.com/reference/env-configuration/\#option-1-using-enable_persistent_config-temporary-fix "Direct link to option-1-using-enable_persistent_config-temporary-fix")

Set `ENABLE_PERSISTENT_CONFIG=False` in your environment. This forces Open WebUI to read your variables directly. Note that UI-based settings changes will not persist across restarts in this mode.

#### Option 2: Update via Admin UI (Recommended) [​](https://docs.openwebui.com/reference/env-configuration/\#option-2-update-via-admin-ui-recommended "Direct link to Option 2: Update via Admin UI (Recommended)")

The simplest and safest way to change `ConfigVar` settings is directly through the **Admin Panel** within Open WebUI. Even if an environment variable is set, changes made in the UI will take precedence and be saved to the database.

#### Option 3: Manual Database Update (Last Resort / Lock-out Recovery) [​](https://docs.openwebui.com/reference/env-configuration/\#option-3-manual-database-update-last-resort--lock-out-recovery "Direct link to Option 3: Manual Database Update (Last Resort / Lock-out Recovery)")

If you are locked out or cannot access the UI, you can manually update the SQLite database via Docker:

```
docker exec -it open-webui sqlite3 /app/backend/data/webui.db "UPDATE config SET data = json_set(data, '$.ENABLE_SIGNUP', json('true'));"
```

_(Replace `ENABLE_SIGNUP` and `true` with the specific setting and value needed.)_

#### Option 4: Resetting for a Fresh Install [​](https://docs.openwebui.com/reference/env-configuration/\#option-4-resetting-for-a-fresh-install "Direct link to Option 4: Resetting for a Fresh Install")

If you are performing a clean installation and want to ensure all environment variables are fresh:

1. Stop the container.
2. Remove the persistent volume: `docker volume rm open-webui`.
3. Restart the container.

danger

**Warning:** Removing the volume will delete all user data, including chats and accounts.

## App/Backend [​](https://docs.openwebui.com/reference/env-configuration/\#appbackend "Direct link to 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](https://docs.openwebui.com/getting-started/advanced-topics/logging).

### General [​](https://docs.openwebui.com/reference/env-configuration/\#general "Direct link to General")

#### `WEBUI_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_url "Direct link to webui_url")

- Type: `str`
- Default: `http://localhost:3000`
- Description: Specifies the URL where your Open WebUI installation is reachable. Needed for search engine support and OAuth/SSO.
- Persistence: This environment variable is a `ConfigVar` variable.

warning

This variable has to be set before you start using OAuth/SSO for authentication.
Since this is a persistent config environment variable, you can only change it through one of the following options:

- Temporarily disabling persistent config using `ENABLE_PERSISTENT_CONFIG`
- Changing `WEBUI_URL` in the admin panel > settings and changing "WebUI URL".

Failure to set WEBUI\_URL before using OAuth/SSO will result in failure to log in.

#### `ENABLE_API_OUTLET_FILTERS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_api_outlet_filters "Direct link to enable_api_outlet_filters")

- Type: `bool`
- Default: `True`
- Description: When enabled, **outlet** [filter functions](https://docs.openwebui.com/features/extensibility/plugin/functions/filter) also run for completions requested directly through the API (both streaming and non-streaming), not only for chats made from the Open WebUI interface. Disable to skip outlet filters on direct API traffic. Inlet filters and other pipeline stages are unaffected.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

#### `ENABLE_SIGNUP` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_signup "Direct link to enable_signup")

- Type: `bool`
- Default: `True`
- Description: Toggles user account creation.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_SIGNUP_PASSWORD_CONFIRMATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_signup_password_confirmation "Direct link to enable_signup_password_confirmation")

- Type: `bool`
- Default: `False`
- Description: If set to True, a "Confirm Password" field is added to the sign-up page to help users avoid typos when creating their password.

#### `WEBUI_ADMIN_EMAIL` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_admin_email "Direct link to webui_admin_email")

- Type: `str`
- Default: Empty string (' ')
- Description: Specifies the email address for an admin account to be created automatically on first startup when no users exist. This enables headless/automated deployments without manual account creation. When combined with `WEBUI_ADMIN_PASSWORD`, the admin account is created during application startup, and `ENABLE_SIGNUP` is automatically disabled to prevent unauthorized account creation.

info

This variable is designed for automated/containerized deployments where manual admin account creation is impractical. The admin account is only created if:

- No users exist in the database (fresh installation)
- Both `WEBUI_ADMIN_EMAIL` and `WEBUI_ADMIN_PASSWORD` are configured

After the admin account is created, sign-up is automatically disabled for security. You can re-enable it later via the Admin Panel if needed.

#### `WEBUI_ADMIN_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_admin_password "Direct link to webui_admin_password")

- Type: `str`
- Default: Empty string (' ')
- Description: Specifies the password for the admin account to be created automatically on first startup when no users exist. Must be used in conjunction with `WEBUI_ADMIN_EMAIL`. The password is securely hashed before storage using the same mechanism as manual account creation.

danger

**Security Considerations**

- Use a strong, unique password for production deployments
- Consider using secrets management (Docker secrets, Kubernetes secrets, environment variable injection) rather than storing the password in plain text configuration files
- After initial setup, change the admin password through the UI for enhanced security
- Never commit this value to version control

#### `WEBUI_ADMIN_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_admin_name "Direct link to webui_admin_name")

- Type: `str`
- Default: `Admin`
- Description: Specifies the display name for the automatically created admin account. This is used when `WEBUI_ADMIN_EMAIL` and `WEBUI_ADMIN_PASSWORD` are configured for headless admin creation.

#### `ENABLE_LOGIN_FORM` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_login_form "Direct link to 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 `ConfigVar` variable.

#### `ENABLE_PASSWORD_CHANGE_FORM` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_password_change_form "Direct link to enable_password_change_form")

- Type: `bool`
- Default: `True`
- Description: Controls visibility of the password change UI in **Settings > Account**. When set to `False`, users do not see the password update form, which is useful for SSO-focused deployments where password changes should not be presented in the UI.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `PASSWORD_HASH_ALGORITHM` [​](https://docs.openwebui.com/reference/env-configuration/\#password_hash_algorithm "Direct link to password_hash_algorithm")

- Type: `str`
- Default: `bcrypt`
- Options: `bcrypt`, `argon2`
- Description: Selects the algorithm used to hash new user passwords. `bcrypt` (default) rejects passwords longer than **72 bytes** (a hard bcrypt limit). `argon2` removes that limit and accepts arbitrarily long passwords (requires the `argon2-cffi` package). Existing hashes keep working after a switch: verification auto-detects the algorithm from each stored hash (an `$argon2` prefix verifies with argon2, otherwise bcrypt), so changing this affects only newly set passwords.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

#### `ENABLE_PASSWORD_AUTH` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_password_auth "Direct link to enable_password_auth")

- Type: `bool`
- Default: `True`
- Description: Allows both password and SSO authentication methods to coexist when set to True. When set to False, it disables all password-based login attempts on the /signin and /ldap endpoints, enforcing strict SSO-only authentication. Disable this setting in production environments with fully configured SSO to prevent credential-based account takeover attacks; keep it enabled if you require password authentication as a backup or have not yet completed SSO configuration. Should never be disabled if OAUTH/SSO is not being used. This setting controls backend authentication behavior, while `ENABLE_PASSWORD_CHANGE_FORM` controls UI visibility of password-change controls.

tip

This SHOULD be set to `False` if you only use SSO/OAUTH for Login and expose your Open WebUI publicly as to prevent password based logins.

danger

This should **only** ever be set to `False` when [ENABLE\_OAUTH\_SIGNUP](https://docs.openwebui.com/reference/env-configuration/#enable_oauth_signup)
is also being used and set to `True`. **Never disable this if OAUTH/SSO is not being used.** Failure to do so will result in the inability to login.

#### `DEFAULT_LOCALE` [​](https://docs.openwebui.com/reference/env-configuration/\#default_locale "Direct link to default_locale")

- Type: `str`
- Default: `en`
- Description: Sets the default locale for the application.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `DEFAULT_MODELS` [​](https://docs.openwebui.com/reference/env-configuration/\#default_models "Direct link to default_models")

- Type: `str`
- Default: Empty string (' '), since `None`.
- Description: Sets a default Language Model.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `DEFAULT_PINNED_MODELS` [​](https://docs.openwebui.com/reference/env-configuration/\#default_pinned_models "Direct link to default_pinned_models")

- Type: `str`
- Default: Empty string (' ')
- Description: Comma-separated list of model IDs to pin by default for new users who haven't customized their pinned models. This provides a pre-selected set of frequently used models in the model selector for new accounts.
- Example: `gpt-4,claude-3-opus,llama-3-70b`
- Persistence: This environment variable is a `ConfigVar` variable.

#### `DEFAULT_MODEL_METADATA` [​](https://docs.openwebui.com/reference/env-configuration/\#default_model_metadata "Direct link to default_model_metadata")

- Type: `dict` (JSON object)
- Default: `{}`
- Description: Sets global default metadata (capabilities and other model info) for all models. These defaults act as a baseline. Per-model overrides always take precedence. For capabilities, the defaults and per-model values are merged (per-model wins on conflicts). For other metadata fields, the default is only applied if the model has no value set. Configurable via **Admin Settings → Models**.
- Persistence: This environment variable is a `ConfigVar` variable. Stored at config key `models.default_metadata`.

info

`DEFAULT_MODEL_METADATA` is read from the environment as a JSON string at startup.

- Use valid JSON (for example: `{"capabilities":{"vision":true,"web_search":true}}`)
- If parsing fails, Open WebUI logs the error and falls back to `{}`
- The parsed value is then applied even when persistent config is disabled, so configured defaults are honored at startup.

#### `DEFAULT_MODEL_PARAMS` [​](https://docs.openwebui.com/reference/env-configuration/\#default_model_params "Direct link to default_model_params")

- Type: `dict` (JSON object)
- Default: `{}`
- Description: Sets global default parameters (temperature, top\_p, max\_tokens, seed, etc.) for all models. These defaults are applied as a baseline at chat completion time. Per-model parameter overrides always take precedence. Configurable via **Admin Settings → Models**.
- Persistence: This environment variable is a `ConfigVar` variable. Stored at config key `models.default_params`.

info

`DEFAULT_MODEL_PARAMS` is read from the environment as a JSON string at startup.

- Use valid JSON (for example: `{"temperature":0.7,"function_calling":"native"}`)
- If parsing fails, Open WebUI logs the error and falls back to `{}`

#### `DEFAULT_USER_ROLE` [​](https://docs.openwebui.com/reference/env-configuration/\#default_user_role "Direct link to 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 `ConfigVar` variable.

#### `DEFAULT_GROUP_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#default_group_id "Direct link to default_group_id")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the default group ID to assign to new users upon registration.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `DEFAULT_GROUP_SHARE_PERMISSION` [​](https://docs.openwebui.com/reference/env-configuration/\#default_group_share_permission "Direct link to default_group_share_permission")

- Type: `str`
- Options: `members`, `true`, `false`
- Default: `members`
- Description: Controls the default "Who can share to this group" setting for newly created groups. `members` means only group members can share to the group, `true` means anyone can share, and `false` means no one can share to the group. This applies both to groups created manually and groups created automatically (e.g. via SCIM or OAuth group sync). Existing groups are not affected; this only sets the initial default for new groups.

#### `PENDING_USER_OVERLAY_TITLE` [​](https://docs.openwebui.com/reference/env-configuration/\#pending_user_overlay_title "Direct link to 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 `ConfigVar` variable.

#### `PENDING_USER_OVERLAY_CONTENT` [​](https://docs.openwebui.com/reference/env-configuration/\#pending_user_overlay_content "Direct link to 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 `ConfigVar` variable.

#### `ENABLE_CALENDAR` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_calendar "Direct link to enable_calendar")

- Type: `bool`
- Default: `True`
- Description: Enables or disables the Calendar feature. When enabled, users can create calendars, manage events, and share calendars with other users or groups via access grants. Active automations are automatically surfaced as virtual events on a dedicated "Scheduled Tasks" calendar. Requires the `features.calendar` user permission (admins always pass).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_CHANNELS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_channels "Direct link to enable_channels")

- Type: `bool`
- Default: `False`
- Description: Enables or disables channel support.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_FOLDERS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_folders "Direct link to enable_folders")

- Type: `bool`
- Default: `True`
- Description: Enables or disables the folders feature, allowing users to organize their chats into folders in the sidebar.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `FOLDER_MAX_FILE_COUNT` [​](https://docs.openwebui.com/reference/env-configuration/\#folder_max_file_count "Direct link to folder_max_file_count")

- Type: `int`
- Default: `("") empty string`
- Description: Sets the maximum number of files processing allowed per folder.
- Persistence: This environment variable is a `ConfigVar` variable. It can be configured in the **Admin Panel > Settings > General > Folder Max File Count**. Default is none (empty string) which is unlimited.

#### `ENABLE_AUTOMATIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_automations "Direct link to enable_automations")

- Type: `bool`
- Default: `True`
- Description: Enables or disables the Automations feature globally. When disabled, the scheduler skips automation processing, the automation API endpoints return `403 Forbidden`, automation builtin tools are not injected, and the Automations entry is hidden from the sidebar. Requires the `features.automations` user permission (admins always pass).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUTOMATION_MAX_COUNT` [​](https://docs.openwebui.com/reference/env-configuration/\#automation_max_count "Direct link to automation_max_count")

- Type: `int`
- Default: `("") empty string` (unlimited)
- Description: Sets the maximum number of automations a non-admin user can create. When set to a positive integer, users who reach this limit will receive a `403 Forbidden` error when attempting to create additional automations. Admins bypass this limit.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUTOMATION_MIN_INTERVAL` [​](https://docs.openwebui.com/reference/env-configuration/\#automation_min_interval "Direct link to automation_min_interval")

- Type: `int` (seconds)
- Default: `("") empty string` (no minimum)
- Description: Sets the minimum allowed interval in seconds between automation recurrences for non-admin users. When set, any automation schedule that recurs more frequently than this value will be rejected with a `400 Bad Request` error. One-time automations (`COUNT=1`) are exempt from this check. Admins bypass this limit.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUTOMATION_AUTH_TOKEN_EXPIRES_IN` [​](https://docs.openwebui.com/reference/env-configuration/\#automation_auth_token_expires_in "Direct link to automation_auth_token_expires_in")

- Type: `str` (duration)
- Default: `1h`
- Description: Lifetime of the short-lived auth token an automation uses to call back into Open WebUI while running headless (so a scheduled run can reach session-authenticated tools and terminals). Accepts duration strings like `30m`, `1h`, `24h`.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

Common values for AUTOMATION\_MIN\_INTERVAL

| Value | Meaning |
| --- | --- |
| `60` | Minimum 1 minute between runs |
| `300` | Minimum 5 minutes between runs |
| `900` | Minimum 15 minutes between runs |
| `3600` | Minimum 1 hour between runs |

#### `SCHEDULER_POLL_INTERVAL` [​](https://docs.openwebui.com/reference/env-configuration/\#scheduler_poll_interval "Direct link to scheduler_poll_interval")

- Type: `int` (seconds)
- Default: `10`
- Description: Sets the interval in seconds between scheduler ticks. The unified scheduler handles both automation execution and calendar event alerts. Accepts `AUTOMATION_POLL_INTERVAL` as a legacy fallback.

#### `CALENDAR_ALERT_LOOKAHEAD_MINUTES` [​](https://docs.openwebui.com/reference/env-configuration/\#calendar_alert_lookahead_minutes "Direct link to calendar_alert_lookahead_minutes")

- Type: `int` (minutes)
- Default: `10`
- Description: Default lookahead window in minutes for calendar event alerts. Events starting within this window from the current time will trigger toast and webhook notifications. Individual events can override this via the **Reminder** setting in the event editor (`meta.alert_minutes`).

#### `ENABLE_NOTES` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_notes "Direct link to enable_notes")

- Type: `bool`
- Default: `True`
- Description: Enables or disables the notes feature, allowing users to create and manage personal notes within Open WebUI.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_MEMORIES` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_memories "Direct link to enable_memories")

- Type: `bool`
- Default: `True`
- Description: Enables or disables the [memory feature](https://docs.openwebui.com/features/chat-conversations/memory), allowing models to store and retrieve long-term information about users.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_MEMORY_SYSTEM_CONTEXT` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_memory_system_context "Direct link to enable_memory_system_context")

- Type: `bool`
- Default: `True`
- Description: When the [memory feature](https://docs.openwebui.com/features/chat-conversations/memory) is on, controls whether stored memories are injected into the model's system context. Set to `False` to keep the memory tools available (the model can still add, update and delete memories) while no longer adding remembered context to the prompt. Surfaced as the "Memory System Context" toggle under **Admin Settings > General** when Memories is enabled.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WEBHOOK_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#webhook_url "Direct link to webhook_url")

- Type: `str`
- Description: Sets a webhook for integration with Discord/Slack/Microsoft Teams.
- Persistence: This environment variable is a `ConfigVar` variable.

Admin posture toggles vs. security boundaries

The `ENABLE_ADMIN_*` and `BYPASS_ADMIN_ACCESS_CONTROL` toggles in this section control what the admin sees and does **through Open WebUI's admin product surfaces** (admin panel pages, the chat model selector, workspace lists, the export action). They do **not** establish a security boundary against the admin themselves.

Open WebUI is single-tenant by architecture and the `admin` role is root-equivalent on the deployment by deliberate design. Admins inherently retain unconstrained access to all data via direct database access, environment-variable inspection, server access, admin-only **Functions** (which execute arbitrary Python at module-import inside the application process), and **Tools** with the `workspace.tools` permission (which the admin can grant to themselves and which run `exec()` on the server).

These toggles are appropriate for:

- **Performance**: keeping admin-facing list/selector surfaces fast on large multi-user deployments where loading every user's items is a hard performance problem.
- **UI clutter reduction**: keeping those same surfaces usable when populated with thousands of items from other users.
- **Compliance posture**: meeting requirements (especially in jurisdictions with stronger labour-protection law, e.g. DE / AT / EU) that admins not be _casually_ presented with other users' data, even though they remain technically able to reach it via the routes above.

These toggles are **not** appropriate for:

- Cross-tenant data isolation between admins. There is no cryptographic per-tenant isolation, no multi-database split, and no per-admin scope on the underlying data store. For genuine tenant separation, the supported pattern is **separate Open WebUI instances per tenant**.
- A security boundary against an admin who is determined to read data they aren't shown in their UI surfaces.

Treat anything in this cluster as _what the admin sees and does in the product UI and API_, not _what the admin technically can reach on the deployment_.

#### `ENABLE_ADMIN_EXPORT` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_admin_export "Direct link to enable_admin_export")

- Type: `bool`
- Default: `True`
- Description: Controls whether the admin-panel **export** action is available (data, chats, and database export). When disabled, the export endpoints reject requests. Database exports only work for SQLite databases for now. Note that admin retains the underlying ability to dump the database directly via deployment access; this toggle controls the in-product export surface, see the admin-posture-toggles note above. Requires a restart to take effect.

#### `ENABLE_ADMIN_CHAT_ACCESS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_admin_chat_access "Direct link to enable_admin_chat_access")

- Type: `bool`
- Default: `True`
- Description: Controls whether the admin-panel **other-users-chats** access surface is available. When disabled, admins can no longer access other users' chats in the admin panel and the corresponding endpoints reject the request. If you disable this, consider also disabling `ENABLE_ADMIN_EXPORT` (especially on SQLite), since exports include user chats and would re-open the same data on a different surface. Note that admin retains underlying database access regardless; this toggle controls the in-product surface, see the admin-posture-toggles note above.

#### `ENABLE_ADMIN_ANALYTICS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_admin_analytics "Direct link to enable_admin_analytics")

- Type: `bool`
- Default: `True`
- Description: Controls whether the admin-panel **Analytics** tab is visible and the analytics API router is mounted. When set to `False`, the tab is hidden and the corresponding endpoints are not registered. Disabling does not stop the underlying data being collected, and admin retains the ability to query that data directly from the database; this toggle controls the in-product surface, see the admin-posture-toggles note above. Requires a restart to take effect.

#### `BYPASS_ADMIN_ACCESS_CONTROL` [​](https://docs.openwebui.com/reference/env-configuration/\#bypass_admin_access_control "Direct link to bypass_admin_access_control")

- Type: `bool`

- Default: `True`

- Description: Controls whether admin users see other users' workspace items in **list and selector UI surfaces** (workspace tabs for models / knowledge / prompts / tools / notes / skills, the chat model selector, the file browser list, etc.). When set to `True` (default), those surfaces show every item from every user, convenient for single-admin / small-team deployments. When set to `False`, those same surfaces show only the admin's own items plus items explicitly shared with them, matching what a regular user would see.

Per-id direct-access endpoints (`GET /api/v1/<resource>/id/{id}` and the corresponding update / delete / access-update routes) are **intentionally not gated** by this flag and were never designed to be. Gating them would protect against nothing the admin couldn't trivially do via the database query they used to obtain the resource ID in the first place, while breaking legitimate flows where an admin operates on a known item ID. See the admin-posture-toggles note above for the full architectural reasoning.

This environment variable deprecates `ENABLE_ADMIN_WORKSPACE_CONTENT_ACCESS`. If you are still using `ENABLE_ADMIN_WORKSPACE_CONTENT_ACCESS`, switch to `BYPASS_ADMIN_ACCESS_CONTROL`.


#### `ENABLE_USER_WEBHOOKS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_user_webhooks "Direct link to enable_user_webhooks")

- Type: `bool`
- Default: `False`
- Description: Enables or disables user webhooks (each user can set a URL their notifications are POSTed to). For SSRF safety, webhook URLs that resolve to private or reserved IPs are blocked unless [`ENABLE_RAG_LOCAL_WEB_FETCH`](https://docs.openwebui.com/reference/env-configuration/#enable_rag_local_web_fetch) is `true`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RESPONSE_WATERMARK` [​](https://docs.openwebui.com/reference/env-configuration/\#response_watermark "Direct link to 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 `ConfigVar` variable.

#### `IFRAME_CSP` [​](https://docs.openwebui.com/reference/env-configuration/\#iframe_csp "Direct link to iframe_csp")

- Type: `str`
- Default: Empty string (no CSP injected)
- Description: Sets a Content-Security-Policy applied to all `srcdoc` iframes rendered in the UI: Artifacts, code/HTML previews, file previews, and citation modals. When set, a `<meta http-equiv="Content-Security-Policy">` tag is injected at the top of the iframe document, restricting what LLM-generated or user-uploaded HTML can load and execute (network connections, scripts, styles, fonts, frames). The `sandbox` attribute on the iframe still provides the baseline isolation; this CSP is an additional defense-in-depth layer for deployments that need to constrain outbound network requests from rendered HTML. Example value: `default-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:; connect-src 'none'`. Leave unset to keep the existing behavior (sandbox-only).

#### `THREAD_POOL_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#thread_pool_size "Direct link to thread_pool_size")

- Type: `int`
- Default: `0` (unset, the AnyIO default limit of `40` applies)
- Description: Sets the maximum number of **concurrent** blocking operations that may run in the AnyIO worker thread pool at once. Open WebUI offloads synchronous/blocking work (many DB calls, file I/O, sync route handlers, some library calls) to this pool via `run_in_threadpool`. The value is a **concurrency ceiling (a token limit), not a fixed pool of pre-spawned OS threads and not a CPU-core/thread count**: worker threads are created lazily only when needed and reused, so a high value does **not** by itself create that many threads, consume CPU, or cause CPU contention while idle. It only raises how many blocking operations can be in flight simultaneously before the rest must queue.

Set this high on any real server (2000+); never lower it

The AnyIO default of `40` is far too low for production. When more than `THREAD_POOL_SIZE` blocking operations are needed at once (many users acting at the same time, or a few users each triggering several blocking calls), every further request **waits** for a free slot. The symptom is the whole app appearing to **hang / freeze / stop responding** under load, even though CPU and memory look fine. It is pool starvation, not resource exhaustion.

- **Normal servers / production:**`2000` or higher. `2000` is a _lower_ bound for very large multi-user instances; going higher is fine and is **not** a CPU or contention risk (it is a ceiling, not a preallocation).
- **Never decrease below the default.** An idle high ceiling costs effectively nothing; a low ceiling causes freezes.
- **Exception, weak hardware (Raspberry Pi, tiny VPS, containers capped at ~250m CPU / very low RAM):** do **not** set `2000` here. Each _genuinely concurrent_ blocking op still uses a real OS thread (stack memory), so on a tiny device an enormous ceiling lets a traffic burst spawn enough threads to exhaust RAM. Leave it at the default, or set a modest value (e.g. a few hundred) matched to what the device can actually absorb. This caveat applies only to constrained single-board / micro deployments; any normal server should use `2000+`.

#### `ENABLE_CUSTOM_MODEL_FALLBACK` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_custom_model_fallback "Direct link to enable_custom_model_fallback")

- Type: `bool`
- Default: `False`
- Description: Controls whether custom models should fall back to a default model if their assigned base model is missing. When set to `True`, if a custom model's base model is not found, the system will use the first model from the configured `DEFAULT_MODELS` list instead of returning an error.

#### `SHOW_ADMIN_DETAILS` [​](https://docs.openwebui.com/reference/env-configuration/\#show_admin_details "Direct link to show_admin_details")

- Type: `bool`
- Default: `True`
- Description: Toggles whether to show admin user details in the interface.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_PUBLIC_ACTIVE_USERS_COUNT` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_public_active_users_count "Direct link to enable_public_active_users_count")

- Type: `bool`
- Default: `True`
- Description: Controls whether the active user count is visible to all users or restricted to administrators only. When set to `False`, only admin users can see how many users are currently active, reducing backend load and addressing privacy concerns in large deployments.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_USER_STATUS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_user_status "Direct link to enable_user_status")

- Type: `bool`
- Default: `True`
- Description: Globally enables or disables user status functionality. When disabled, the status UI (including blinking active/away indicators and status messages) is hidden across the application, and user status API endpoints are restricted.
- Persistence: This environment variable is a `ConfigVar` variable. It can be toggled in the **Admin Panel > Settings > General > User Status**.

#### `ENABLE_EASTER_EGGS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_easter_eggs "Direct link to enable_easter_eggs")

- Type: `bool`
- Default: `True`
- Description: Enables or disables easter egg features in the UI, such as special themes (e.g., the "Her" theme option in the theme selector). Set to `False` to hide these optional novelty features from users.

#### `ADMIN_EMAIL` [​](https://docs.openwebui.com/reference/env-configuration/\#admin_email "Direct link to admin_email")

- Type: `str`
- Description: Sets the admin email shown by `SHOW_ADMIN_DETAILS`
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENV` [​](https://docs.openwebui.com/reference/env-configuration/\#env "Direct link to 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`
- Description: Environment setting.

#### `ENABLE_PERSISTENT_CONFIG` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_persistent_config "Direct link to enable_persistent_config")

- Type: `bool`
- Default: `True`
- Description: Controls whether the system prioritizes configuration saved in the database over environment variables.
  - **`True` (Default):** Values saved in the **database** (via the Admin UI) take precedence. If a value is set in the UI, the environment variable is ignored for that setting.
  - **`False`:** **Environment variables** take precedence. The system will _not_ load configuration from the database at startup if an environment variable is present (or it will use the default).
    - **CRITICAL WARNING:** When set to `False`, you can still seemingly "change" settings in the Admin UI. These changes will apply to the **current running session** but **will be lost upon restart**. The system will revert to the values defined in your environment variables (or defaults) every time it boots up.
    - **Use Case:** Set this to `False` if you want to strictly manage configuration via a `docker-compose.yaml` or `.env` file and prevent UI changes from persisting across restarts.

#### `CUSTOM_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#custom_name "Direct link to custom_name")

- Type: `str`
- Description: Sets `WEBUI_NAME` but polls **api.openwebui.com** for metadata.

#### `WEBUI_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_name "Direct link to webui_name")

- Type: `str`
- Default: `Open WebUI`
- Description: Sets the main WebUI name. Appends `(Open WebUI)` if overridden.

#### `PORT` [​](https://docs.openwebui.com/reference/env-configuration/\#port "Direct link to port")

- Type: `int`
- Default: `8080`
- Description: Sets the port to run Open WebUI from.

info

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` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_realtime_chat_save "Direct link to enable_realtime_chat_save")

- Type: `bool`
- Default: `False`
- Description: When enabled, the system saves each individual chunk of streamed chat data to the database in real time.

EXTREME PERFORMANCE RISK: DO NOT ENABLE IN PRODUCTION

**It is strongly recommended to NEVER enable this setting in production or multi-user environments.**

Enabling `ENABLE_REALTIME_CHAT_SAVE` causes every single token generated by the LLM to trigger a separate database write operation. In a multi-user environment, this will:

1. **Exhaust Database Connection Pools**: Rapid-fire writes will quickly consume all available database connections, leading to "QueuePool limit reached" errors and application-wide freezes.
2. **Severe Performance Impact**: The overhead of thousands of database transactions per minute will cause massive latency for all users.
3. **Hardware Strain**: It creates immense I/O pressure on your storage system.

**Keep this set to `False` (the default).** Chats are still saved automatically once generation is complete. This setting is only intended for extreme debugging scenarios or single-user environments where sub-second persistence of every token is more important than stability.

#### `ENABLE_CHAT_RESPONSE_BASE64_IMAGE_URL_CONVERSION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_chat_response_base64_image_url_conversion "Direct link to enable_chat_response_base64_image_url_conversion")

- Type: `bool`
- Default: `False`
- Description: When set to true, it automatically uploads base64-encoded images exceeding 1KB in markdown and converts them into image file URLs to reduce the size of response text. Some multimodal models directly output images as Base64 strings within the Markdown content. This results in larger response bodies, placing strain on CPU, network, Redis, and database resources.

#### `ENABLE_IMAGE_CONTENT_TYPE_EXTENSION_FALLBACK` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_image_content_type_extension_fallback "Direct link to enable_image_content_type_extension_fallback")

- Type: `bool`
- Default: `False`
- Description: When enabled, uses a hardcoded extension-to-MIME dictionary as a last-resort fallback when both the system MIME database and the file's stored content type metadata fail to determine the content type of an image. This is primarily useful on minimal container images (e.g., wolfi-base) that lack `/etc/mime.types` and have legacy files without stored content type metadata. Supported extensions include `.webp`, `.png`, `.jpg`, `.jpeg`, `.gif`, `.svg`, `.bmp`, `.tiff`, `.ico`, `.heic`, `.heif`, and `.avif`.

#### `ENABLE_PROFILE_IMAGE_URL_FORWARDING` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_profile_image_url_forwarding "Direct link to enable_profile_image_url_forwarding")

- Type: `bool`
- Default: `True`
- Description: Controls whether the user and model profile-image endpoints honor an external `http(s)://` URL stored in `profile_image_url` by issuing a `302 Found` redirect to the original origin. When `False`, the redirect is suppressed and the endpoint falls through to the bundled default image instead. Set to `False` to prevent client-side IP, User-Agent, and Referer leaks to attacker-controlled origins via attacker-stored profile URLs (data URIs and same-origin/static images continue to load normally). Existing deployments that legitimately rely on external profile image URLs (e.g. Gravatar redirects served by upstream identity providers) should keep the default. **This variable is read once at startup; it is not a `ConfigVar` and cannot be changed from the Admin UI.**

#### `PROFILE_IMAGE_ALLOWED_MIME_TYPES` [​](https://docs.openwebui.com/reference/env-configuration/\#profile_image_allowed_mime_types "Direct link to profile_image_allowed_mime_types")

- Type: `str` (comma-separated MIME types)
- Default: `image/png,image/jpeg,image/gif,image/webp`
- Description: Allowlist of MIME types accepted when serving a base64 `data:` URI as a profile image. The MIME type is parsed from the data URI prefix and checked against this list before the response is streamed; non-allowlisted types fall through to the bundled default image. Responses also set `X-Content-Type-Options: nosniff` to prevent the browser from sniffing the body into an executable type. SVG is intentionally not in the default list because it can carry inline `<script>`. The same allowlist drives the Pydantic data-URI prefix validator, so adding a type here both serves it on the read path and accepts it on the write path. **This variable is read once at startup; it is not a `ConfigVar` and cannot be changed from the Admin UI.**

#### `PROFILE_IMAGE_MAX_DATA_URI_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#profile_image_max_data_uri_size "Direct link to profile_image_max_data_uri_size")

- Type: `int` (bytes)
- Default: unset (no limit)
- Description: Maximum length, in bytes, of an inline `data:image/...;base64,...` profile image. The shared profile-image validator rejects a longer data URI on save, and it applies to both user avatars and model icons. Use it to bound the Postgres/Redis bloat (and the slower model-list responses) that oversized inline images cause. Only `data:` URIs are limited; `http(s)` avatar URLs and the built-in static paths are unaffected. The limit counts the base64-encoded string, which is about a third larger than the raw image, so `262144` (256 KiB) corresponds to roughly 190 KiB of actual image. Unset (the default) leaves inline images uncapped. **Read once at startup, not a `ConfigVar`, so it cannot be changed from the Admin UI.**

#### `CHAT_RESPONSE_STREAM_DELTA_CHUNK_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#chat_response_stream_delta_chunk_size "Direct link to chat_response_stream_delta_chunk_size")

- Type: `int`
- Default: `1`
- Description: Sets a system-wide minimum value for the number of tokens to batch together before sending them to the client during a streaming response. This allows an administrator to enforce a baseline level of performance and stability across the entire system by preventing excessively small chunk sizes that can cause high CPU load. The final chunk size used for a response will be the highest value set among this global variable, the model's advanced parameters, or the per-chat settings. The default is 1, which applies no minimum batching at the global level.

#### `CHAT_STREAM_RESPONSE_CHUNK_MAX_BUFFER_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#chat_stream_response_chunk_max_buffer_size "Direct link to chat_stream_response_chunk_max_buffer_size")

- Type: `int`
- Default: Empty string (' '), which disables the limit (equivalent to None)
- Description: Sets the maximum buffer size in bytes for handling stream response chunks. When a single chunk exceeds this limit, the system returns an empty JSON object and skips subsequent oversized data until encountering normally-sized chunks. This prevents memory issues when dealing with extremely large responses from certain providers (e.g., models like gemini-2.5-flash-image or services returning extensive web search data exceeding). Set to an empty string or a negative value to disable chunk size limitations entirely. Recommended values are 16-20 MB (`16777216`) or larger depending on the image size of the image generation model (4K images may need even more).

info

It is recommended to set this to a high single-digit or low double-digit value if you run Open WebUI with high concurrency, many users, and very fast streaming models.

#### `CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#chat_response_max_tool_call_iterations "Direct link to chat_response_max_tool_call_iterations")

- Type: `int`
- Default: `256`
- Description: Caps how many sequential tool-calling turns the agentic loop will run within a **single** assistant response when Native Function Calling is enabled. Each turn where the model emits one or more tool calls counts as **one** toward this limit (multiple tool calls grouped in the same turn still count as one); the counter resets for every new message and does not carry across turns of a conversation. It is **not** a retry budget for failed tool calls: a successful call and a failed call each consume one, exactly the same. Set to `-1` for **unlimited** (no cap). Read once at startup; it is **not** a `ConfigVar` and cannot be changed from the Admin UI. An empty or invalid value falls back to `256`. The pre-v0.9.6 name `CHAT_RESPONSE_MAX_TOOL_CALL_RETRIES` (old default `30`) is still honored as a fallback if this is unset; prefer the new name.

Hitting the limit is visible (since v0.9.6)

On reaching the cap, Open WebUI emits a **`Tool-call limit reached (N iterations).`** error in the chat. Before v0.9.6 it stopped silently (looked like the model "froze"); upgrading is the fix. `256` is high enough for normal runs; raise it or set `-1` only for unbounded agents, accepting that a looping model then runs many more turns before stopping.

#### `ENABLE_RESPONSES_API_STATEFUL` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_responses_api_stateful "Direct link to enable_responses_api_stateful")

- Type: `bool`
- Default: `False`
- Description: Enables stateful session handling for the Responses API by forwarding `previous_response_id` to the upstream endpoint. When enabled, Open WebUI anchors each response to the previous one, allowing the upstream provider to maintain conversation state server-side.

Experimental

**Only enable this if your upstream Responses API endpoint supports stateful sessions** (i.e., server-side response storage with `previous_response_id` anchoring). Most proxies and third-party endpoints are stateless and **will break** if this is enabled. This is intended for direct connections to providers like OpenAI that natively support the Responses API with session state.

#### `BYPASS_MODEL_ACCESS_CONTROL` [​](https://docs.openwebui.com/reference/env-configuration/\#bypass_model_access_control "Direct link to bypass_model_access_control")

- Type: `bool`
- Default: `False`
- Description: Bypasses model access control. When set to `true`, all users (and admins alike) will have access to all models, regardless of the model's privacy setting (Private, Public, Shared with certain groups). This is useful for smaller or individual Open WebUI installations where model access restrictions may not be needed.

#### `BYPASS_RETRIEVAL_ACCESS_CONTROL` [​](https://docs.openwebui.com/reference/env-configuration/\#bypass_retrieval_access_control "Direct link to bypass_retrieval_access_control")

- Type: `bool`
- Default: `False`
- Description: Bypasses access control during RAG retrieval. By default (`false`), Open WebUI checks that the requesting user can read a file or knowledge collection before searching its vectors, so a crafted request cannot pull chunks from files or collections the user does not own. This never blocks legitimate retrieval (you can still retrieve anything you already have access to), so the default is right for essentially every deployment and you should not need to change it. Set `true` only to restore the old permissive behavior (per-file read checks skipped and client-supplied collection references trusted, including legacy knowledge-base `collection_names`), on a fully trusted single-tenant instance that relied on it.

#### `ENABLE_RETRIEVAL_UNSCOPED_COLLECTIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_retrieval_unscoped_collections "Direct link to enable_retrieval_unscoped_collections")

- Type: `bool`
- Default: `False`
- Description: Controls how RAG retrieval treats a collection name that matches no known collection (not a `file-*`, `user-memory-*`, `web-search-*`, or an existing knowledge base). By default (`false`), such unknown names are denied for non-admin users, which closes the legacy "unscoped" collection namespace. Set `true` to let them through as legacy or ephemeral collections, restoring the older behavior. Like `BYPASS_RETRIEVAL_ACCESS_CONTROL`, the default is the safe choice and you should not need to change it.

#### `WEBUI_BUILD_HASH` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_build_hash "Direct link to webui_build_hash")

- Type: `str`
- Default: `dev-build`
- Description: Used for identifying the Git SHA of the build for releases.

#### `WEBUI_BANNERS` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_banners "Direct link to webui_banners")

- Type: `list` of `dict`
- 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 `ConfigVar` variable.

info

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:

```text
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` [​](https://docs.openwebui.com/reference/env-configuration/\#use_cuda_docker "Direct link to use_cuda_docker")

- Type: `bool`
- Default: `False`
- Description: Builds the Docker image with NVIDIA CUDA support. Enables GPU acceleration for local Whisper and embeddings.

#### `DOCKER` [​](https://docs.openwebui.com/reference/env-configuration/\#docker "Direct link to docker")

- Type: `bool`
- Default: `False`
- Description: Indicates whether Open WebUI is running inside a Docker container. Used internally for environment detection.

#### `USE_CUDA` [​](https://docs.openwebui.com/reference/env-configuration/\#use_cuda "Direct link to use_cuda")

- Type: `bool`
- Default: `False`
- Description: Controls whether to use CUDA acceleration for local models. When set to `true`, attempts to detect and use available NVIDIA GPUs. The code reads the environment variable `USE_CUDA_DOCKER` to set this internal boolean variable.

#### `DEVICE_TYPE` [​](https://docs.openwebui.com/reference/env-configuration/\#device_type "Direct link to device_type")

- Type: `str`
- Default: `cpu`
- Description: Specifies the device type for model execution. Automatically set to `cuda` if CUDA is available and enabled, or `mps` for Apple Silicon.

#### `EXTERNAL_PWA_MANIFEST_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#external_pwa_manifest_url "Direct link to 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](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` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_title_generation "Direct link to enable_title_generation")

- Type: `bool`
- Default: `True`
- Description: Enables or disables chat title generation.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LICENSE_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#license_key "Direct link to license_key")

- Type: `str`
- Default: `None`
- Description: Specifies the license key to use (for Enterprise users only).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SSL_ASSERT_FINGERPRINT` [​](https://docs.openwebui.com/reference/env-configuration/\#ssl_assert_fingerprint "Direct link to 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 `ConfigVar` variable.

#### `ENABLE_COMPRESSION_MIDDLEWARE` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_compression_middleware "Direct link to enable_compression_middleware")

- Type: `bool`
- Default: `True`
- Description: Enables gzip compression middleware for HTTP responses, reducing bandwidth usage and improving load times.

#### `DEFAULT_PROMPT_SUGGESTIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#default_prompt_suggestions "Direct link to default_prompt_suggestions")

- Type: `list` of `dict`
- Default: `[]` (which means to use the built-in default prompt suggestions)
- Description: Sets global default prompt suggestions shown to users when starting a new chat. These apply when no model-specific prompt suggestions are configured. Prompt suggestions can also be configured per-model via the Model Editor (see [Prompt Suggestions](https://docs.openwebui.com/features/workspace/models#prompt-suggestions)), or globally for all models using the [Global Model Defaults](https://docs.openwebui.com/features/workspace/models#global-model-defaults-admin) feature. The format is:

```
[{"title": ["Title part 1", "Title part 2"], "content": "prompt"}]
```

### AIOHTTP Client [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp-client "Direct link to AIOHTTP Client")

#### `AIOHTTP_CLIENT_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_client_timeout "Direct link to 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.

info

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` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_client_timeout_model_list "Direct link to aiohttp_client_timeout_model_list")

- Type: `int`
- Default: `10`
- Description: Sets the timeout in seconds for fetching the model list from Ollama and OpenAI endpoints. This affects how long Open WebUI waits for each configured endpoint when loading available models.

When to Adjust This Value

**Lower the timeout** (e.g., `3`) if:

- You have multiple endpoints configured and want faster failover when one is unreachable
- You prefer the UI to load quickly even if some slow endpoints are skipped

**Increase the timeout** (e.g., `30`) if:

- Your model servers are slow to respond (e.g., cold starts, large model loading)
- You're connecting over high-latency networks
- You're using providers like OpenRouter that may have variable response times

Database Persistence

Connection URLs configured via the Admin Settings UI are **persisted in the database** and take precedence over environment variables. If you save an unreachable URL and the UI becomes unresponsive, you may need to use one of these recovery options:

- `RESET_CONFIG_ON_START=true`: Resets database config to environment variable values on next startup
- `ENABLE_PERSISTENT_CONFIG=false`: Always use environment variables (UI changes won't persist)

See the [Model List Loading Issues](https://docs.openwebui.com/troubleshooting/connection-error#%EF%B8%8F-model-list-loading-issues-slow-ui--unreachable-endpoints) troubleshooting guide for detailed recovery steps.

#### `AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_client_timeout_openai_model_list "Direct link to 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.

#### `AIOHTTP_CLIENT_TIMEOUT_TOOL_SERVER` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_client_timeout_tool_server "Direct link to aiohttp_client_timeout_tool_server")

- Type: `int`
- Default: Inherits `AIOHTTP_CLIENT_TIMEOUT` when unset
- Description: Sets the timeout in seconds for executing tool server API calls (OpenAPI/MCP proxy calls made by Open WebUI). Use this to control how long Open WebUI waits for actual tool execution responses.

info

If this variable is unset or invalid, Open WebUI falls back to `AIOHTTP_CLIENT_TIMEOUT`.

#### `AIOHTTP_CLIENT_SESSION_SSL` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_client_session_ssl "Direct link to aiohttp_client_session_ssl")

- Type: `bool` or `str`
- Default: `True`
- Description: Controls SSL/TLS verification for AIOHTTP client sessions when connecting to external APIs (e.g., Ollama Embeddings, and, since v0.9.6, Speech-to-Text / Text-to-Speech audio endpoints). Accepts `True` (verify, the default), `False` (disable verification, allowing self-signed or custom certificates) or a path to a CA bundle file (e.g. `/etc/ssl/certs/corporate-ca.crt`) to verify against your own certificate authority. When set to `True`, it uses `AIOHTTP_CLIENT_SSL_CERT_FILE` as the CA bundle if that variable is configured.

#### `AIOHTTP_CLIENT_SSL_CERT_FILE` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_client_ssl_cert_file "Direct link to aiohttp_client_ssl_cert_file")

- Type: `str`
- Default: `""` (unset)
- Description: Path to a custom CA bundle file used as the default for all outbound HTTPS connections whose SSL verification is enabled (that is, whose own SSL variable is set to `True`). Use it to trust a corporate or internal certificate authority across the whole application without disabling verification. A per-connection override (setting a variable such as `AIOHTTP_CLIENT_SESSION_SSL` directly to a path) takes precedence over this global fallback. Follows the convention of `SSL_CERT_FILE` / `REQUESTS_CA_BUNDLE` but is scoped to Open WebUI so it does not interfere with system-level settings.

#### `AIOHTTP_CLIENT_ALLOW_REDIRECTS` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_client_allow_redirects "Direct link to aiohttp_client_allow_redirects")

- Type: `bool`
- Default: `False`
- Description: Controls whether outbound HTTP requests across the application follow `3xx` redirects. When `False` (the default since v0.9.6), redirects are not followed. This closes a class of SSRF where a public, validated URL `302`-redirects to an internal address (RFC 1918, loopback `127.0.0.1`, cloud-metadata `169.254.169.254`) that bypasses the original allowlist check. Affected call sites include the RAG web loader, image loading and base64 conversion, OAuth pre-flight, code-interpreter login, and tool-server execution. Set to `True` only if your deployment legitimately requires redirect following (e.g. shortlink-style URLs) AND you have other SSRF protections in place, typically an egress firewall or `WEB_FETCH_FILTER_LIST` covering your internal ranges.

#### `USER_AGENT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_agent "Direct link to user_agent")

- Type: `str`
- Default: `""` (unset, falls back to the underlying library default, typically `python-requests/2.x`)
- Description: Overrides the `User-Agent` header that the web loader (`SafeWebBaseLoader`) sends on outbound fetches for web search and the `fetch_url` tool. The default Python library UA is aggressively blocked by Cloudflare, Wikipedia, and similar bot-detection layers, which manifests as empty results or 403s when scraping or searching the public web. Set this to a real browser-like UA (e.g. `Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36`) to restore access. Applies to both the synchronous `_scrape()` and the async `_fetch()` code paths.

#### `AIOHTTP_CLIENT_TIMEOUT_TOOL_SERVER_DATA` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_client_timeout_tool_server_data "Direct link to aiohttp_client_timeout_tool_server_data")

- Type: `int`
- Default: `10`
- Description: Sets the timeout in seconds for retrieving tool server metadata/configuration (for example, loading server data/spec information).

#### `AIOHTTP_CLIENT_SESSION_TOOL_SERVER_SSL` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_client_session_tool_server_ssl "Direct link to aiohttp_client_session_tool_server_ssl")

- Type: `bool` or `str`
- Default: `True`
- Description: Controls SSL/TLS verification specifically for tool server connections (including MCP) via the AIOHTTP client. Accepts `True` (verify, the default), `False` (disable) or a path to a CA bundle file to verify against your own certificate authority. When set to `True`, it falls back to `AIOHTTP_CLIENT_SSL_CERT_FILE` if that variable is configured.

#### `MCP_INITIALIZE_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#mcp_initialize_timeout "Direct link to mcp_initialize_timeout")

- Type: `int`
- Default: `10`
- Description: Timeout in seconds for the MCP `session.initialize()` handshake, which performs a list-tools round-trip. Raise it if your MCP server cold-starts slowly or exposes many tools and connections fail with a timeout during initialization; a server advertising dozens of tools can need 30 to 60 seconds.

#### `AIOHTTP_POOL_CONNECTIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_pool_connections "Direct link to aiohttp_pool_connections")

- Type: `int`
- Default: unset (unlimited)
- Description: Maximum number of total concurrent connections in the shared AIOHTTP client pool used for outbound requests (Ollama, OpenAI-compatible endpoints, etc.). When unset, there is no total cap. Lower this if you need to bound total upstream concurrency.

#### `AIOHTTP_POOL_CONNECTIONS_PER_HOST` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_pool_connections_per_host "Direct link to aiohttp_pool_connections_per_host")

- Type: `int`
- Default: unset (unlimited)
- Description: Maximum number of concurrent connections to any single host in the shared AIOHTTP pool. When unset, there is no per-host cap. Useful for staying under provider-side rate or connection limits.

#### `AIOHTTP_POOL_DNS_TTL` [​](https://docs.openwebui.com/reference/env-configuration/\#aiohttp_pool_dns_ttl "Direct link to aiohttp_pool_dns_ttl")

- Type: `int`
- Default: `300`
- Description: DNS cache TTL in seconds for the shared AIOHTTP pool. Negative or invalid values fall back to `300`. Increase for stable infrastructure; decrease if upstream hosts change IPs frequently.

info

Open WebUI reuses a single long-lived AIOHTTP client session for outbound HTTP traffic, enabling TCP/TLS connection reuse, a shared DNS cache, and bounded concurrency. The three variables above tune this pool; they do not need to be set in typical deployments.

#### `REQUESTS_VERIFY` [​](https://docs.openwebui.com/reference/env-configuration/\#requests_verify "Direct link to requests_verify")

- Type: `bool`
- Default: `True`
- Description: Controls SSL/TLS verification for synchronous `requests` (e.g., Tika, External Reranker). Set to `False` to bypass certificate verification for self-signed certificates.

### Directories [​](https://docs.openwebui.com/reference/env-configuration/\#directories "Direct link to Directories")

#### `DATA_DIR` [​](https://docs.openwebui.com/reference/env-configuration/\#data_dir "Direct link to data_dir")

- Type: `str`
- Default: `./data`
- Description: Specifies the base directory for data storage, including uploads, cache, vector database, etc.

#### `FONTS_DIR` [​](https://docs.openwebui.com/reference/env-configuration/\#fonts_dir "Direct link to fonts_dir")

- Type: `str`
- Description: Specifies the directory for fonts.

#### `FRONTEND_BUILD_DIR` [​](https://docs.openwebui.com/reference/env-configuration/\#frontend_build_dir "Direct link to frontend_build_dir")

- Type: `str`
- Default: `../build`
- Description: Specifies the location of the built frontend files.

#### `STATIC_DIR` [​](https://docs.openwebui.com/reference/env-configuration/\#static_dir "Direct link to static_dir")

- Type: `str`
- Default: `./static`
- Description: Specifies the directory for static files, such as the favicon.

### Logging [​](https://docs.openwebui.com/reference/env-configuration/\#logging "Direct link to Logging")

#### `GLOBAL_LOG_LEVEL` [​](https://docs.openwebui.com/reference/env-configuration/\#global_log_level "Direct link to global_log_level")

- Type: `str`
- Default: `INFO`
- Description: Sets the global logging level for all Open WebUI components. Valid values: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`.

#### `LOG_FORMAT` [​](https://docs.openwebui.com/reference/env-configuration/\#log_format "Direct link to log_format")

- Type: `str`
- Default: Not set (plain-text logging)
- Description: Controls the log output format. Set to `json` to switch all stdout logging to single-line JSON objects, suitable for log aggregators like Loki, Fluentd, CloudWatch, and Datadog. When set to `json`, the ASCII startup banner is also suppressed to keep the log stream parseable. Any other value (or unset) uses the default plain-text format. See the [JSON Logging documentation](https://docs.openwebui.com/getting-started/advanced-topics/logging#structured-json-logging) for details on log fields and examples.

#### `ENABLE_AUDIT_STDOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_audit_stdout "Direct link to enable_audit_stdout")

- Type: `bool`
- Default: `False`
- Description: Controls whether audit logs are output to stdout (console). Useful for containerized environments where logs are collected from stdout.

#### `ENABLE_AUDIT_LOGS_FILE` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_audit_logs_file "Direct link to enable_audit_logs_file")

- Type: `bool`
- Default: `True`
- Description: Controls whether audit logs are written to a file. When enabled, logs are written to the location specified by `AUDIT_LOGS_FILE_PATH`.

#### `AUDIT_LOGS_FILE_PATH` [​](https://docs.openwebui.com/reference/env-configuration/\#audit_logs_file_path "Direct link to audit_logs_file_path")

- Type: `str`
- Default: `${DATA_DIR}/audit.log`
- Description: Configures where the audit log file is stored. Enables storing logs in separate volumes or custom locations for better organization and persistence.
- Example: `/var/log/openwebui/audit.log`, `/mnt/logs/audit.log`

#### `AUDIT_LOG_FILE_ROTATION_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#audit_log_file_rotation_size "Direct link to audit_log_file_rotation_size")

- Type: `str`
- Default: `10MB`
- Description: Specifies the maximum size of the audit log file before rotation occurs (e.g., `10MB`, `100MB`, `1GB`).

#### `AUDIT_UVICORN_LOGGER_NAMES` [​](https://docs.openwebui.com/reference/env-configuration/\#audit_uvicorn_logger_names "Direct link to audit_uvicorn_logger_names")

- Type: `str`
- Default: `uvicorn.access`
- Description: Comma-separated list of logger names to capture for audit logging. Defaults to Uvicorn's access logger.

#### `AUDIT_LOG_LEVEL` [​](https://docs.openwebui.com/reference/env-configuration/\#audit_log_level "Direct link to audit_log_level")

- Type: `str`
- Default: `NONE`
- Options: `NONE`, `METADATA`, `REQUEST`, `REQUEST_RESPONSE`
- Description: Controls the verbosity level of audit logging. `METADATA` logs basic request info, `REQUEST` includes request bodies, `REQUEST_RESPONSE` includes both requests and responses.

#### `MAX_BODY_LOG_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#max_body_log_size "Direct link to max_body_log_size")

- Type: `int`
- Default: `2048`
- Description: Sets the maximum size in bytes for request/response bodies in audit logs. Bodies larger than this are truncated.

#### `AUDIT_EXCLUDED_PATHS` [​](https://docs.openwebui.com/reference/env-configuration/\#audit_excluded_paths "Direct link to audit_excluded_paths")

- Type: `str`
- Default: `/chats,/chat,/folders`
- Description: Comma-separated list of URL paths to exclude from audit logging (blacklist mode). Paths are matched without leading slashes against `/api/` and `/api/v1/` prefixed routes. Ignored when `AUDIT_INCLUDED_PATHS` is set.

#### `AUDIT_INCLUDED_PATHS` [​](https://docs.openwebui.com/reference/env-configuration/\#audit_included_paths "Direct link to audit_included_paths")

- Type: `str`
- Default: Empty string (disabled)
- Description: Comma-separated list of URL paths to include in audit logging (whitelist mode). When set, **only** matching paths are audited and `AUDIT_EXCLUDED_PATHS` is ignored. Paths are matched without leading slashes against `/api/` and `/api/v1/` prefixed routes. Auth endpoints (signin, signout, signup) are always logged regardless of filtering mode.

Whitelist vs Blacklist

By default, audit logging uses **blacklist mode**: all paths are logged except those in `AUDIT_EXCLUDED_PATHS`. If you set `AUDIT_INCLUDED_PATHS`, it switches to **whitelist mode**: only the specified paths are logged. If both are set, whitelist mode takes precedence and a warning is logged at startup.

### Ollama [​](https://docs.openwebui.com/reference/env-configuration/\#ollama "Direct link to Ollama")

#### `ENABLE_OLLAMA_API` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_ollama_api "Direct link to enable_ollama_api")

- Type: `bool`
- Default: `True`
- Description: Enables the use of Ollama APIs.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OLLAMA_BASE_URL` (`OLLAMA_API_BASE_URL` is deprecated) [​](https://docs.openwebui.com/reference/env-configuration/\#ollama_base_url "Direct link to ollama_base_url")

- 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`
- Description: Configures the Ollama backend URL.

#### `OLLAMA_BASE_URLS` [​](https://docs.openwebui.com/reference/env-configuration/\#ollama_base_urls "Direct link to ollama_base_urls")

- Type: `str`
- Description: Configures load-balanced Ollama backend hosts, separated by `;`. See
[`OLLAMA_BASE_URL`](https://docs.openwebui.com/reference/env-configuration/#ollama_base_url). Takes precedence over [`OLLAMA_BASE_URL`](https://docs.openwebui.com/reference/env-configuration/#ollama_base_url).
- Example: `http://host-one:11434;http://host-two:11434`
- Persistence: This environment variable is a `ConfigVar` variable.

Context length: `num_ctx` overrides `OLLAMA_CONTEXT_LENGTH`

`OLLAMA_CONTEXT_LENGTH` is an **Ollama-server** setting, not an Open WebUI variable. Open WebUI's per-model `num_ctx` advanced parameter, when set, is sent on every request and **overrides** it, and the `num_ctx` control pre-fills a small `2048`. See [Context Length](https://docs.openwebui.com/getting-started/quick-start/connect-a-provider/starting-with-ollama#context-length-num_ctx-and-ollama_context_length) for how to set this correctly and avoid blank responses with Native function calling.

#### `OLLAMA_API_CONFIGS` [​](https://docs.openwebui.com/reference/env-configuration/\#ollama_api_configs "Direct link to ollama_api_configs")

- Type: `str` (JSON)
- Default: `{}`
- Description: Per-connection configuration for the Ollama backends, as a JSON object keyed by the connection's index in [`OLLAMA_BASE_URLS`](https://docs.openwebui.com/reference/env-configuration/#ollama_base_urls) (its URL is also accepted as a legacy key). Each entry mirrors the per-connection settings from the admin UI, for example `enable`, `prefix_id`, `model_ids`, `tags`, and `connection_type`.
- Example: `{"0": {"enable": true, "prefix_id": "local", "model_ids": ["llama3.1:latest"]}}`
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USE_OLLAMA_DOCKER` [​](https://docs.openwebui.com/reference/env-configuration/\#use_ollama_docker "Direct link to use_ollama_docker")

- Type: `bool`
- Default: `False`
- Description: Builds the Docker image with a bundled Ollama instance.

#### `K8S_FLAG` [​](https://docs.openwebui.com/reference/env-configuration/\#k8s_flag "Direct link to k8s_flag")

- Type: `bool`
- Default: `False`
- Description: If set, assumes Helm chart deployment and sets [`OLLAMA_BASE_URL`](https://docs.openwebui.com/reference/env-configuration/#ollama_base_url) to `http://ollama-service.open-webui.svc.cluster.local:11434`

### OpenAI [​](https://docs.openwebui.com/reference/env-configuration/\#openai "Direct link to OpenAI")

#### `ENABLE_OPENAI_API` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_openai_api "Direct link to enable_openai_api")

- Type: `bool`
- Default: `True`
- Description: Enables the use of OpenAI APIs.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OPENAI_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#openai_api_base_url "Direct link to 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 `ConfigVar` variable.

#### `OPENAI_API_BASE_URLS` [​](https://docs.openwebui.com/reference/env-configuration/\#openai_api_base_urls "Direct link to 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 `ConfigVar` variable.

#### `OPENAI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#openai_api_key "Direct link to openai_api_key")

- Type: `str`
- Description: Sets the OpenAI API key.
- Example: `sk-124781258123`
- Persistence: This environment variable is a `ConfigVar` variable.

Provider Key Scope (Important)

For OpenAI-compatible backends and proxies (including LiteLLM), configure least-privilege keys for regular user traffic whenever possible.

Do not use provider management/master keys unless your deployment explicitly requires that trust level.

#### `OPENAI_API_KEYS` [​](https://docs.openwebui.com/reference/env-configuration/\#openai_api_keys "Direct link to openai_api_keys")

- Type: `str`
- Description: Supports multiple OpenAI API keys, semicolon-separated.
- Example: `sk-124781258123;sk-4389759834759834`
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OPENAI_API_CONFIGS` [​](https://docs.openwebui.com/reference/env-configuration/\#openai_api_configs "Direct link to openai_api_configs")

- Type: `str` (JSON)
- Default: `{}`
- Description: Per-connection configuration for the OpenAI-compatible backends, as a JSON object keyed by the connection's index in [`OPENAI_API_BASE_URLS`](https://docs.openwebui.com/reference/env-configuration/#openai_api_base_urls) (its URL is also accepted as a legacy key). Each entry mirrors the per-connection settings from the admin UI, for example `enable`, `prefix_id`, `model_ids`, `tags`, and `connection_type`.
- Example: `{"0": {"enable": true, "prefix_id": "openai", "model_ids": ["gpt-4o"]}}`
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_OPENAI_API_PASSTHROUGH` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_openai_api_passthrough "Direct link to enable_openai_api_passthrough")

- Type: `bool`
- Default: `False`
- Description: When enabled, the OpenAI proxy's catch-all endpoint (`/{path:path}`) forwards any request to the upstream OpenAI-compatible API using the admin-configured API key and without additional access control. When disabled (default), the catch-all returns `403 Forbidden`. Other routers (Ollama, Responses) do not have catch-all proxies.

danger

**Keep this disabled unless you explicitly need it.** The catch-all proxy forwards requests to the upstream API using the admin's API key with no model-level access control. Any authenticated user can reach any upstream endpoint, including endpoints not natively handled by Open WebUI, using the admin's credentials. Only enable this if you understand and accept these implications.

### Tasks [​](https://docs.openwebui.com/reference/env-configuration/\#tasks "Direct link to Tasks")

#### `TASK_MODEL` [​](https://docs.openwebui.com/reference/env-configuration/\#task_model "Direct link to task_model")

- Type: `str`
- Description: The default model to use for tasks such as title and web search query generation
when using Ollama models.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `TASK_MODEL_EXTERNAL` [​](https://docs.openwebui.com/reference/env-configuration/\#task_model_external "Direct link to task_model_external")

- Type: `str`
- Description: The default model to use for tasks such as title and web search query generation
when using OpenAI-compatible endpoints.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_CONTEXT_COMPACTION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_context_compaction "Direct link to enable_context_compaction")

- Type: `bool`
- Default: `False`
- Description: Enables automatic context compaction. When a chat's estimated context exceeds `CONTEXT_COMPACTION_TOKEN_THRESHOLD`, older messages are summarized into a checkpoint and dropped from what is sent to the model, while recent messages are kept, so long conversations stay within the model's context window. Can also be toggled in **Admin Panel > Settings > Interface**.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CONTEXT_COMPACTION_TOKEN_THRESHOLD` [​](https://docs.openwebui.com/reference/env-configuration/\#context_compaction_token_threshold "Direct link to context_compaction_token_threshold")

- Type: `int`
- Default: `80000`
- Description: The estimated context size, in tokens, above which older messages are compacted when `ENABLE_CONTEXT_COMPACTION` is on. Lower it for smaller-context models, raise it for larger ones. This is the global maximum: an individual model can set a _lower_ threshold of its own with the **Context Compaction Threshold** advanced parameter (`compact_token_threshold`), but it cannot raise it above this value.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CONTEXT_COMPACTION_PROMPT_TEMPLATE` [​](https://docs.openwebui.com/reference/env-configuration/\#context_compaction_prompt_template "Direct link to context_compaction_prompt_template")

- Type: `str`
- Default: Empty string (falls back to the built-in default compaction prompt)
- Description: The prompt used to summarize the messages being compacted. Leave empty to use the built-in default, or provide a custom prompt. Supports two variables: `{{COMPACTED_MESSAGES}}` (the messages being summarized) and `{{RECENT_MESSAGES}}` (the messages kept in context).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `TITLE_GENERATION_PROMPT_TEMPLATE` [​](https://docs.openwebui.com/reference/env-configuration/\#title_generation_prompt_template "Direct link to title_generation_prompt_template")

- Type: `str`
- Description: Prompt to use when generating chat titles.
- Default: The value of `DEFAULT_TITLE_GENERATION_PROMPT_TEMPLATE` environment variable.

`DEFAULT_TITLE_GENERATION_PROMPT_TEMPLATE`:

```text

### Task:
Generate a concise, 3-5 word title with an emoji summarizing the chat history.

### Guidelines:
- The title should clearly represent the main theme or subject of the conversation.
- Use emojis that enhance understanding of the topic, but avoid quotation marks or special formatting.
- Write the title in the chat's primary language; default to English if multilingual.
- Prioritize accuracy over excessive creativity; keep it clear and simple.

### Output:
JSON format: { "title": "your concise title here" }

### Examples:
- { "title": "📉 Stock Market Trends" },
- { "title": "🍪 Perfect Chocolate Chip Recipe" },
- { "title": "Evolution of Music Streaming" },
- { "title": "Remote Work Productivity Tips" },
- { "title": "Artificial Intelligence in Healthcare" },
- { "title": "🎮 Video Game Development Insights" }

### Chat History:
<chat_history>
{{MESSAGES:END:2}}
</chat_history>
```

- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_FOLLOW_UP_GENERATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_follow_up_generation "Direct link to enable_follow_up_generation")

- Type: `bool`
- Default: `True`
- Description: Enables or disables follow up generation.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `FOLLOW_UP_GENERATION_PROMPT_TEMPLATE` [​](https://docs.openwebui.com/reference/env-configuration/\#follow_up_generation_prompt_template "Direct link to follow_up_generation_prompt_template")

- Type: `str`
- Description: Prompt to use for generating several relevant follow-up questions.
- Default: The value of `DEFAULT_FOLLOW_UP_GENERATION_PROMPT_TEMPLATE` environment variable.

`DEFAULT_FOLLOW_UP_GENERATION_PROMPT_TEMPLATE`:

```text

### Task:
Suggest 3-5 relevant follow-up questions or prompts that the user might naturally ask next in this conversation as a **user**, based on the chat history, to help continue or deepen the discussion.

### Guidelines:
- Write all follow-up questions from the user’s point of view, directed to the assistant.
- Make questions concise, clear, and directly related to the discussed topic(s).
- Only suggest follow-ups that make sense given the chat content and do not repeat what was already covered.
- If the conversation is very short or not specific, suggest more general (but relevant) follow-ups the user might ask.
- Use the conversation's primary language; default to English if multilingual.
- Response must be a JSON array of strings, no extra text or formatting.

### Output:
JSON format: { "follow_ups": ["Question 1?", "Question 2?", "Question 3?"] }

### Chat History:
<chat_history>
{{MESSAGES:END:6}}
</chat_history>"
```

- Persistence: This environment variable is a `ConfigVar` variable.

#### `TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE` [​](https://docs.openwebui.com/reference/env-configuration/\#tools_function_calling_prompt_template "Direct link to tools_function_calling_prompt_template")

- Type: `str`
- Description: Prompt to use when calling tools.
- Default: The value of `DEFAULT_TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE` environment variable.

`DEFAULT_TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE`:

```text
Available Tools: {{TOOLS}}

Your task is to choose and return the correct tool(s) from the list of available tools based on the query. Follow these guidelines:

- Return only the JSON object, without any additional text or explanation.

- If no tools match the query, return an empty array:
   {
     "tool_calls": []
   }

- If one or more tools match the query, construct a JSON response containing a "tool_calls" array with objects that include:
   - "name": The tool's name.
   - "parameters": A dictionary of required parameters and their corresponding values.

The format for the JSON response is strictly:
{
  "tool_calls": [\
    {"name": "toolName1", "parameters": {"key1": "value1"}},\
    {"name": "toolName2", "parameters": {"key2": "value2"}}\
  ]
}
```

- Persistence: This environment variable is a `ConfigVar` variable.

### Code Execution [​](https://docs.openwebui.com/reference/env-configuration/\#code-execution "Direct link to Code Execution")

#### `ENABLE_CODE_EXECUTION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_code_execution "Direct link to enable_code_execution")

- Type: `bool`
- Default: `True`
- Description: Enables or disables code execution.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_EXECUTION_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#code_execution_engine "Direct link to code_execution_engine")

- Type: `str`
- Default: `pyodide`
- Description: Specifies the code execution engine to use. `pyodide` (browser) and `jupyter` (server) are **legacy** engines; for full Python and shell access use [Open Terminal](https://docs.openwebui.com/features/open-terminal) instead.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_EXECUTION_JUPYTER_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#code_execution_jupyter_url "Direct link to code_execution_jupyter_url")

- Type: `str`
- Default: `None`
- Description: Specifies the Jupyter URL to use for code execution.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_EXECUTION_JUPYTER_AUTH` [​](https://docs.openwebui.com/reference/env-configuration/\#code_execution_jupyter_auth "Direct link to code_execution_jupyter_auth")

- Type: `str`
- Default: `None`
- Description: Specifies the Jupyter authentication method to use for code execution.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_EXECUTION_JUPYTER_AUTH_TOKEN` [​](https://docs.openwebui.com/reference/env-configuration/\#code_execution_jupyter_auth_token "Direct link to code_execution_jupyter_auth_token")

- Type: `str`
- Default: `None`
- Description: Specifies the Jupyter authentication token to use for code execution.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_EXECUTION_JUPYTER_AUTH_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#code_execution_jupyter_auth_password "Direct link to code_execution_jupyter_auth_password")

- Type: `str`
- Default: `None`
- Description: Specifies the Jupyter authentication password to use for code execution.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_EXECUTION_JUPYTER_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#code_execution_jupyter_timeout "Direct link to code_execution_jupyter_timeout")

- Type: `str`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the timeout for Jupyter code execution.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_PYODIDE_FILE_PERSISTENCE` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_pyodide_file_persistence "Direct link to enable_pyodide_file_persistence")

- Type: `bool`
- Default: `False`
- Description: Controls whether the browser-based **Pyodide** engine keeps its virtual filesystem (`/mnt/uploads/`, backed by IndexedDB) **persistent across page reloads**. When `False` (default), Pyodide runs in an isolated, sandboxed (opaque-origin) iframe and its filesystem does not survive a reload. Set to `True` to enable persistent file storage, which requires running Pyodide same-origin and relaxes that isolation. Files created within a single session work either way; this flag only affects cross-reload persistence and the durability of the file browser.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

### Code Interpreter [​](https://docs.openwebui.com/reference/env-configuration/\#code-interpreter "Direct link to Code Interpreter")

#### `ENABLE_CODE_INTERPRETER` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_code_interpreter "Direct link to enable_code_interpreter")

- Type: `bool`
- Default: `True`
- Description: Enables or disables code interpreter.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_INTERPRETER_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#code_interpreter_engine "Direct link to code_interpreter_engine")

- Type: `str`
- Default: `pyodide`
- Description: Specifies the code interpreter engine to use. `pyodide` and `jupyter` are **legacy** engines; for full Python and shell access use [Open Terminal](https://docs.openwebui.com/features/open-terminal) instead.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_INTERPRETER_BLACKLISTED_MODULES` [​](https://docs.openwebui.com/reference/env-configuration/\#code_interpreter_blacklisted_modules "Direct link to code_interpreter_blacklisted_modules")

- Type: `str` (comma-separated list of module names)
- Default: None
- Description: Specifies a comma-separated list of Python modules that are blacklisted and cannot be imported or used within the code interpreter. This enhances security by preventing access to potentially sensitive or system-level functionalities.

#### `CODE_INTERPRETER_PROMPT_TEMPLATE` [​](https://docs.openwebui.com/reference/env-configuration/\#code_interpreter_prompt_template "Direct link to code_interpreter_prompt_template")

- Type: `str`
- Default: `None`
- Description: Specifies the prompt template to use for code interpreter.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_INTERPRETER_JUPYTER_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#code_interpreter_jupyter_url "Direct link to code_interpreter_jupyter_url")

- Type: `str`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the Jupyter URL to use for code interpreter.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_INTERPRETER_JUPYTER_AUTH` [​](https://docs.openwebui.com/reference/env-configuration/\#code_interpreter_jupyter_auth "Direct link to code_interpreter_jupyter_auth")

- Type: `str`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the Jupyter authentication method to use for code interpreter.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_INTERPRETER_JUPYTER_AUTH_TOKEN` [​](https://docs.openwebui.com/reference/env-configuration/\#code_interpreter_jupyter_auth_token "Direct link to code_interpreter_jupyter_auth_token")

- Type: `str`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the Jupyter authentication token to use for code interpreter.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_INTERPRETER_JUPYTER_AUTH_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#code_interpreter_jupyter_auth_password "Direct link to code_interpreter_jupyter_auth_password")

- Type: `str`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the Jupyter authentication password to use for code interpreter.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CODE_INTERPRETER_JUPYTER_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#code_interpreter_jupyter_timeout "Direct link to code_interpreter_jupyter_timeout")

- Type: `str`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the timeout for the Jupyter code interpreter.
- Persistence: This environment variable is a `ConfigVar` variable.

### Direct Connections (OpenAPI/MCPO Tool Servers) [​](https://docs.openwebui.com/reference/env-configuration/\#direct-connections-openapimcpo-tool-servers "Direct link to Direct Connections (OpenAPI/MCPO Tool Servers)")

#### `ENABLE_DIRECT_CONNECTIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_direct_connections "Direct link to enable_direct_connections")

- Type: `bool`
- Default: `True`
- Description: Enables or disables direct connections.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `TOOL_SERVER_CONNECTIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#tool_server_connections "Direct link to tool_server_connections")

- Type: `str` (JSON array)
- Default: `[]`
- Description: Specifies a JSON array of tool server connection configurations. Each connection should define the necessary parameters to connect to external tool servers that implement the OpenAPI/MCPO protocol. For mcpo-backed routes, `path` should point at the mounted tool route. The JSON must be properly formatted or it will fallback to an empty array.
- Field reference:
  - `url`: the server base URL.
  - `path`: the specific tool route exposed by the server.
  - `auth_type`: the authentication mode for the connection.
  - `key`: the API key or token used by the selected auth mode.
  - `config`: per-connection configuration object, such as `{ "enable": true }`.
  - `info`: optional metadata shown in the UI, such as the connection name and description.
  - `spec_type` / `spec`: OpenAPI spec location details when the connection is backed by a spec URL or file.
- Example:

```
[\
  {\
    "type": "openapi",\
    "url": "example-url",\
    "spec_type": "url",\
    "spec": "",\
    "path": "openapi.json",\
    "auth_type": "none",\
    "key": "",\
    "config": { "enable": true },\
    "info": {\
      "id": "",\
      "name": "example-server",\
      "description": "MCP server description."\
    }\
  }\
]
```

- Persistence: This environment variable is a `ConfigVar` variable.

warning

The JSON data structure of `TOOL_SERVER_CONNECTIONS` might evolve over time as new features are added.

### Terminal Server [​](https://docs.openwebui.com/reference/env-configuration/\#terminal-server "Direct link to Terminal Server")

#### `TERMINAL_SERVER_CONNECTIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#terminal_server_connections "Direct link to terminal_server_connections")

- Type: `str` (JSON array)
- Default: `[]`
- Description: Specifies a JSON array of terminal server connection configurations. Each connection defines the parameters needed to connect to an [Open Terminal](https://docs.openwebui.com/features/open-terminal) instance or a [Terminals orchestrator](https://docs.openwebui.com/features/open-terminal/terminals/). Unlike user-level tool server connections, these are admin-configured and proxied through Open WebUI, which means the terminal URL and API key are never exposed to the browser. Supports group-based access control via `access_grants`.
- Example (direct Open Terminal connection):

```
[\
  {\
    "id": "unique-id",\
    "url": "http://open-terminal:8000",\
    "key": "your-api-key",\
    "name": "Dev Terminal",\
    "auth_type": "bearer",\
    "config": {\
      "access_grants": []\
    }\
  }\
]
```

- Example (Terminals orchestrator connection):

```
[\
  {\
    "id": "terminals",\
    "url": "http://terminals-orchestrator:8080",\
    "key": "your-api-key",\
    "name": "Terminals",\
    "auth_type": "bearer",\
    "config": {\
      "access_grants": [\
        {"principal_type": "user", "principal_id": "*", "permission": "read"}\
      ]\
    }\
  }\
]
```

- Persistence: This environment variable is a `ConfigVar` variable.

Helm chart auto-configuration

When deploying on Kubernetes with the Open WebUI Helm chart and `terminals.enabled: true`, this variable is set automatically to point at the in-cluster orchestrator service. See the [Terminals (Orchestrator) guide](https://docs.openwebui.com/features/open-terminal/terminals/) for details.

warning

The JSON data structure of `TERMINAL_SERVER_CONNECTIONS` might evolve over time as new features are added.

#### `TERMINAL_PROXY_HEADERS` [​](https://docs.openwebui.com/reference/env-configuration/\#terminal_proxy_headers "Direct link to terminal_proxy_headers")

- Type: `str` (JSON object)

- Default: `{}`

- Description: Custom HTTP response headers to inject into responses returned by the terminal proxy. The terminal proxy strips a fixed set of hop-by-hop and security-sensitive headers from the upstream response; entries in this object are merged in afterward and take precedence on conflicts, so admins can set deployment-specific headers on proxied terminal content without touching the application. Invalid JSON falls back to `{}` with no headers added.

**Security note.** The default of `{}` means the proxy forwards upstream content (HTML, JS, anything) verbatim under the Open WebUI same origin. This is intentional: many legitimate open-terminal use cases (dev servers, internal tooling, web UIs the admin runs through the terminal) depend on JavaScript executing in the proxy response. For multi-user deployments where mutually-trusted users share a single terminal-server connection, this is fine. For deployments where users in the same trust group should be additionally isolated from each other's proxied content (or where the terminal-server feature is exposed to less-trusted users on top of the documented [multi-user setup tiers](https://docs.openwebui.com/features/open-terminal/advanced/multi-user)), set this to a sandbox CSP that locks proxied JS into an opaque origin while still allowing it to run for legitimate workflows:





```
TERMINAL_PROXY_HEADERS='{"Content-Security-Policy": "sandbox allow-scripts; default-src '\''none'\''; img-src '\''self'\'' data:; style-src '\''unsafe-inline'\''", "X-Content-Type-Options": "nosniff", "Referrer-Policy": "no-referrer", "X-Frame-Options": "DENY"}'
```





Note: do **not** add `allow-same-origin` to the `sandbox` directive. That keyword nullifies the origin-isolation that makes the sandbox effective against `localStorage` exfiltration. The example above intentionally omits it.


### Autocomplete [​](https://docs.openwebui.com/reference/env-configuration/\#autocomplete "Direct link to Autocomplete")

#### `ENABLE_AUTOCOMPLETE_GENERATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_autocomplete_generation "Direct link to enable_autocomplete_generation")

- Type: `bool`
- Default: `True`
- Description: Enables or disables autocomplete generation.
- Persistence: This environment variable is a `ConfigVar` variable.

info

When enabling `ENABLE_AUTOCOMPLETE_GENERATION`, ensure that you also configure `AUTOCOMPLETE_GENERATION_INPUT_MAX_LENGTH` and `AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATE` accordingly.

#### `AUTOCOMPLETE_GENERATION_INPUT_MAX_LENGTH` [​](https://docs.openwebui.com/reference/env-configuration/\#autocomplete_generation_input_max_length "Direct link to autocomplete_generation_input_max_length")

- Type: `int`
- Default: `-1`
- Description: Sets the maximum input length for autocomplete generation.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATE` [​](https://docs.openwebui.com/reference/env-configuration/\#autocomplete_generation_prompt_template "Direct link to autocomplete_generation_prompt_template")

- Type: `str`
- Default: The value of the `DEFAULT_AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATE` environment variable.

`DEFAULT_AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATE`:

```text

### Task:
You are an autocompletion system. Continue the text in `<text>` based on the **completion type** in `<type>` and the given language.

### **Instructions**:
1. Analyze `<text>` for context and meaning.
2. Use `<type>` to guide your output:
   - **General**: Provide a natural, concise continuation.
   - **Search Query**: Complete as if generating a realistic search query.
3. Start as if you are directly continuing `<text>`. Do **not** repeat, paraphrase, or respond as a model. Simply complete the text.
4. Ensure the continuation:
   - Flows naturally from `<text>`.
   - Avoids repetition, overexplaining, or unrelated ideas.
5. If unsure, return: `{ "text": "" }`.

### **Output Rules**:
- Respond only in JSON format: `{ "text": "<your_completion>" }`.

### **Examples**:

#### Example 1:
Input:
<type>General</type>
<text>The sun was setting over the horizon, painting the sky</text>
Output:
{ "text": "with vibrant shades of orange and pink." }

#### Example 2:
Input:
<type>Search Query</type>
<text>Top-rated restaurants in</text>
Output:
{ "text": "New York City for Italian cuisine." }

---

### Context:
<chat_history>
{{MESSAGES:END:6}}
</chat_history>
<type>{{TYPE}}</type>
<text>{{PROMPT}}</text>

#### Output:
```

- Description: Sets the prompt template for autocomplete generation.
- Persistence: This environment variable is a `ConfigVar` variable.

### Evaluation Arena Model [​](https://docs.openwebui.com/reference/env-configuration/\#evaluation-arena-model "Direct link to Evaluation Arena Model")

#### `ENABLE_EVALUATION_ARENA_MODELS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_evaluation_arena_models "Direct link to enable_evaluation_arena_models")

- Type: `bool`
- Default: `True`
- Description: Enables or disables evaluation arena models.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `EVALUATION_ARENA_MODELS` [​](https://docs.openwebui.com/reference/env-configuration/\#evaluation_arena_models "Direct link to evaluation_arena_models")

- Type: `str` (JSON)
- Default: `[]`
- Description: Defines the evaluation arena models as a JSON list of objects. Used to seed the arena model configuration at startup, mirroring what can be configured in the admin evaluation settings.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_MESSAGE_RATING` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_message_rating "Direct link to enable_message_rating")

- Type: `bool`
- Default: `True`
- Description: Enables message rating feature.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_COMMUNITY_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_community_sharing "Direct link to enable_community_sharing")

- Type: `bool`
- Default: `True`
- Description: Controls whether users can share content with the Open WebUI Community and access community resources. When enabled, this setting shows the following UI elements across the application:
  - **Prompts Workspace**: "Made by Open WebUI Community" section with a link to discover community prompts, and a "Share" button in the prompt menu dropdown
  - **Tools Workspace**: "Made by Open WebUI Community" section with a link to discover community tools, and a "Share" button in the tool menu dropdown
  - **Models Workspace**: "Made by Open WebUI Community" section with a link to discover community model presets, and a "Share" button in the model menu dropdown
  - **Functions Admin**: "Made by Open WebUI Community" section with a link to discover community functions
  - **Share Chat Modal**: "Share to Open WebUI Community" button when sharing a chat conversation
  - **Evaluation Feedbacks**: "Share to Open WebUI Community" button for contributing feedback history to the community leaderboard
  - **Stats Sync Modal**: Enables syncing usage statistics with the community
- Persistence: This environment variable is a `ConfigVar` variable.

info

When `ENABLE_COMMUNITY_SHARING` is set to `False`, all community sharing buttons and community resource discovery sections will be hidden from the UI. Users will still be able to export content locally, but the option to share directly to the Open WebUI Community will not be available.

### Tags Generation [​](https://docs.openwebui.com/reference/env-configuration/\#tags-generation "Direct link to Tags Generation")

#### `ENABLE_TAGS_GENERATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_tags_generation "Direct link to enable_tags_generation")

- Type: `bool`
- Default: `True`
- Description: Enables or disables tag generation.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `TAGS_GENERATION_PROMPT_TEMPLATE` [​](https://docs.openwebui.com/reference/env-configuration/\#tags_generation_prompt_template "Direct link to tags_generation_prompt_template")

- Type: `str`
- Default: The value of `DEFAULT_TAGS_GENERATION_PROMPT_TEMPLATE` environment variable.

`DEFAULT_TAGS_GENERATION_PROMPT_TEMPLATE`:

```text

### Task:
Generate 1-3 broad tags categorizing the main themes of the chat history, along with 1-3 more specific subtopic tags.

### Guidelines:
- Start with high-level domains (e.g., Science, Technology, Philosophy, Arts, Politics, Business, Health, Sports, Entertainment, Education)
- Consider including relevant subfields/subdomains if they are strongly represented throughout the conversation
- If content is too short (less than 3 messages) or too diverse, use only ["General"]
- Use the chat's primary language; default to English if multilingual
- Prioritize accuracy over specificity

### Output:
JSON format: { "tags": ["tag1", "tag2", "tag3"] }

### Chat History:
<chat_history>
{{MESSAGES:END:6}}
</chat_history>
```

- Description: Sets the prompt template for tag generation.
- Persistence: This environment variable is a `ConfigVar` variable.

### API Key Endpoint Restrictions [​](https://docs.openwebui.com/reference/env-configuration/\#api-key-endpoint-restrictions "Direct link to API Key Endpoint Restrictions")

#### `ENABLE_API_KEYS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_api_keys "Direct link to enable_api_keys")

- Type: `bool`
- Default: `False`
- Description: Enables the API key creation feature, allowing users to generate API keys for programmatic access to Open WebUI.
- Persistence: This environment variable is a `ConfigVar` variable.

info

This variable replaces the deprecated `ENABLE_API_KEY` environment variable.

info

For API Key creation (and the API keys themselves) to work:

1. Enable API keys globally using this setting (`ENABLE_API_KEYS`)
2. For non-admin users, grant the "API Keys" permission via Default Permissions or User Groups

**Note:** Administrators can generate API keys whenever `ENABLE_API_KEYS` is enabled, even without `features.api_keys`.

#### `ENABLE_API_KEYS_ENDPOINT_RESTRICTIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_api_keys_endpoint_restrictions "Direct link to enable_api_keys_endpoint_restrictions")

- Type: `bool`
- Default: `False`
- Description: Enables API key endpoint restrictions for added security and configurability, allowing administrators to limit which endpoints can be accessed using API keys.
- Persistence: This environment variable is a `ConfigVar` variable.

info

This variable replaces the deprecated `ENABLE_API_KEY_ENDPOINT_RESTRICTIONS` environment variable.

#### `API_KEYS_ALLOWED_ENDPOINTS` [​](https://docs.openwebui.com/reference/env-configuration/\#api_keys_allowed_endpoints "Direct link to api_keys_allowed_endpoints")

- Type: `str`
- Description: Specifies a comma-separated list of allowed API endpoints when API key endpoint restrictions are enabled.
- Example: `/api/v1/messages,/api/v1/channels,/api/v1/chat/completions`
- Persistence: This environment variable is a `ConfigVar` variable.

note

The value of `API_KEYS_ALLOWED_ENDPOINTS` should be a comma-separated list of endpoint URLs, such as `/api/v1/messages, /api/v1/channels`.

info

This variable replaces the deprecated `API_KEY_ALLOWED_ENDPOINTS` environment variable.

#### `CUSTOM_API_KEY_HEADER` [​](https://docs.openwebui.com/reference/env-configuration/\#custom_api_key_header "Direct link to custom_api_key_header")

- Type: `str`
- Default: `x-api-key`
- Description: Name of the HTTP header the auth middleware checks for API-key credentials. Useful when Open WebUI sits behind a reverse proxy or API gateway that consumes the `Authorization` header for its own authentication, set this to a distinct header (for example `X-OpenWebUI-Key`) so clients can deliver their Open WebUI API key without colliding with the proxy's own auth.
- Read at startup from the process environment (not a `ConfigVar`).

**How the auth middleware picks up a credential**, in order:

1. `Authorization: Bearer <token>` (most common, API key or JWT)
2. `token` cookie (Bearer, used by the WebUI itself)
3. The header named by `CUSTOM_API_KEY_HEADER` (default `x-api-key`)

If none of the three is present, the request falls through as anonymous.

Behind a proxy that eats `Authorization`?

Many corporate gateways (basic auth, mutual TLS adapters, SSO sidecars) consume the `Authorization` header and never forward it upstream. In that case, point your clients at the custom header instead:

```
curl -H "X-OpenWebUI-Key: sk-..." http://openwebui.internal/api/models
```

And set on the Open WebUI container:

```text
CUSTOM_API_KEY_HEADER=X-OpenWebUI-Key
```

The header name is matched case-insensitively by the ASGI layer, so pick whatever fits your naming convention.

### Model Caching [​](https://docs.openwebui.com/reference/env-configuration/\#model-caching "Direct link to Model Caching")

#### `ENABLE_BASE_MODELS_CACHE` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_base_models_cache "Direct link to enable_base_models_cache")

- Type: `bool`
- Default: `False`
- Description: When enabled, caches the list of base models from connected Ollama and OpenAI-compatible endpoints in memory. This reduces the number of API calls made to external model providers when loading the model selector, improving performance particularly for deployments with many users or slow connections to model endpoints. Can also be configured from Admin Panel > Settings > Connections > "Cache Base Model List".
- Persistence: This environment variable is a `ConfigVar` variable.

**How the cache works:**

- **Initialization**: When enabled, base models are fetched and cached during application startup.
- **Storage**: The cache is stored in application memory (`app.state.BASE_MODELS`).
- **Cache Hit**: Subsequent requests for models return the cached list without contacting external endpoints.
- **Cache Refresh**: The cache is refreshed when:
  - The application restarts
  - The connection settings are saved in the **Admin Panel > Settings > Connections** (clicking the **Save** button on the bottom right will trigger a refresh and update the cache with the newly fetched models)
- **No TTL**: There is no automatic time-based expiration.

Performance Consideration

Enable this setting in production environments where model lists are relatively stable. For development environments or when frequently adding/removing models from Ollama, you may prefer to leave it disabled for real-time model discovery.

#### `MODELS_CACHE_TTL` [​](https://docs.openwebui.com/reference/env-configuration/\#models_cache_ttl "Direct link to models_cache_ttl")

- Type: `int`
- Default: `1`
- Description: Sets the cache time-to-live in seconds for model list responses from OpenAI and Ollama endpoints. This reduces API calls by caching the available models list for the specified duration. Set to empty string to disable caching entirely.

This caches the external model lists retrieved from configured OpenAI-compatible and Ollama API endpoints (not Open WebUI's internal model configurations). Higher values improve performance by reducing redundant API requests to external providers but may delay visibility of newly added or removed models on those endpoints. A value of 0 disables caching and forces fresh API calls each time.

High-Traffic Recommendation

In high-traffic scenarios, increasing this value (e.g., to 300 seconds) can significantly reduce load on external API endpoints while still providing reasonably fresh model data.

Two Caching Mechanisms

Open WebUI has **two model caching mechanisms** that work independently:

| Setting | Type | Default | Refresh Trigger |
| --- | --- | --- | --- |
| `ENABLE_BASE_MODELS_CACHE` | In-memory | `False` | App restart OR Admin Save |
| `MODELS_CACHE_TTL` | TTL-based | `1` second | Automatic after TTL expires |

For maximum performance, enable both: `ENABLE_BASE_MODELS_CACHE=True` with `MODELS_CACHE_TTL=300`.

#### `JWT_EXPIRES_IN` [​](https://docs.openwebui.com/reference/env-configuration/\#jwt_expires_in "Direct link to jwt_expires_in")

- Type: `str`
- Default: `4w`
- Description: Sets the JWT expiration time in seconds. Valid time units: `s`, `m`, `h`, `d`, `w` or `-1` for no expiration.
- Persistence: This environment variable is a `ConfigVar` variable.

warning

Setting `JWT_EXPIRES_IN` to `-1` disables JWT expiration, making issued tokens valid forever. **This is extremely dangerous in production** and exposes your system to severe security risks if tokens are leaked or compromised.

**Always set a reasonable expiration time in production environments (e.g., `3600s`, `1h`, `7d` etc.) to limit the lifespan of authentication tokens.**

**NEVER use `-1` in a production environment.**

If you have already deployed with `JWT_EXPIRES_IN=-1`, you can rotate or change your `WEBUI_SECRET_KEY` to immediately invalidate all existing tokens.

### Memory [​](https://docs.openwebui.com/reference/env-configuration/\#memory "Direct link to Memory")

Settings for the experimental long-term memory system ( **Settings → Personalization → Memory**). Memories are stored per user and can be of `type``user` (explicit facts) or `context` (learned from conversation).

#### `ENABLE_MEMORY_BACKGROUND_REVIEW` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_memory_background_review "Direct link to enable_memory_background_review")

- Type: `bool`
- Default: `False`
- Description: When enabled, Open WebUI periodically reviews recent conversation in the background and updates the user's `context` memories automatically, instead of only on explicit save. Off by default.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

#### `MEMORIES_REVIEW_INTERVAL_TURNS` [​](https://docs.openwebui.com/reference/env-configuration/\#memories_review_interval_turns "Direct link to memories_review_interval_turns")

- Type: `int`
- Default: `10`
- Description: How many conversation turns elapse between background memory reviews when `ENABLE_MEMORY_BACKGROUND_REVIEW` is enabled.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

#### `MEMORIES_CONTEXT_CHAR_LIMIT` [​](https://docs.openwebui.com/reference/env-configuration/\#memories_context_char_limit "Direct link to memories_context_char_limit")

- Type: `int`
- Default: `2000`
- Description: Maximum number of characters of `context`-type memories injected into the prompt. Older or lower-priority context memories beyond this budget are not included.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

#### `MEMORIES_USER_CHAR_LIMIT` [​](https://docs.openwebui.com/reference/env-configuration/\#memories_user_char_limit "Direct link to memories_user_char_limit")

- Type: `int`
- Default: `2000`
- Description: Maximum number of characters of `user`-type memories injected into the prompt.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

## Security Variables [​](https://docs.openwebui.com/reference/env-configuration/\#security-variables "Direct link to Security Variables")

#### `ENABLE_FORWARD_USER_INFO_HEADERS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_forward_user_info_headers "Direct link to enable_forward_user_info_headers")

- type: `bool`
- Default: `False`
- Description: When `true`, Open WebUI attaches the signed-in user's identity to its outbound requests, plus the chat and message session IDs where applicable. This enables per-user authorization, auditing, rate limiting and request tracing on external services.

The four **user-info** headers are forwarded to nearly every outbound backend. The two **session** headers are narrower:

| Header | Forwarded to |
| --- | --- |
| `X-OpenWebUI-User-Name`, `X-OpenWebUI-User-Id`, `X-OpenWebUI-User-Email`, `X-OpenWebUI-User-Role` | OpenAI, Ollama and Anthropic model connections, tool servers (OpenAPI and MCP), plus external embedding, reranking, web-search, audio and image services |
| `X-OpenWebUI-Chat-Id` | OpenAI and Ollama model connections, and tool servers (not Anthropic) |
| `X-OpenWebUI-Message-Id` | Tool servers only (OpenAPI and MCP) |

So an OpenAI, Ollama or Pipelines request receives **five** of the six headers (the four user headers plus `X-OpenWebUI-Chat-Id`); only `X-OpenWebUI-Message-Id` is tool-server-specific, since it is what powers [external tool event emitting](https://docs.openwebui.com/features/extensibility/plugin/development/events#-external-tool-events).

If you set `FORWARD_USER_INFO_HEADER_JWT_SECRET`, the four `X-OpenWebUI-User-*` headers are replaced by a single signed JWT (see [`FORWARD_USER_INFO_HEADER_JWT_SECRET`](https://docs.openwebui.com/reference/env-configuration/#forward_user_info_header_jwt_secret) below).

#### `FORWARD_USER_INFO_HEADER_USER_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#forward_user_info_header_user_name "Direct link to forward_user_info_header_user_name")

- Type: `str`
- Default: `X-OpenWebUI-User-Name`
- Description: Customizes the header name used to forward the user's display name. Change this if your infrastructure requires a specific header prefix.

#### `FORWARD_USER_INFO_HEADER_USER_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#forward_user_info_header_user_id "Direct link to forward_user_info_header_user_id")

- Type: `str`
- Default: `X-OpenWebUI-User-Id`
- Description: Customizes the header name used to forward the user's ID.

#### `FORWARD_USER_INFO_HEADER_USER_EMAIL` [​](https://docs.openwebui.com/reference/env-configuration/\#forward_user_info_header_user_email "Direct link to forward_user_info_header_user_email")

- Type: `str`
- Default: `X-OpenWebUI-User-Email`
- Description: Customizes the header name used to forward the user's email address.

#### `FORWARD_USER_INFO_HEADER_USER_ROLE` [​](https://docs.openwebui.com/reference/env-configuration/\#forward_user_info_header_user_role "Direct link to forward_user_info_header_user_role")

- Type: `str`
- Default: `X-OpenWebUI-User-Role`
- Description: Customizes the header name used to forward the user's role.

#### `FORWARD_SESSION_INFO_HEADER_CHAT_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#forward_session_info_header_chat_id "Direct link to forward_session_info_header_chat_id")

- Type: `str`
- Default: `X-OpenWebUI-Chat-Id`
- Description: Customizes the header name used to forward the current chat/session ID.

#### `FORWARD_SESSION_INFO_HEADER_MESSAGE_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#forward_session_info_header_message_id "Direct link to forward_session_info_header_message_id")

- Type: `str`
- Default: `X-OpenWebUI-Message-Id`
- Description: Customizes the header name used to forward the current message ID. This header is required for [external tool event emitting](https://docs.openwebui.com/features/extensibility/plugin/development/events#-external-tool-events).

Custom Header Prefix

Use these variables when integrating with services that require specific header naming conventions. For example, AWS Bedrock AgentCore requires headers prefixed with `X-Amzn-Bedrock-AgentCore-Runtime-Custom-`:

```
FORWARD_USER_INFO_HEADER_USER_NAME=X-Amzn-Bedrock-AgentCore-Runtime-Custom-User-Name
FORWARD_USER_INFO_HEADER_USER_ID=X-Amzn-Bedrock-AgentCore-Runtime-Custom-User-Id
FORWARD_USER_INFO_HEADER_USER_EMAIL=X-Amzn-Bedrock-AgentCore-Runtime-Custom-User-Email
FORWARD_USER_INFO_HEADER_USER_ROLE=X-Amzn-Bedrock-AgentCore-Runtime-Custom-User-Role
FORWARD_SESSION_INFO_HEADER_CHAT_ID=X-Amzn-Bedrock-AgentCore-Runtime-Custom-Chat-Id
FORWARD_SESSION_INFO_HEADER_MESSAGE_ID=X-Amzn-Bedrock-AgentCore-Runtime-Custom-Message-Id
```

#### `FORWARD_USER_INFO_HEADER_JWT_SECRET` [​](https://docs.openwebui.com/reference/env-configuration/\#forward_user_info_header_jwt_secret "Direct link to forward_user_info_header_jwt_secret")

- Type: `str`
- Default: unset
- Description: When set (and `ENABLE_FORWARD_USER_INFO_HEADERS` is `true`), Open WebUI forwards user identity to upstream backends as a **single HS256-signed JWT** in one header instead of the plain `X-OpenWebUI-User-*` headers. The upstream can verify the signature with this shared secret and therefore _trust_ the identity, rather than relying on plaintext headers that anything on the network path could spoof. Leave it unset to keep the legacy individual headers. The token carries the claims `sub` (user id), `email`, `name`, `role`, `iss` (`open-webui`), `iat` and `exp`.

#### `FORWARD_USER_INFO_HEADER_JWT` [​](https://docs.openwebui.com/reference/env-configuration/\#forward_user_info_header_jwt "Direct link to forward_user_info_header_jwt")

- Type: `str`
- Default: `X-OpenWebUI-User-Jwt`
- Description: Name of the header that carries the signed JWT when `FORWARD_USER_INFO_HEADER_JWT_SECRET` is set.

#### `FORWARD_USER_INFO_HEADER_JWT_EXPIRES_SECONDS` [​](https://docs.openwebui.com/reference/env-configuration/\#forward_user_info_header_jwt_expires_seconds "Direct link to forward_user_info_header_jwt_expires_seconds")

- Type: `int`
- Default: `300`
- Description: Lifetime in seconds of the forwarded-identity JWT (its `exp` claim). A fresh token is minted on every request, so this only needs to cover clock skew between Open WebUI and the upstream verifier.

#### `ENABLE_WEB_LOADER_SSL_VERIFICATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_web_loader_ssl_verification "Direct link to enable_web_loader_ssl_verification")

- Type: `bool`
- Default: `True`
- Description: Bypass SSL Verification for RAG on Websites.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WEBUI_SESSION_COOKIE_SAME_SITE` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_session_cookie_same_site "Direct link to webui_session_cookie_same_site")

- Type: `str`
- Options:
  - `lax`: Sets the `SameSite` attribute to lax, allowing session cookies to be sent with
    requests initiated by third-party websites.
  - `strict`: Sets the `SameSite` attribute to strict, blocking session cookies from being sent
    with requests initiated by third-party websites.
  - `none`: Sets the `SameSite` attribute to none, allowing session cookies to be sent with
    requests initiated by third-party websites, but only over HTTPS.
- Default: `lax`
- Description: Sets the `SameSite` attribute for session cookies.

warning

When `ENABLE_OAUTH_SIGNUP` is enabled, setting `WEBUI_SESSION_COOKIE_SAME_SITE` to `strict` can cause login failures. This is because Open WebUI uses a session cookie to validate the callback from the OAuth provider, which helps prevent CSRF attacks.

However, a `strict` session cookie is not sent with the callback request, leading to potential login issues. If you experience this problem, use the default `lax` value instead.

#### `WEBUI_SESSION_COOKIE_SECURE` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_session_cookie_secure "Direct link to webui_session_cookie_secure")

- Type: `bool`
- Default: `False`
- Description: Sets the `Secure` attribute for session cookies if set to `True`.

#### `WEBUI_AUTH_COOKIE_SAME_SITE` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_auth_cookie_same_site "Direct link to webui_auth_cookie_same_site")

- Type: `str`
- Options:
  - `lax`: Sets the `SameSite` attribute to lax, allowing auth cookies to be sent with
    requests initiated by third-party websites.
  - `strict`: Sets the `SameSite` attribute to strict, blocking auth cookies from being sent
    with requests initiated by third-party websites.
  - `none`: Sets the `SameSite` attribute to none, allowing auth cookies to be sent with
    requests initiated by third-party websites, but only over HTTPS.
- Default: `lax`
- Description: Sets the `SameSite` attribute for auth cookies.

info

If the value is not set, `WEBUI_SESSION_COOKIE_SAME_SITE` will be used as a fallback.

#### `WEBUI_AUTH_COOKIE_SECURE` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_auth_cookie_secure "Direct link to webui_auth_cookie_secure")

- Type: `bool`
- Default: `False`
- Description: Sets the `Secure` attribute for auth cookies if set to `True`.

info

If the value is not set, `WEBUI_SESSION_COOKIE_SECURE` will be used as a fallback.

#### `WEBUI_AUTH` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_auth "Direct link to webui_auth")

- Type: `bool`
- Default: `True`
- Description: This setting enables or disables authentication.

danger

If set to `False`, authentication will be disabled for your Open WebUI instance. However, it's
important to note that turning off authentication is only possible for fresh installations without
any existing users. If there are already users registered, you cannot disable authentication
directly. Ensure that no users are present in the database if you intend to turn off `WEBUI_AUTH`.

#### `ENABLE_PASSWORD_VALIDATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_password_validation "Direct link to enable_password_validation")

- Type: `bool`
- Default: `False`
- Description: Enables password complexity validation for user accounts. When enabled, passwords must meet the complexity requirements defined by `PASSWORD_VALIDATION_REGEX_PATTERN` during signup, password updates, and user creation operations. This helps enforce stronger password policies across the application.

info

Password validation is applied to:

- New user registration (signup)
- Password changes through user settings
- Admin-initiated user creation
- Password resets

Existing users with passwords that don't meet the new requirements are **not automatically forced to update their passwords**, but will need to meet the requirements when they next change their password.

#### `PASSWORD_VALIDATION_REGEX_PATTERN` [​](https://docs.openwebui.com/reference/env-configuration/\#password_validation_regex_pattern "Direct link to password_validation_regex_pattern")

- Type: `str`
- Default: `^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\w\s]).{8,}$`
- Description: Regular expression pattern used to validate password complexity when `ENABLE_PASSWORD_VALIDATION` is enabled. The default pattern requires passwords to be at least 8 characters long and contain at least one uppercase letter, one lowercase letter, one digit, and one special character.

warning

**Custom Pattern Considerations**

When defining a custom regex pattern, ensure it:

- Is a valid regular expression that Python's `re` module can compile
- Balances security requirements with user experience
- Is thoroughly tested before deployment to avoid locking users out

Invalid regex patterns will cause password validation to fail, potentially preventing user registration and password changes.

#### `PASSWORD_VALIDATION_HINT` [​](https://docs.openwebui.com/reference/env-configuration/\#password_validation_hint "Direct link to password_validation_hint")

- Type: `str`
- Default: `""` (empty string)
- Description: Custom hint message displayed to users when their password fails validation. This message appears in error dialogs during signup, password changes, and admin user creation when the password doesn't meet the requirements defined by `PASSWORD_VALIDATION_REGEX_PATTERN`. Use this to explain your specific password requirements in user-friendly terms.
- Example: `Password must be at least 12 characters with uppercase, lowercase, number, and special character.`

tip

When setting a custom `PASSWORD_VALIDATION_REGEX_PATTERN`, always set `PASSWORD_VALIDATION_HINT` to explain the requirements in plain language. Without a hint, users will only see a generic "Invalid password" error with no guidance on what's required.

#### `WEBUI_SECRET_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_secret_key "Direct link to webui_secret_key")

- Type: `str`
- Default: Automatically generated (see below)
- Description: The secret key used for signing JSON Web Tokens (JWTs) and **encrypting sensitive data** at rest (including OAuth tokens for MCP). Can be set via the `WEBUI_SECRET_KEY` environment variable or the legacy `WEBUI_JWT_SECRET_KEY` variable (deprecated).

How the secret key is generated

You do **not** need to manually set this variable for a secure installation. **All standard launch methods automatically generate and persist a cryptographically random key on first start:**

| Launch method | Auto-generates? | Persisted to |
| --- | --- | --- |
| **Docker** (`start.sh`) | ✅ Yes | `.webui_secret_key` file inside the container |
| **pip install** (`open-webui serve`) | ✅ Yes | `.webui_secret_key` file in the working directory |
| **Development** (`open-webui dev`, direct `uvicorn`) | ❌ No | N/A (set `WEBUI_SECRET_KEY` yourself) |

The standard Docker and `open-webui serve` methods check for the environment variable first, and if it is not set, they generate a secure random key, save it to a file and inject it into the environment, all before the application starts. That is why you do not need to set it yourself when you use them.

Recommended: Set an explicit, persistent value

While the auto-generated key is secure, it is tied to a file inside the container or working directory. **If the container is recreated (not just restarted) and the key file is not in a persisted volume, a new key is generated**, which causes:

1. **All existing user sessions become invalid** (users are logged out).
2. **All OAuth sessions become invalid.**
3. **MCP Tools break** (Error: `Error decrypting tokens`) because tokens encrypted with the previous key cannot be decrypted.

To avoid this, explicitly set `WEBUI_SECRET_KEY` to a secure, persistent value that survives container recreates:

```
# Generate a secure key
openssl rand -hex 32
```

Then pass it as an environment variable in your Docker Compose or deployment configuration.

warning

**Required for Multi-Worker and Multi-Node Deployments AND HIGHLY RECOMMENDED IN SINGLE-WORKER ENVIRONMENTS**

When deploying Open WebUI with `UVICORN_WORKERS > 1` or in a multi-node/worker cluster with a load balancer (e.g. helm/kubectl/kubernetes/k8s), you **must** set this variable to the **same value across all replicas**. Without it, the following issues will occur:

- Session management will fail across workers
- Application state will be inconsistent between instances
- Websocket connections will not function properly in distributed setups
- Users may experience intermittent authentication failures

#### `ENABLE_VALVE_ENCRYPTION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_valve_encryption "Direct link to enable_valve_encryption")

- Type: `bool`
- Default: `False`
- Description: When enabled, plugin (Tool and Function) **Valve** values are encrypted at rest using Fernet (AES-128) instead of being stored as plaintext JSON in the database. Useful when Valves hold secrets like API keys.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

Requires a valid Fernet `WEBUI_SECRET_KEY`

Encryption derives its key from [`WEBUI_SECRET_KEY`](https://docs.openwebui.com/reference/env-configuration/#webui_secret_key), which must be a valid 44-character url-safe base64 Fernet key when this is enabled. If you rotate `WEBUI_SECRET_KEY`, previously encrypted Valve values can no longer be decrypted and must be re-entered.

#### `ENABLE_VERSION_UPDATE_CHECK` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_version_update_check "Direct link to enable_version_update_check")

- Type: `bool`
- Default: `True`
- Description: When enabled, the application makes automatic update checks and notifies you about version updates.

info

If `OFFLINE_MODE` is enabled, this `ENABLE_VERSION_UPDATE_CHECK` flag is always set to `false` automatically.

#### `OFFLINE_MODE` [​](https://docs.openwebui.com/reference/env-configuration/\#offline_mode "Direct link to offline_mode")

- Type: `bool`
- Default: `False`
- Description: Disables Open WebUI's network connections for update checks and automatic model downloads.

info

**Disabled when enabled:**

- Automatic version update checks (see flag `ENABLE_VERSION_UPDATE_CHECK`)
- Downloads of embedding models from Hugging Face Hub
  - If you did not download an embedding model prior to activating `OFFLINE_MODE` any RAG, web search and document analysis functionality may not work properly. On a **fresh install** this aborts startup with `No embedding model is loaded`, see [Startup & Docker Failures](https://docs.openwebui.com/troubleshooting/startup#valueerror-no-embedding-model-is-loaded-with-offline-mode-on-a-fresh-install) for the fix.
- Update notifications in the UI (see flag `ENABLE_VERSION_UPDATE_CHECK`)

**Still functional:**

- External LLM API connections (OpenAI, etc.)
- OAuth authentication providers
- Web search and RAG with external APIs

Read more about `offline mode` in the [offline mode guide](https://docs.openwebui.com/tutorials/maintenance/offline-mode).

#### `HF_HUB_OFFLINE` [​](https://docs.openwebui.com/reference/env-configuration/\#hf_hub_offline "Direct link to hf_hub_offline")

- Type: `int`
- Default: `0`
- Description: Tells Hugging Face whether we want to launch in offline mode, so to not connect to hugging face and prevent all automatic model downloads

info

Downloads of models, sentence transformers and other configurable items will NOT WORK when this is set to `1`.
RAG will also not work on a default installation, if this is set to `True`.

#### `RESET_CONFIG_ON_START` [​](https://docs.openwebui.com/reference/env-configuration/\#reset_config_on_start "Direct link to reset_config_on_start")

- Type: `bool`
- Default: `False`
- Description: Resets the `config.json` file on startup.

#### `SAFE_MODE` [​](https://docs.openwebui.com/reference/env-configuration/\#safe_mode "Direct link to safe_mode")

- Type: `bool`
- Default: `False`
- Description: Enables safe mode, which disables potentially unsafe features, deactivating all functions.

#### `CORS_ALLOW_ORIGIN` [​](https://docs.openwebui.com/reference/env-configuration/\#cors_allow_origin "Direct link to cors_allow_origin")

- Type: `str`
- Default: `*`
- Description: Sets the allowed origins for Cross-Origin Resource Sharing (CORS). Smicolon ';' separated list of allowed origins.

warning

**This variable is required to be set**, otherwise you may experience Websocket issues and weird "{}" responses or "Unexpected token 'd', "data: {"id"... is not valid JSON".

info

If you experience Websocket issues, check the logs of Open WebUI.
If you see lines like this `engineio.base_server:_log_error_once:354 - https://yourdomain.com is not an accepted origin.` then you need to configure your CORS\_ALLOW\_ORIGIN more broadly.

Example:
CORS\_ALLOW\_ORIGIN: " [https://yourdomain.com;http://yourdomain.com;https://yourhostname;http://youripaddress;http://localhost:3000](https://yourdomain.com;http//yourdomain.com;https://yourhostname;http://youripaddress;http://localhost:3000)"

Add all valid IPs, Domains and Hostnames one might access your Open WebUI to the variable.
Once you did, no more websocket issues or warnings in the console should occur.

#### `CORS_ALLOW_CUSTOM_SCHEME` [​](https://docs.openwebui.com/reference/env-configuration/\#cors_allow_custom_scheme "Direct link to cors_allow_custom_scheme")

- Type `str`
- Default: `""` (empty string)
- Description: Sets a list of further allowed schemes for Cross-Origin Resource Sharing (CORS). Allows you to specify additional custom URL schemes, beyond the standard `http` and `https`, that are permitted as valid origins for Cross-Origin Resource Sharing (CORS).

info

This is particularly useful for scenarios such as:

- Integrating with desktop applications that use custom protocols (e.g., `app://`, `custom-app-scheme://`).
- Local development environments or testing setups that might employ non-standard schemes (e.g., `file://` if applicable, or `electron://`).

Provide a semicolon-separated list of scheme names without the `://`. For example: `app;file;electron;my-custom-scheme`.

When configured, these custom schemes will be validated alongside `http` and `https` for any origins specified in `CORS_ALLOW_ORIGIN`.

#### `RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_embedding_model_trust_remote_code "Direct link to rag_embedding_model_trust_remote_code")

- Type: `bool`
- Default: `False`
- Description: Determines whether to allow custom models defined on the Hub in their own modeling files.

#### `RAG_RERANKING_MODEL_TRUST_REMOTE_CODE` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_reranking_model_trust_remote_code "Direct link to rag_reranking_model_trust_remote_code")

- Type: `bool`
- Default: `False`
- Description: Determines whether to allow custom models defined on the Hub in their own.
modeling files for reranking.

#### `RAG_EMBEDDING_MODEL_AUTO_UPDATE` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_embedding_model_auto_update "Direct link to rag_embedding_model_auto_update")

- Type: `bool`
- Default: `True`
- Description: Toggles automatic update of the Sentence-Transformer model.

#### `RAG_RERANKING_MODEL_AUTO_UPDATE` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_reranking_model_auto_update "Direct link to rag_reranking_model_auto_update")

- Type: `bool`
- Default: `True`
- Description: Toggles automatic update of the reranking model.

## Vector Database [​](https://docs.openwebui.com/reference/env-configuration/\#vector-database "Direct link to Vector Database")

#### `VECTOR_DB` [​](https://docs.openwebui.com/reference/env-configuration/\#vector_db "Direct link to vector_db")

- Type: `str`
- Options:
- `chroma`, `elasticsearch`, `mariadb-vector`, `milvus`, `opensearch`, `pgvector`, `qdrant`, `pinecone`, `s3vector`, `oracle23ai`, `weaviate`, `valkey`
- Default: `chroma`
- Description: Specifies which vector database system to use. This setting determines which vector storage system will be used for managing embeddings.

ChromaDB (Default) Is Not Safe for Multi-Worker or Multi-Replica Deployments

The default ChromaDB configuration uses a **local `PersistentClient`** backed by **SQLite**. SQLite is not fork-safe. When uvicorn forks multiple worker processes (`UVICORN_WORKERS > 1`), each worker inherits a copy of the same SQLite connection. Concurrent writes from these forked processes cause immediate crashes (`Child process died`) or database corruption.

**This also applies to multi-replica deployments** (Kubernetes, Docker Swarm) where multiple containers point at the same ChromaDB data directory.

If you need multiple workers or replicas, you **must** either:

1. **Switch to a client-server vector database** such as [PGVector](https://docs.openwebui.com/reference/env-configuration#pgvector_db_url), [MariaDB Vector](https://docs.openwebui.com/reference/env-configuration#mariadb_vector_db_url), Milvus, or Qdrant (recommended).
2. **Run ChromaDB as a separate HTTP server** and configure [`CHROMA_HTTP_HOST`](https://docs.openwebui.com/reference/env-configuration#chroma_http_host) / [`CHROMA_HTTP_PORT`](https://docs.openwebui.com/reference/env-configuration#chroma_http_port) so that Open WebUI uses an `HttpClient` instead of the local `PersistentClient`.

See the [Scaling & HA guide](https://docs.openwebui.com/troubleshooting/multi-replica) for full details.

note

PostgreSQL Dependencies
To use `pgvector`, ensure you have PostgreSQL dependencies installed:

```
pip install open-webui[all]
```

info

Only PGVector and ChromaDB will be consistently maintained by the Open WebUI team.
The other vector stores are community-added vector databases.

### ChromaDB [​](https://docs.openwebui.com/reference/env-configuration/\#chromadb "Direct link to ChromaDB")

Local vs. HTTP Mode

By default (when `CHROMA_HTTP_HOST` is **not** set), ChromaDB runs as a local `PersistentClient` using SQLite for storage. This mode is **only safe for single-worker, single-instance deployments** (`UVICORN_WORKERS=1`, one replica).

For multi-worker or multi-replica setups, you **must** configure `CHROMA_HTTP_HOST` and `CHROMA_HTTP_PORT` to point to a standalone ChromaDB server, or switch to a different vector database entirely. See the [VECTOR\_DB](https://docs.openwebui.com/reference/env-configuration/#vector_db) warning above.

#### `CHROMA_TENANT` [​](https://docs.openwebui.com/reference/env-configuration/\#chroma_tenant "Direct link to chroma_tenant")

- Type: `str`
- Default: The value of `chromadb.DEFAULT_TENANT` (a constant in the `chromadb` module)
- Description: Sets the tenant for ChromaDB to use for RAG embeddings.

#### `CHROMA_DATABASE` [​](https://docs.openwebui.com/reference/env-configuration/\#chroma_database "Direct link to chroma_database")

- Type: `str`
- Default: The value of `chromadb.DEFAULT_DATABASE` (a constant in the `chromadb` module)
- Description: Sets the database in the ChromaDB tenant to use for RAG embeddings.

#### `CHROMA_HTTP_HOST` [​](https://docs.openwebui.com/reference/env-configuration/\#chroma_http_host "Direct link to chroma_http_host")

- Type: `str`
- Description: Specifies the hostname of a remote ChromaDB Server. Uses a local ChromaDB instance if not set. **Setting this variable is required for multi-worker or multi-replica deployments**: it switches ChromaDB from the local SQLite-backed `PersistentClient` to a fork-safe `HttpClient`.

#### `CHROMA_HTTP_PORT` [​](https://docs.openwebui.com/reference/env-configuration/\#chroma_http_port "Direct link to chroma_http_port")

- Type: `int`
- Default: `8000`
- Description: Specifies the port of a remote ChromaDB Server.

#### `CHROMA_HTTP_HEADERS` [​](https://docs.openwebui.com/reference/env-configuration/\#chroma_http_headers "Direct link to chroma_http_headers")

- Type: `str`
- Description: A comma-separated list of HTTP headers to include with every ChromaDB request.
- Example: `Authorization=Bearer heuhagfuahefj,User-Agent=OpenWebUI`.

#### `CHROMA_HTTP_SSL` [​](https://docs.openwebui.com/reference/env-configuration/\#chroma_http_ssl "Direct link to chroma_http_ssl")

- Type: `bool`
- Default: `False`
- Description: Controls whether or not SSL is used for ChromaDB Server connections.

#### `CHROMA_CLIENT_AUTH_PROVIDER` [​](https://docs.openwebui.com/reference/env-configuration/\#chroma_client_auth_provider "Direct link to chroma_client_auth_provider")

- Type: `str`
- Description: Specifies an authentication provider for remote ChromaDB Server.
- Example: `chromadb.auth.basic_authn.BasicAuthClientProvider`

#### `CHROMA_CLIENT_AUTH_CREDENTIALS` [​](https://docs.openwebui.com/reference/env-configuration/\#chroma_client_auth_credentials "Direct link to chroma_client_auth_credentials")

- Type: `str`
- Description: Specifies auth credentials for remote ChromaDB Server.
- Example: `username:password`

### Elasticsearch [​](https://docs.openwebui.com/reference/env-configuration/\#elasticsearch "Direct link to Elasticsearch")

#### `ELASTICSEARCH_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#elasticsearch_api_key "Direct link to elasticsearch_api_key")

- Type: `str`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the Elasticsearch API key.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ELASTICSEARCH_CA_CERTS` [​](https://docs.openwebui.com/reference/env-configuration/\#elasticsearch_ca_certs "Direct link to elasticsearch_ca_certs")

- Type: `str`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the path to the CA certificates for Elasticsearch.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ELASTICSEARCH_CLOUD_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#elasticsearch_cloud_id "Direct link to elasticsearch_cloud_id")

- Type: `str`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the Elasticsearch cloud ID.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ELASTICSEARCH_INDEX_PREFIX` [​](https://docs.openwebui.com/reference/env-configuration/\#elasticsearch_index_prefix "Direct link to elasticsearch_index_prefix")

- Type: `str`
- Default: `open_webui_collections`
- Description: Specifies the prefix for the Elasticsearch index.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ELASTICSEARCH_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#elasticsearch_password "Direct link to elasticsearch_password")

- Type: `str`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the password for Elasticsearch.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ELASTICSEARCH_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#elasticsearch_url "Direct link to elasticsearch_url")

- Type: `str`
- Default: `https://localhost:9200`
- Description: Specifies the URL for the Elasticsearch instance.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ELASTICSEARCH_USERNAME` [​](https://docs.openwebui.com/reference/env-configuration/\#elasticsearch_username "Direct link to elasticsearch_username")

- Type: `str`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the username for Elasticsearch.
- Persistence: This environment variable is a `ConfigVar` variable.

### Milvus [​](https://docs.openwebui.com/reference/env-configuration/\#milvus "Direct link to Milvus")

warning

Milvus is a non-core integration, not maintained by the core Open WebUI team. Fixes come from outside the core Open WebUI maintenance path.
If you want to use Milvus, be careful when upgrading Open WebUI (crate backups and snapshots for rollbacks) in case internal changes in Open WebUI lead to breakage.

#### `MILVUS_URI` **(Required)** [​](https://docs.openwebui.com/reference/env-configuration/\#milvus_uri-required "Direct link to milvus_uri-required")

- Type: `str`
- Default: `${DATA_DIR}/vector_db/milvus.db`
- Example (Remote): `http://your-server-ip:19530`
- Description: Specifies the URI for connecting to the Milvus vector database. This can point to a local or remote Milvus server based on the deployment configuration.

#### `MILVUS_DB` [​](https://docs.openwebui.com/reference/env-configuration/\#milvus_db "Direct link to milvus_db")

- Type: `str`
- Default: `default`
- Example: `default`
- Description: Specifies the database to connect to within a Milvus instance.

#### `MILVUS_TOKEN` **(Required for remote connections with authentication)** [​](https://docs.openwebui.com/reference/env-configuration/\#milvus_token-required-for-remote-connections-with-authentication "Direct link to milvus_token-required-for-remote-connections-with-authentication")

- Type: `str`
- Default: `None`
- Example: `root:password` (format: `username:password`)
- Description: Specifies an optional connection token for Milvus. Required when connecting to a remote Milvus server with authentication enabled. Format is `username:password`.

#### `MILVUS_INDEX_TYPE` [​](https://docs.openwebui.com/reference/env-configuration/\#milvus_index_type "Direct link to milvus_index_type")

- Type: `str`
- Default: `HNSW`
- Options: `AUTOINDEX`, `FLAT`, `IVF_FLAT`, `HNSW`, `DISKANN`
- Description: Specifies the index type to use when creating a new collection in Milvus. `AUTOINDEX` is generally recommended for Milvus standalone. `HNSW` may offer better performance but requires a clustered Milvus setup and is not meant for standalone setups.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MILVUS_METRIC_TYPE` [​](https://docs.openwebui.com/reference/env-configuration/\#milvus_metric_type "Direct link to milvus_metric_type")

- Type: `str`
- Default: `COSINE`
- Options: `COSINE`, `IP`, `L2`
- Description: Specifies the metric type for vector similarity search in Milvus.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MILVUS_HNSW_M` [​](https://docs.openwebui.com/reference/env-configuration/\#milvus_hnsw_m "Direct link to milvus_hnsw_m")

- Type: `int`
- Default: `16`
- Description: Specifies the `M` parameter for the HNSW index type in Milvus. This influences the number of bi-directional links created for each new element during construction. Only applicable if `MILVUS_INDEX_TYPE` is `HNSW`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MILVUS_HNSW_EFCONSTRUCTION` [​](https://docs.openwebui.com/reference/env-configuration/\#milvus_hnsw_efconstruction "Direct link to milvus_hnsw_efconstruction")

- Type: `int`
- Default: `100`
- Description: Specifies the `efConstruction` parameter for the HNSW index type in Milvus. This influences the size of the dynamic list for the nearest neighbors during index construction. Only applicable if `MILVUS_INDEX_TYPE` is `HNSW`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MILVUS_IVF_FLAT_NLIST` [​](https://docs.openwebui.com/reference/env-configuration/\#milvus_ivf_flat_nlist "Direct link to milvus_ivf_flat_nlist")

- Type: `int`
- Default: `128`
- Description: Specifies the `nlist` parameter for the IVF\_FLAT index type in Milvus. This is the number of cluster units. Only applicable if `MILVUS_INDEX_TYPE` is `IVF_FLAT`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MILVUS_DISKANN_MAX_DEGREE` [​](https://docs.openwebui.com/reference/env-configuration/\#milvus_diskann_max_degree "Direct link to milvus_diskann_max_degree")

- Type: `int`
- Default: `56`
- Description: Sets the max degree for Milvus if Milvus is in DISKANN indexing mode. Generally recommended to leave as is.

#### `MILVUS_DISKANN_SEARCH_LIST_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#milvus_diskann_search_list_size "Direct link to milvus_diskann_search_list_size")

- Type: `int`
- Default: `100`
- Description: Sets the Milvus DISKANN search list size. Generally recommended to leave as is.

#### `ENABLE_MILVUS_MULTITENANCY_MODE` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_milvus_multitenancy_mode "Direct link to enable_milvus_multitenancy_mode")

- Type: `bool`
- Default: `false`
- Description: Enables multitenancy pattern for Milvus collections management, which significantly reduces RAM usage and computational overhead by consolidating similar vector data structures. Controls whether Milvus uses multitenancy collection architecture. When enabled, all vector data is consolidated into 5 shared collections (memories, knowledge, files, web\_search, hash\_based) instead of creating individual collections per resource. Data isolation is achieved via a resource\_id field rather than collection-level separation.

info

**Benefits of multitenancy mode:**

- Significantly reduced RAM consumption (5 collections vs potentially hundreds)
- Lower computational overhead from collection management
- Faster cold-start times
- Reduced index maintenance burden

**Technical implementation:**

- All memories go into `{prefix}_memories`
- All knowledge bases go into `{prefix}_knowledge`
- All uploaded files go into `{prefix}_files`
- Web search results go into `{prefix}_web_search`
- Hash-based collections go into `{prefix}_hash_based`
- Each entry includes a resource\_id field matching the original collection name
- Queries automatically filter by resource\_id to maintain data isolation

| Collection Variable | Default Name (Suffix) | Trigger / Routing Logic in the Code | Purpose |
| --- | --- | --- | --- |
| `HASH_BASED_COLLECTION` | `_hash_based` | Collection name is a **63-char hex string** (SHA256 hash). | Caching direct URL fetches (Websites) with the `#` feature. |
| `MEMORY_COLLECTION` | `_memories` | Collection name starts with **`user-memory-`**. | Storing user-specific long-term memories of the experimental memory system. |
| `FILE_COLLECTION` | `_files` | Collection name starts with **`file-`**. | Storing uploaded documents (PDFs, DOCX, etc.). |
| `WEB_SEARCH_COLLECTION` | `_web_search` | Collection name starts with **`web-search-`**. | Storing transient results from search engine queries. |
| `KNOWLEDGE_COLLECTION` | `_knowledge` | **Everything else** (Default fallback). | Storing explicitly created Knowledge Bases. |

info

**Migration from Legacy Mode to Multitenancy**

**What happens when you enable multitenancy when you already have a normal milvus database with data in it:**

- Existing collections (pattern: `open_webui_{collection_name}`) remain in Milvus but **become inaccessible** to Open WebUI
- New data is written to the 5 shared multitenancy collections
- Application treats knowledge bases as empty until reindexed
- Files and memories are NOT automatically migrated to the new collection schema and will appear missing

**Clean migration path from normal Milvus to multitenancy milvus:**

- Before enabling multitenancy, export any critical knowledge content from the UI if possible
- Set `ENABLE_MILVUS_MULTITENANCY_MODE=true` and restart Open WebUI
- Navigate to `Admin Settings > Documents > Click Reindex Knowledge Base`

**This rebuilds ONLY knowledge base vectors into the new multitenancy collections** **Files, user memories, and web search history are NOT migrated by this operation**

**Verify knowledge bases are accessible and functional**

- Re-upload files if file-based retrieval is critical (file metadata remains but vectors are not migrated)
- User chat memories will need to be regenerated through new conversations

**Cleaning up legacy collections:**
After successful migration (from milvus to multitenancy milvus), legacy collections still consume resources. Remove them manually:

- Connect to Milvus using the native client (pymilvus or Attu UI)
- Delete all old collections

**Current UI limitations:**

- No one-click "migrate and cleanup" button exists
- Vector DB reset from UI (Admin Settings > Documents > Reset Vector Storage/Knowledge) only affects the active mode's collections
- Legacy collections require manual cleanup via Milvus client tools

warning

**Critical Considerations**

**Before enabling multitenancy on an existing installation:**

- Data loss risk: File vectors and user memory vectors are NOT migrated automatically. Only knowledge base content can be reindexed (migrated).
- Collection naming dependency: Multitenancy relies on Open WebUI's internal collection naming conventions (user-memory-, file-, web-search-, hash patterns). **If Open WebUI changes these conventions in future updates, multitenancy routing may break, causing data corruption or incorrect data retrieval across isolated resources.**
- No automatic rollback: Disabling multitenancy after data is written will not restore access to the shared collections. Data would need manual extraction and re-import.

For fresh installations, no migration concerns exist

**For existing installations with valuable data:**

- Do not migrate to multitenancy mode if you do not want to handle migration and risk data loss
- Understand that files and memories require re-upload/regeneration
- Test migration on a backup/staging environment first
- Consider if RAM savings justify the migration effort for your use case

**To perform a full reset and switch to multitenancy:**

- Backup any critical knowledge base content externally
- Navigate to `Admin Settings > Documents`
- Click `Reset Vector Storage/Knowledge` (this deletes all active mode collections and stored knowledge metadata)
- Set `ENABLE_MILVUS_MULTITENANCY_MODE=true`
- Restart Open WebUI
- Re-upload/re-create knowledge bases from scratch

warning

The mapping of multitenancy relies on current Open WebUI naming conventions for collection names.

If Open WebUI changes how it generates collection names (e.g., "user-memory-" prefix, "file-" prefix, web search patterns, or hash formats), this mapping will break and route data to incorrect collections.
POTENTIALLY CAUSING HUGE DATA CORRUPTION, DATA CONSISTENCY ISSUES AND INCORRECT DATA MAPPING INSIDE THE DATABASE.

If you use Multitenancy Mode, you should always check for any changes to the collection names and data mapping before upgrading, and upgrade carefully (snapshots and backups for rollbacks)!

#### `MILVUS_COLLECTION_PREFIX` [​](https://docs.openwebui.com/reference/env-configuration/\#milvus_collection_prefix "Direct link to milvus_collection_prefix")

- Type: `str`
- Default: `open_webui`
- Description: Sets the prefix for Milvus collection names. In multitenancy mode, collections become `{prefix}_memories`, `{prefix}_knowledge`, etc. In legacy mode, collections are `{prefix}_{collection_name}`. Changing this value creates an entirely separate namespace, and existing collections with the old prefix become invisible to Open WebUI but remain in Milvus consuming resources. Use this for true multi-instance isolation on a shared Milvus server, not for migration between modes. Milvus only accepts underscores, hyphens/dashes are not possible and will cause errors.

### MariaDB Vector [​](https://docs.openwebui.com/reference/env-configuration/\#mariadb-vector "Direct link to MariaDB Vector")

warning

MariaDB Vector is a non-core integration, not maintained by the core Open WebUI team. Fixes come from outside the core Open WebUI maintenance path.
If you want to use MariaDB Vector, be careful when upgrading Open WebUI (create backups and snapshots for rollbacks) in case internal changes in Open WebUI lead to breakage.

note

MariaDB Dependencies

The `mariadb` Python connector is **not included by default**. It was removed from the bundled dependencies. To use `mariadb-vector`, you must install it explicitly:

```
pip install open-webui[mariadb]
```

The official Docker image includes the system-level C library (`libmariadb-dev`) needed to compile the connector, so `pip install open-webui[mariadb]` will work inside the container without additional system packages. For non-Docker deployments, you must install the MariaDB C connector library (`libmariadb-dev` on Debian/Ubuntu) before installing the Python driver.

info

MariaDB Vector requires the **official MariaDB connector** (`mariadb+mariadbconnector://...`) as the connection scheme. This is mandatory because the official driver provides the correct `qmark` paramstyle and proper binary binding for `VECTOR(n)` float32 payloads. Other MySQL-compatible drivers will not work.

Your MariaDB server must support `VECTOR` and `VECTOR INDEX` features (MariaDB 11.7+).

#### `MARIADB_VECTOR_DB_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#mariadb_vector_db_url "Direct link to mariadb_vector_db_url")

- Type: `str`
- Default: Empty string (`""`)
- Description: Sets the database URL for MariaDB Vector storage. Must use the `mariadb+mariadbconnector://` scheme (official MariaDB driver).
- Example: `mariadb+mariadbconnector://user:password@localhost:3306/openwebui`

#### `MARIADB_VECTOR_INITIALIZE_MAX_VECTOR_LENGTH` [​](https://docs.openwebui.com/reference/env-configuration/\#mariadb_vector_initialize_max_vector_length "Direct link to mariadb_vector_initialize_max_vector_length")

- Type: `int`
- Default: `1536`
- Description: Specifies the maximum vector length (number of dimensions) for the `VECTOR(n)` column. Must match the dimensionality of your embedding model. Once the table is created, changing this value requires data migration: the backend will refuse to start if the configured dimension differs from the stored column dimension.

#### `MARIADB_VECTOR_DISTANCE_STRATEGY` [​](https://docs.openwebui.com/reference/env-configuration/\#mariadb_vector_distance_strategy "Direct link to mariadb_vector_distance_strategy")

- Type: `str`
- Options:
  - `cosine`: Uses `vec_distance_cosine()` for similarity measurement.
  - `euclidean`: Uses `vec_distance_euclidean()` for similarity measurement.
- Default: `cosine`
- Description: Controls which distance function is used for the `VECTOR INDEX` and similarity search queries.

#### `MARIADB_VECTOR_INDEX_M` [​](https://docs.openwebui.com/reference/env-configuration/\#mariadb_vector_index_m "Direct link to mariadb_vector_index_m")

- Type: `int`
- Default: `8`
- Description: HNSW index parameter that controls the maximum number of bi-directional connections per layer during index construction (`M=<int>` in the MariaDB `VECTOR INDEX` definition). Higher values improve recall but increase index size and build time.

#### `MARIADB_VECTOR_POOL_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#mariadb_vector_pool_size "Direct link to mariadb_vector_pool_size")

- Type: `int`
- Default: `None`
- Description: Sets the number of connections to maintain in the MariaDB Vector database connection pool. If not set, uses SQLAlchemy defaults. Setting this to `0` disables connection pooling entirely (uses `NullPool`).

#### `MARIADB_VECTOR_POOL_MAX_OVERFLOW` [​](https://docs.openwebui.com/reference/env-configuration/\#mariadb_vector_pool_max_overflow "Direct link to mariadb_vector_pool_max_overflow")

- Type: `int`
- Default: `0`
- Description: Specifies the maximum number of connections that can be created beyond `MARIADB_VECTOR_POOL_SIZE` when the pool is exhausted.

#### `MARIADB_VECTOR_POOL_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#mariadb_vector_pool_timeout "Direct link to mariadb_vector_pool_timeout")

- Type: `int`
- Default: `30`
- Description: Sets the timeout in seconds for acquiring a connection from the MariaDB Vector pool.

#### `MARIADB_VECTOR_POOL_RECYCLE` [​](https://docs.openwebui.com/reference/env-configuration/\#mariadb_vector_pool_recycle "Direct link to mariadb_vector_pool_recycle")

- Type: `int`
- Default: `3600`
- Description: Specifies the time in seconds after which connections are recycled in the MariaDB Vector pool to prevent stale connections.

### OpenSearch [​](https://docs.openwebui.com/reference/env-configuration/\#opensearch "Direct link to OpenSearch")

#### `OPENSEARCH_CERT_VERIFY` [​](https://docs.openwebui.com/reference/env-configuration/\#opensearch_cert_verify "Direct link to opensearch_cert_verify")

- Type: `bool`
- Default: `False`
- Description: Enables or disables OpenSearch certificate verification.

#### `OPENSEARCH_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#opensearch_password "Direct link to opensearch_password")

- Type: `str`
- Default: `None`
- Description: Sets the password for OpenSearch.

#### `OPENSEARCH_SSL` [​](https://docs.openwebui.com/reference/env-configuration/\#opensearch_ssl "Direct link to opensearch_ssl")

- Type: `bool`
- Default: `True`
- Description: Enables or disables SSL for OpenSearch.

#### `OPENSEARCH_URI` [​](https://docs.openwebui.com/reference/env-configuration/\#opensearch_uri "Direct link to opensearch_uri")

- Type: `str`
- Default: `https://localhost:9200`
- Description: Sets the URI for OpenSearch.

#### `OPENSEARCH_USERNAME` [​](https://docs.openwebui.com/reference/env-configuration/\#opensearch_username "Direct link to opensearch_username")

- Type: `str`
- Default: `None`
- Description: Sets the username for OpenSearch.

### PGVector [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector "Direct link to PGVector")

note

PostgreSQL Dependencies
To use `pgvector`, ensure you have PostgreSQL dependencies installed:

```
pip install open-webui[all]
```

#### `PGVECTOR_DB_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_db_url "Direct link to pgvector_db_url")

- Type: `str`
- Default: The value of the `DATABASE_URL` environment variable
- Description: Sets the database URL for model storage.

#### `PGVECTOR_INITIALIZE_MAX_VECTOR_LENGTH` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_initialize_max_vector_length "Direct link to pgvector_initialize_max_vector_length")

- Type: `str`
- Default: `1536`
- Description: Specifies the maximum vector length for PGVector initialization.

#### `PGVECTOR_CREATE_EXTENSION` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_create_extension "Direct link to pgvector_create_extension")

- Type: `str`
- Default `true`
- Description: Creates the vector extension in the database

info

If set to `false`, open-webui will assume the postgreSQL database where embeddings will be stored is pre-configured with the `vector` extension. This also allows open-webui to run as a non superuser database user.

#### `PGVECTOR_INDEX_METHOD` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_index_method "Direct link to pgvector_index_method")

- Type: `str`
- Options:
  - `ivfflat`: Uses inverted file with flat compression, better for datasets with many dimensions.
  - `hnsw`: Uses Hierarchical Navigable Small World graphs, generally provides better query performance.
- Default: Not specified (pgvector will use its default)
- Description: Specifies the index method for pgvector. The choice affects query performance and index build time.
- Persistence: This environment variable is a `ConfigVar` variable.

info

When choosing an index method, consider your dataset size and query patterns. HNSW generally provides better query performance but uses more memory, while IVFFlat can be more memory-efficient for larger datasets.

#### `PGVECTOR_HNSW_M` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_hnsw_m "Direct link to pgvector_hnsw_m")

- Type: `int`
- Default: `16`
- Description: HNSW index parameter that controls the maximum number of bi-directional connections per layer during index construction. Higher values improve recall but increase index size and build time. Only applicable when `PGVECTOR_INDEX_METHOD` is set to `hnsw`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `PGVECTOR_HNSW_EF_CONSTRUCTION` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_hnsw_ef_construction "Direct link to pgvector_hnsw_ef_construction")

- Type: `int`
- Default: `64`
- Description: HNSW index parameter that controls the size of the dynamic candidate list during index construction. Higher values improve index quality but increase build time. Only applicable when `PGVECTOR_INDEX_METHOD` is set to `hnsw`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `PGVECTOR_IVFFLAT_LISTS` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_ivfflat_lists "Direct link to pgvector_ivfflat_lists")

- Type: `int`
- Default: `100`
- Description: IVFFlat index parameter that specifies the number of inverted lists (clusters) to create. A good starting point is `rows / 1000` for up to 1M rows and `sqrt(rows)` for over 1M rows. Only applicable when `PGVECTOR_INDEX_METHOD` is set to `ivfflat`.
- Persistence: This environment variable is a `ConfigVar` variable.

info

For IVFFlat indexes, choosing the right number of lists is crucial for query performance. Too few lists will result in slow queries, while too many will increase index size without significant performance gains.

#### `PGVECTOR_USE_HALFVEC` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_use_halfvec "Direct link to pgvector_use_halfvec")

- Type: `bool`
- Default: `False`
- Description: Enables the use of `halfvec` data type instead of `vector` for storing embeddings. Required when `PGVECTOR_INITIALIZE_MAX_VECTOR_LENGTH` exceeds 2000 dimensions, as the `vector` type has a 2000-dimension limit.

#### `PGVECTOR_PGCRYPTO` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_pgcrypto "Direct link to pgvector_pgcrypto")

- Type: `bool`
- Default: `False`
- Description: Enables pgcrypto extension for encrypting sensitive data within PGVector. When enabled, `PGVECTOR_PGCRYPTO_KEY` must be set.

#### `PGVECTOR_PGCRYPTO_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_pgcrypto_key "Direct link to pgvector_pgcrypto_key")

- Type: `str`
- Default: `None`
- Description: Specifies the encryption key for pgcrypto when `PGVECTOR_PGCRYPTO` is enabled. Must be a secure, randomly generated key.

#### `PGVECTOR_POOL_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_pool_size "Direct link to pgvector_pool_size")

- Type: `int`
- Default: `None`
- Description: Sets the number of connections to maintain in the PGVector database connection pool. If not set, uses SQLAlchemy defaults.

#### `PGVECTOR_POOL_MAX_OVERFLOW` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_pool_max_overflow "Direct link to pgvector_pool_max_overflow")

- Type: `int`
- Default: `0`
- Description: Specifies the maximum number of connections that can be created beyond `PGVECTOR_POOL_SIZE` when the pool is exhausted.

#### `PGVECTOR_POOL_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_pool_timeout "Direct link to pgvector_pool_timeout")

- Type: `int`
- Default: `30`
- Description: Sets the timeout in seconds for acquiring a connection from the PGVector pool.

#### `PGVECTOR_POOL_RECYCLE` [​](https://docs.openwebui.com/reference/env-configuration/\#pgvector_pool_recycle "Direct link to pgvector_pool_recycle")

- Type: `int`
- Default: `3600`
- Description: Specifies the time in seconds after which connections are recycled in the PGVector pool to prevent stale connections.

### Qdrant [​](https://docs.openwebui.com/reference/env-configuration/\#qdrant "Direct link to Qdrant")

warning

Qdrant is a non-core integration, not maintained by the core Open WebUI team. Fixes come from outside the core Open WebUI maintenance path.
If you want to use Qdrant, be careful when upgrading Open WebUI (crate backups and snapshots for rollbacks) in case internal changes in Open WebUI lead to breakage.

#### `QDRANT_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#qdrant_api_key "Direct link to qdrant_api_key")

- Type: `str`
- Description: Sets the API key for Qdrant.

#### `QDRANT_URI` [​](https://docs.openwebui.com/reference/env-configuration/\#qdrant_uri "Direct link to qdrant_uri")

- Type: `str`
- Description: Sets the URI for Qdrant.

#### `QDRANT_ON_DISK` [​](https://docs.openwebui.com/reference/env-configuration/\#qdrant_on_disk "Direct link to qdrant_on_disk")

- Type: `bool`
- Default: `False`
- Description: Enable the usage of memmap(also known as on-disk) storage

#### `QDRANT_PREFER_GRPC` [​](https://docs.openwebui.com/reference/env-configuration/\#qdrant_prefer_grpc "Direct link to qdrant_prefer_grpc")

- Type: `bool`
- Default: `False`
- Description: Use gPRC interface whenever possible.

info

If set to `True`, and `QDRANT_URI` points to a self-hosted server with TLS enabled and certificate signed by a private CA, set the environment variable `GRPC_DEFAULT_SSL_ROOTS_FILE_PATH` to the path of your PEM-encoded CA certificates file. See the [gRPC Core Docs](https://grpc.github.io/grpc/core/md_doc_environment_variables.html) for more information.

#### `QDRANT_GRPC_PORT` [​](https://docs.openwebui.com/reference/env-configuration/\#qdrant_grpc_port "Direct link to qdrant_grpc_port")

- Type: `int`
- Default: `6334`
- Description: Sets the gRPC port number for Qdrant.

#### `QDRANT_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#qdrant_timeout "Direct link to qdrant_timeout")

- Type: `int`
- Default: `5`
- Description: Sets the timeout in seconds for all requests made to the Qdrant server, helping to prevent long-running queries from stalling the application.

#### `QDRANT_HNSW_M` [​](https://docs.openwebui.com/reference/env-configuration/\#qdrant_hnsw_m "Direct link to qdrant_hnsw_m")

- Type: `int`
- Default: `16`
- Description: Controls the HNSW (Hierarchical Navigable Small World) index construction. In standard mode, this sets the `m` parameter. In multi-tenancy mode, this value is used for the `payload_m` parameter to build indexes on the payload, as the global `m` is disabled for performance, following Qdrant best practices.

#### `ENABLE_QDRANT_MULTITENANCY_MODE` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_qdrant_multitenancy_mode "Direct link to enable_qdrant_multitenancy_mode")

- Type: `bool`
- Default: `True`
- Description: Enables multitenancy pattern for Qdrant collections management, which significantly reduces RAM usage and computational overhead by consolidating similar vector data structures. Recommend turn on

info

This will disconect all Qdrant collections created in the previous pattern, which is non-multitenancy. Go to `Admin Settings` \> `Documents` \> `Reindex Knowledge Base` to migrate existing knowledges.

The Qdrant collections created in the previous pattern will still consume resources.

Currently, there is no button in the UI to only reset the vector DB. If you want to migrate knowledge to multitenancy:

- Remove all collections with the `open_webui-knowledge` prefix (or `open_webui` prefix to remove all collections related to Open WebUI) using the native Qdrant client
- Go to `Admin Settings` \> `Documents` \> `Reindex Knowledge Base` to migrate existing knowledge base

`Reindex Knowledge Base` will ONLY migrate the knowledge base

danger

If you decide to use the multitenancy pattern as your default and you don't need to migrate old knowledge, go to `Admin Settings` \> `Documents` to reset vector and knowledge, which will delete all collections with the `open_webui` prefix and all stored knowledge.

warning

The mapping of multitenancy relies on current Open WebUI naming conventions for collection names.

If Open WebUI changes how it generates collection names (e.g., "user-memory-" prefix, "file-" prefix, web search patterns, or hash formats), this mapping will break and route data to incorrect collections.
POTENTIALLY CAUSING HUGE DATA CORRUPTION, DATA CONSISTENCY ISSUES AND INCORRECT DATA MAPPING INSIDE THE DATABASE.

If you use Multitenancy Mode, you should always check for any changes to the collection names and data mapping before upgrading, and upgrade carefully (snapshots and backups for rollbacks)!

#### `QDRANT_COLLECTION_PREFIX` [​](https://docs.openwebui.com/reference/env-configuration/\#qdrant_collection_prefix "Direct link to qdrant_collection_prefix")

- Type: `str`
- Default: `open-webui`
- Description: Sets the prefix for Qdrant collection names. Useful for namespacing or isolating collections, especially in multitenancy mode. Changing this value will cause the application to use a different set of collections in Qdrant. Existing collections with a different prefix will not be affected.

### Pinecone [​](https://docs.openwebui.com/reference/env-configuration/\#pinecone "Direct link to Pinecone")

When using Pinecone as the vector store, the following environment variables are used to control its behavior. Make sure to set these variables in your `.env` file or deployment environment.

#### `PINECONE_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#pinecone_api_key "Direct link to pinecone_api_key")

- Type: `str`
- Default: `None`
- Description: Sets the API key used to authenticate with the Pinecone service.

#### `PINECONE_ENVIRONMENT` [​](https://docs.openwebui.com/reference/env-configuration/\#pinecone_environment "Direct link to pinecone_environment")

- Type: `str`
- Default: `None`
- Description: Specifies the Pinecone environment to connect to (e.g., `us-west1-gcp`, `gcp-starter`, etc.).

#### `PINECONE_INDEX_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#pinecone_index_name "Direct link to pinecone_index_name")

- Type: `str`
- Default: `open-webui-index`
- Description: Defines the name of the Pinecone index that will be used to store and query vector embeddings.

#### `PINECONE_DIMENSION` [​](https://docs.openwebui.com/reference/env-configuration/\#pinecone_dimension "Direct link to pinecone_dimension")

- Type: `int`
- Default: `1536`
- Description: The dimensionality of the vector embeddings. Must match the dimension expected by the index (commonly 768, 1024, 1536, or 3072 based on model used).

#### `PINECONE_METRIC` [​](https://docs.openwebui.com/reference/env-configuration/\#pinecone_metric "Direct link to pinecone_metric")

- Type: `str`
- Default: `cosine`
- Options: `cosine`, `dotproduct`, `euclidean`
- Description: Specifies the similarity metric to use for vector comparisons within the Pinecone index.

#### `PINECONE_CLOUD` [​](https://docs.openwebui.com/reference/env-configuration/\#pinecone_cloud "Direct link to pinecone_cloud")

- Type: `str`
- Default: `aws`
- Options: `aws`, `gcp`, `azure`
- Description: Specifies the cloud provider where the Pinecone index is hosted.

### Weaviate [​](https://docs.openwebui.com/reference/env-configuration/\#weaviate "Direct link to Weaviate")

info

**Self-Hosted and Cloud Deployments**

Open WebUI uses `connect_to_custom` for Weaviate connections, which supports both locally hosted and remote Weaviate instances. This is essential for self-hosted deployments where HTTP and gRPC endpoints may be on different ingresses or hostnames, which is common in container orchestration platforms like Kubernetes or Azure Container Apps.

#### `WEAVIATE_HTTP_HOST` [​](https://docs.openwebui.com/reference/env-configuration/\#weaviate_http_host "Direct link to weaviate_http_host")

- Type: `str`
- Default: Empty string (' ')
- Description: Specifies the hostname of the Weaviate server for HTTP connections. For self-hosted deployments, this is typically your Weaviate HTTP endpoint hostname.

#### `WEAVIATE_GRPC_HOST` [​](https://docs.openwebui.com/reference/env-configuration/\#weaviate_grpc_host "Direct link to weaviate_grpc_host")

- Type: `str`
- Default: Empty string (' ')
- Description: Specifies the hostname of the Weaviate server for gRPC connections. This can be different from `WEAVIATE_HTTP_HOST` when HTTP and gRPC are served on separate ingresses, which is common in container orchestration environments.

#### `WEAVIATE_HTTP_PORT` [​](https://docs.openwebui.com/reference/env-configuration/\#weaviate_http_port "Direct link to weaviate_http_port")

- Type: `int`
- Default: `8080`
- Description: Specifies the HTTP port for connecting to the Weaviate server.

#### `WEAVIATE_GRPC_PORT` [​](https://docs.openwebui.com/reference/env-configuration/\#weaviate_grpc_port "Direct link to weaviate_grpc_port")

- Type: `int`
- Default: `50051`
- Description: Specifies the gRPC port for connecting to the Weaviate server.

#### `WEAVIATE_HTTP_SECURE` [​](https://docs.openwebui.com/reference/env-configuration/\#weaviate_http_secure "Direct link to weaviate_http_secure")

- Type: `bool`
- Default: `False`
- Description: Enables HTTPS for HTTP connections to the Weaviate server. Set to `true` when connecting to a Weaviate instance with TLS enabled on the HTTP endpoint.

#### `WEAVIATE_GRPC_SECURE` [​](https://docs.openwebui.com/reference/env-configuration/\#weaviate_grpc_secure "Direct link to weaviate_grpc_secure")

- Type: `bool`
- Default: `False`
- Description: Enables TLS for gRPC connections to the Weaviate server. Set to `true` when connecting to a Weaviate instance with TLS enabled on the gRPC endpoint.

#### `WEAVIATE_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#weaviate_api_key "Direct link to weaviate_api_key")

- Type: `str`
- Default: `None`
- Description: Sets the API key for authenticating with Weaviate server.

#### `WEAVIATE_SKIP_INIT_CHECKS` [​](https://docs.openwebui.com/reference/env-configuration/\#weaviate_skip_init_checks "Direct link to weaviate_skip_init_checks")

- Type: `bool`
- Default: `False`
- Description: Skips Weaviate initialization checks when connecting. This can be useful in certain network configurations where the checks may fail but the connection itself works.

### Oracle 23ai Vector Search (oracle23ai) [​](https://docs.openwebui.com/reference/env-configuration/\#oracle-23ai-vector-search-oracle23ai "Direct link to Oracle 23ai Vector Search (oracle23ai)")

#### `ORACLE_DB_USE_WALLET` [​](https://docs.openwebui.com/reference/env-configuration/\#oracle_db_use_wallet "Direct link to oracle_db_use_wallet")

- **Type**: `bool`
- **Default**: `false`
- **Description**: Determines the connection method to the Oracle Database.
  - Set to `false` for direct connections (e.g., to Oracle Database 23ai Free or DBCS instances) using host, port, and service name in `ORACLE_DB_DSN`.
  - Set to `true` for wallet-based connections (e.g., to Oracle Autonomous Database (ADW/ATP)). When `true`, `ORACLE_WALLET_DIR` and `ORACLE_WALLET_PASSWORD` must also be configured.

#### `ORACLE_DB_USER` [​](https://docs.openwebui.com/reference/env-configuration/\#oracle_db_user "Direct link to oracle_db_user")

- **Type**: `str`
- **Default**: `DEMOUSER`
- **Description**: Specifies the username used to connect to the Oracle Database.

#### `ORACLE_DB_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#oracle_db_password "Direct link to oracle_db_password")

- **Type**: `str`
- **Default**: `Welcome123456`
- **Description**: Specifies the password for the `ORACLE_DB_USER`.

#### `ORACLE_DB_DSN` [​](https://docs.openwebui.com/reference/env-configuration/\#oracle_db_dsn "Direct link to oracle_db_dsn")

- **Type**: `str`
- **Default**: `localhost:1521/FREEPDB1`
- **Description**: Defines the Data Source Name for the Oracle Database connection.
  - If `ORACLE_DB_USE_WALLET` is `false`, this should be in the format `hostname:port/service_name` (e.g., `localhost:1521/FREEPDB1`).
  - If `ORACLE_DB_USE_WALLET` is `true`, this can be a TNS alias (e.g., `medium` for ADW/ATP), or a full connection string.

#### `ORACLE_WALLET_DIR` [​](https://docs.openwebui.com/reference/env-configuration/\#oracle_wallet_dir "Direct link to oracle_wallet_dir")

- **Type**: `str`
- **Default**: Empty string (' ')
- **Description**: **Required when `ORACLE_DB_USE_WALLET` is `true`**. Specifies the absolute path to the directory containing the Oracle Cloud Wallet files (e.g., `cwallet.sso`, `sqlnet.ora`, `tnsnames.ora`).

#### `ORACLE_WALLET_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#oracle_wallet_password "Direct link to oracle_wallet_password")

- **Type**: `str`
- **Default**: Empty string (' ')
- **Description**: **Required when `ORACLE_DB_USE_WALLET` is `true`**. Specifies the password for the Oracle Cloud Wallet.

#### `ORACLE_VECTOR_LENGTH` [​](https://docs.openwebui.com/reference/env-configuration/\#oracle_vector_length "Direct link to oracle_vector_length")

- **Type**: `int`
- **Default**: `768`
- **Description**: Sets the expected dimension or length of the vector embeddings stored in the Oracle Database. This must match the embedding model used.

#### `ORACLE_DB_POOL_MIN` [​](https://docs.openwebui.com/reference/env-configuration/\#oracle_db_pool_min "Direct link to oracle_db_pool_min")

- **Type**: `int`
- **Default**: `2`
- **Description**: The minimum number of connections to maintain in the Oracle Database connection pool.

#### `ORACLE_DB_POOL_MAX` [​](https://docs.openwebui.com/reference/env-configuration/\#oracle_db_pool_max "Direct link to oracle_db_pool_max")

- **Type**: `int`
- **Default**: `10`
- **Description**: The maximum number of connections allowed in the Oracle Database connection pool.

#### `ORACLE_DB_POOL_INCREMENT` [​](https://docs.openwebui.com/reference/env-configuration/\#oracle_db_pool_increment "Direct link to oracle_db_pool_increment")

- **Type**: `int`
- **Default**: `1`
- **Description**: The number of connections to create when the pool needs to grow.

### S3 Vector Bucket [​](https://docs.openwebui.com/reference/env-configuration/\#s3-vector-bucket "Direct link to S3 Vector Bucket")

When using S3 Vector Bucket as the vector store, the following environment variables are used to control its behavior. Make sure to set these variables in your `.env` file or deployment environment.

info

Note: this configuration assumes that AWS credentials will be available to your Open WebUI environment. This could be through environment variables like `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`, or through IAM role permissions.

#### `S3_VECTOR_BUCKET_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#s3_vector_bucket_name "Direct link to s3_vector_bucket_name")

- Type: `str`
- Description: Specifies the name of the S3 Vector Bucket to store vectors in.

#### `S3_VECTOR_REGION` [​](https://docs.openwebui.com/reference/env-configuration/\#s3_vector_region "Direct link to s3_vector_region")

- Type: `str`
- Description: Specifies the AWS region where the S3 Vector Bucket is hosted.

### Valkey [​](https://docs.openwebui.com/reference/env-configuration/\#valkey "Direct link to Valkey")

Use [Valkey](https://valkey.io/) with the [valkey-search](https://github.com/valkey-io/valkey-search) module as the vector store by setting `VECTOR_DB=valkey`. Indexing, KNN search and metadata filtering all run server-side in Valkey.

Community-supported

The Valkey backend is community-contributed and maintained on a best-effort basis.

Requirements

Valkey is **opt-in and not bundled**. Install the client manually (`pip install valkey-glide-sync==2.3.1`) and run **Valkey core 9.0.1+ with the valkey-search module 1.2.0+ loaded**. Open WebUI verifies both versions at startup and refuses to start against an older server.

#### `VALKEY_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#valkey_url "Direct link to valkey_url")

- Type: `str`
- Default: `''` (empty)
- Description: Connection URL of the Valkey server, e.g. `valkey://localhost:6379` (an optional `/<db>` suffix selects the database number). **Required** when `VECTOR_DB=valkey`.

#### `VALKEY_COLLECTION_PREFIX` [​](https://docs.openwebui.com/reference/env-configuration/\#valkey_collection_prefix "Direct link to valkey_collection_prefix")

- Type: `str`
- Default: `open_webui`
- Description: Prefix applied to every index and key Open WebUI creates in Valkey, so multiple instances can share one server without colliding.

#### `VALKEY_INDEX_TYPE` [​](https://docs.openwebui.com/reference/env-configuration/\#valkey_index_type "Direct link to valkey_index_type")

- Type: `str`
- Default: `HNSW`
- Description: Vector index algorithm: `HNSW` (approximate, scales better) or `FLAT` (exact brute-force). Case-insensitive.

#### `VALKEY_DISTANCE_METRIC` [​](https://docs.openwebui.com/reference/env-configuration/\#valkey_distance_metric "Direct link to valkey_distance_metric")

- Type: `str`
- Default: `COSINE`
- Description: Similarity metric: `COSINE`, `L2` or `IP` (inner product). Case-insensitive; an invalid value fails fast at startup.

#### `VALKEY_HNSW_M` [​](https://docs.openwebui.com/reference/env-configuration/\#valkey_hnsw_m "Direct link to valkey_hnsw_m")

- Type: `int`
- Default: `16`
- Description: HNSW graph connectivity (edges per node). Higher improves recall at the cost of memory and build time. Used only when `VALKEY_INDEX_TYPE=HNSW`.

#### `VALKEY_HNSW_EF_CONSTRUCTION` [​](https://docs.openwebui.com/reference/env-configuration/\#valkey_hnsw_ef_construction "Direct link to valkey_hnsw_ef_construction")

- Type: `int`
- Default: `200`
- Description: Candidate-list size during index construction. Higher builds a better graph (higher recall) but slows indexing. Used only when `VALKEY_INDEX_TYPE=HNSW`.

#### `VALKEY_HNSW_EF_RUNTIME` [​](https://docs.openwebui.com/reference/env-configuration/\#valkey_hnsw_ef_runtime "Direct link to valkey_hnsw_ef_runtime")

- Type: `int`
- Default: `10`
- Description: Candidate-list size at query time. Higher improves recall at the cost of query latency. Used only when `VALKEY_INDEX_TYPE=HNSW`.

## RAG Content Extraction Engine [​](https://docs.openwebui.com/reference/env-configuration/\#rag-content-extraction-engine "Direct link to RAG Content Extraction Engine")

#### `CONTENT_EXTRACTION_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#content_extraction_engine "Direct link to content_extraction_engine")

- Type: `str`
- Options:
  - Leave empty to use default
  - `external`: Use external loader
  - `tika`: Use a local Apache Tika server
  - `docling`: Use Docling engine
  - `document_intelligence`: Use Document Intelligence engine
  - `mistral_ocr`: Use Mistral OCR engine
  - `datalab_marker`: Use Datalab Marker engine
  - `mineru`: Use MinerU engine
  - `paddleocr_vl`: Use a PaddleOCR-vl server (requires `PADDLEOCR_VL_TOKEN`; see below)
- Description: Sets the content extraction engine to use for document ingestion.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MISTRAL_OCR_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#mistral_ocr_api_key "Direct link to mistral_ocr_api_key")

- Type: `str`
- Default: `None`
- Description: Specifies the Mistral OCR API key to use.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MISTRAL_OCR_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#mistral_ocr_api_base_url "Direct link to mistral_ocr_api_base_url")

- Type: `str`
- Default: `https://api.mistral.ai/v1`
- Description: Configures custom Mistral OCR API endpoints for flexible deployment options, allowing users to point to self-hosted or alternative Mistral OCR instances.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MISTRAL_OCR_USE_BASE64` [​](https://docs.openwebui.com/reference/env-configuration/\#mistral_ocr_use_base64 "Direct link to mistral_ocr_use_base64")

- Type: `bool`
- Default: `False`
- Description: When enabled, PDFs are sent to the Mistral OCR API **inline as a base64 data URL** instead of being uploaded to Mistral's file store first. Useful when the separate upload step is undesirable (proxy/air-gapped setups) or fails; it trades the extra upload request for a single larger request. Also configurable as **Use Base64** in **Admin Panel → Settings → Documents**.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `EXTERNAL_DOCUMENT_LOADER_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#external_document_loader_url "Direct link to external_document_loader_url")

- Type: `str`
- Default: `None`
- Description: Sets the URL for the external document loader service.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `EXTERNAL_DOCUMENT_LOADER_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#external_document_loader_api_key "Direct link to external_document_loader_api_key")

- Type: `str`
- Default: `None`
- Description: Sets the API key for authenticating with the external document loader service.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `EXTERNAL_DOCUMENT_LOADER_HEADERS` [​](https://docs.openwebui.com/reference/env-configuration/\#external_document_loader_headers "Direct link to external_document_loader_headers")

- Type: `str` (JSON object)
- Default: `{}`
- Description: Custom HTTP headers sent to the external document loader service, as a JSON object (for example `{"X-Tenant": "acme"}`). Header values support placeholder templating with the file placeholders `{{FILE_ID}}`, `{{FILE_NAME}}`, `{{FILE_CONTENT_TYPE}}` and the same user placeholders as other custom headers (`{{USER_ID}}`, `{{USER_NAME}}`, `{{USER_EMAIL}}`, `{{USER_ROLE}}`). Useful for per-request authentication or routing on your loader service. Invalid JSON is ignored and falls back to `{}`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `TIKA_SERVER_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#tika_server_url "Direct link to tika_server_url")

- Type: `str`
- Default: `http://localhost:9998`
- Description: Sets the URL for the Apache Tika server.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `DOCLING_SERVER_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#docling_server_url "Direct link to docling_server_url")

- Type: `str`
- Default: `http://docling:5001`
- Description: Specifies the URL for the Docling server. Requires Docling version 2.0.0 or later for full compatibility with the new parameter-based configuration system.
- Persistence: This environment variable is a `ConfigVar` variable.

warning

**Docling 2.0.0+ Required**

The Docling integration has been refactored to use server-side parameter passing. If you are using Docling:

1. Upgrade to Docling server version 2.0.0 or later
2. Migrate all individual `DOCLING_*` configuration variables to the `DOCLING_PARAMS` JSON object
3. Remove all deprecated `DOCLING_*` environment variables from your configuration
4. Add `DOCLING_API_KEY` if your server requires authentication

The old individual environment variables (`DOCLING_OCR_ENGINE`, `DOCLING_OCR_LANG`, etc.) are no longer supported and will be ignored.

#### `DOCLING_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#docling_api_key "Direct link to docling_api_key")

- Type: `str`
- Default: `None`
- Description: Sets the API key for authenticating with the Docling server. Required when the Docling server has authentication enabled.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `DOCLING_PARAMS` [​](https://docs.openwebui.com/reference/env-configuration/\#docling_params "Direct link to docling_params")

- Type: `str` (JSON)

- Default: `{}`

- Description: Specifies all Docling processing parameters in JSON format. This is the primary configuration method for Docling processing options. All previously individual Docling settings are now configured through this single JSON object.

**Supported Parameters:**
  - `do_ocr` (bool): Enable OCR processing.
  - `force_ocr` (bool): Force OCR even when text layer exists.
  - `ocr_engine` (str): OCR engine to use. Options: `tesseract`, `easyocr`, `ocrmac`, `rapidocr`, `tesserocr`.
  - `ocr_lang` (list\[str\]): OCR language codes. Note: Format depends on engine (e.g., `["eng", "fra"]` for Tesseract; `["en", "fr"]` for EasyOCR).
  - `pdf_backend` (str): PDF processing backend. Options: `dlparse_v1`, `dlparse_v2`, `dlparse_v4`, `pypdfium2`.
  - `table_mode` (str): Table extraction mode. Options: `fast`, `accurate`.
  - `pipeline` (str): Processing pipeline to use. Options: `fast`, `standard`.
  - `do_picture_description` (bool): Enable image description generation.
  - `picture_description_mode` (str): Mode for picture descriptions. Options: `local`, `api`.
  - `picture_description_local` (str): Local model configuration object for picture descriptions.
  - `picture_description_api` (str): API endpoint configuration object for picture descriptions.
  - `vlm_pipeline_model_api` (str): Vision-language model API configuration. (e.g., `openai://gpt-4o`).
- Example:


```
{
  "do_ocr": true,
  "ocr_engine": "tesseract",
  "ocr_lang": ["eng", "fra", "deu", "spa"],
  "force_ocr": false,
  "pdf_backend": "dlparse_v4",
  "table_mode": "accurate",
  "do_picture_description": true,
  "picture_description_mode": "api",
  "vlm_pipeline_model_api": "openai://gpt-4o"
}
```

tip

**dlparse** vs **dbparse**: Note that the backend names use **`dlparse`** (Deep Learning Parse), not `dbparse`. For modern Docling (v2+), `dlparse_v4` is generally recommended for the best balance of features.

- Persistence: This environment variable is a `ConfigVar` variable.

info

**Migration from Individual Docling Variables**

If you were previously using individual `DOCLING_*` environment variables (such as `DOCLING_OCR_ENGINE`, `DOCLING_OCR_LANG`, etc.), these are now deprecated. You must migrate to using `DOCLING_PARAMS` as a single JSON configuration object.

**Example Migration:**

```
# Old configuration (deprecated)
DOCLING_OCR_ENGINE=tesseract
DOCLING_OCR_LANG=eng,fra
DOCLING_DO_OCR=true

# New configuration (required)
DOCLING_PARAMS='{"do_ocr": true, "ocr_engine": "tesseract", "ocr_lang": "eng,fra"}'
```

warning

When setting this environment variable in a `.env` file, ensure proper JSON formatting and escape quotes as needed:

```text
DOCLING_PARAMS="{\"do_ocr\": true, \"ocr_engine\": \"tesseract\", \"ocr_lang\": \"eng,fra,deu,spa\"}"
```

#### `MINERU_API_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#mineru_api_timeout "Direct link to mineru_api_timeout")

- Type: `str`
- Default: `300`
- Description: Sets the timeout in seconds for MinerU API requests during document processing.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MINERU_FILE_EXTENSIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#mineru_file_extensions "Direct link to mineru_file_extensions")

- Type: `str` (comma-separated)
- Default: `pdf`
- Description: File extensions routed to the **MinerU** engine when `CONTENT_EXTRACTION_ENGINE=mineru`. Comma-separated, lower-case, no leading dots (e.g. `pdf,png,jpg`). A file whose extension is not on this list skips MinerU and falls back to the default loader. MinerU was previously hardcoded to PDF only, so only add extensions your MinerU deployment actually supports.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MINERU_MAX_MARKDOWN_BYTES` [​](https://docs.openwebui.com/reference/env-configuration/\#mineru_max_markdown_bytes "Direct link to mineru_max_markdown_bytes")

- Type: `int`
- Default: unset (no limit)
- Description: Caps the size, in bytes, of the Markdown the **MinerU** loader returns from a processed document. Output beyond the cap is truncated, guarding against a single huge document flooding context or memory. Leave unset for no limit.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

#### `MINERU_PARAMS` [​](https://docs.openwebui.com/reference/env-configuration/\#mineru_params "Direct link to mineru_params")

- Type: `dict` (JSON object)
- Default: `{}` (engine defaults)
- Description: Extra options passed to the **MinerU** document loader as a JSON object. Recognized keys include `enable_ocr` (default `false`), `enable_formula` (`true`), `enable_table` (`true`), `language` (`en`), and `model_version` (`pipeline`). Also configurable in **Admin Panel → Settings → Documents** when MinerU is the content-extraction engine.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `PADDLEOCR_VL_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#paddleocr_vl_base_url "Direct link to paddleocr_vl_base_url")

- Type: `str`
- Default: `http://localhost:8080`
- Description: Base URL of the PaddleOCR-vl server used when `CONTENT_EXTRACTION_ENGINE=paddleocr_vl`. Documents and images are POSTed to `{base_url}/layout-parsing` and the response's `layoutParsingResults[].markdown.text` is ingested page-by-page.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `PADDLEOCR_VL_TOKEN` [​](https://docs.openwebui.com/reference/env-configuration/\#paddleocr_vl_token "Direct link to paddleocr_vl_token")

- Type: `str`
- Default: `""` (empty)
- Description: Authentication token for the PaddleOCR-vl server. Sent as `Authorization: token <value>` on every layout-parsing request. **The PaddleOCR-vl engine is skipped at runtime if this value is empty**: the loader falls back to the default PyPDFLoader for the current document even when `CONTENT_EXTRACTION_ENGINE=paddleocr_vl` is set. Set this to activate the engine.
- Persistence: This environment variable is a `ConfigVar` variable.

Supported file types

PaddleOCR-vl handles both documents and images. Extensions treated as images and dispatched with `fileType=1`: `png`, `jpg`, `jpeg`, `bmp`, `tiff`, `webp`. Everything else is dispatched with `fileType=0` (document, e.g. PDFs). Output is per-page Markdown, so downstream chunking behaves the same as other engines.

## Retrieval Augmented Generation (RAG) [​](https://docs.openwebui.com/reference/env-configuration/\#retrieval-augmented-generation-rag "Direct link to Retrieval Augmented Generation (RAG)")

### Core Configuration [​](https://docs.openwebui.com/reference/env-configuration/\#core-configuration "Direct link to Core Configuration")

#### `RAG_EMBEDDING_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_embedding_engine "Direct link to rag_embedding_engine")

- Type: `str`
- Options:
  - Leave empty for `Default (SentenceTransformers)`: Uses SentenceTransformers for embeddings.
  - `ollama`: Uses the Ollama API for embeddings.
  - `openai`: Uses the OpenAI API for embeddings.
  - `azure_openai`: Uses Azure OpenAI Services for embeddings.
- Description: Selects an embedding engine to use for RAG.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_EMBEDDING_MODEL` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_embedding_model "Direct link to rag_embedding_model")

- Type: `str`
- Default: `sentence-transformers/all-MiniLM-L6-v2`
- Description: Sets a model for embeddings. Locally, a Sentence-Transformer model is used.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_TOP_K` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_top_k "Direct link to rag_top_k")

- Type: `int`
- Default: `3`
- Description: Sets the default number of results to consider for the embedding when using RAG.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_TOP_K_RERANKER` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_top_k_reranker "Direct link to rag_top_k_reranker")

- Type: `int`
- Default: `3`
- Description: Sets the default number of results to consider for the reranker when using RAG.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_RELEVANCE_THRESHOLD` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_relevance_threshold "Direct link to rag_relevance_threshold")

- Type: `float`
- Default: `0.0`
- Description: Sets the relevance threshold to consider for documents when used with reranking.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_RAG_HYBRID_SEARCH` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_rag_hybrid_search "Direct link to enable_rag_hybrid_search")

- Type: `bool`
- Default: `False`
- Description: Enables hybrid search (`BM25` \+ vector retrieval), with optional reranking if a reranking model is configured. Applies to both the standard RAG retrieval pipeline and the native knowledge tools used in agentic mode.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_KB_EXEC` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_kb_exec "Direct link to enable_kb_exec")

- Type: `bool`

- Default: `False`

- Description: When enabled, adds a `kb_exec` tool that lets the model interact with knowledge bases through shell-style commands (`ls`, `tree`, `cat`, `head`, `tail`, `sed`, `grep`, `find`, `wc`, `stat`) with pipe support (e.g. `grep "auth" | head -5`). Directory-aware: `ls docs/` lists a subdirectory, `tree` renders a recursive view, `grep "text" docs/` scopes the search, and files can be referenced by path (`docs/api/auth.md`), filename, or file ID.

Turning this on **replaces** the file-oriented per-purpose tools (`list_knowledge`, `search_knowledge_files`, `grep_knowledge_files`, `view_file`, `view_knowledge_file`): they would overlap with the equivalent `kb_exec` commands. Tools that do something `kb_exec` can't are **kept** alongside it:


  - `query_knowledge_files` (semantic / RAG search), always
  - `view_note`, when notes are attached to the model
  - `query_knowledge_bases` and `search_knowledge_bases`, when no knowledge is attached, so the model can still discover KBs by name/description

**Recommended for an enhanced, agentic RAG experience.** The shell-style interface lets a capable model explore a knowledge base (list, grep, read by line range) the way it would a local filesystem, which it tends to chain more reliably than a fan-out of separate search tools, so it lands on the right passage more often. It only takes effect with **native function calling** (the default; it is a native-mode builtin tool); for models set to Legacy it has no effect. Still experimental, and best paired with capable frontier models that handle shell-style tool chaining well. See [Filesystem-style access](https://docs.openwebui.com/features/workspace/knowledge#filesystem-style-access-kb_exec).

#### `RAG_HYBRID_BM25_WEIGHT` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_hybrid_bm25_weight "Direct link to rag_hybrid_bm25_weight")

- Type: `float`
- Default: `0.5`
- Description: Sets the weight given to the keyword search (BM25) during hybrid search. 1 means only keyword search, 0 means only vector search.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_RAG_HYBRID_SEARCH_ENRICHED_TEXTS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_rag_hybrid_search_enriched_texts "Direct link to enable_rag_hybrid_search_enriched_texts")

- Type: `bool`
- Default: `False`
- Description: Enhances BM25 hybrid search by enriching indexed text with document metadata including filenames, titles, sections, and snippets. This improves keyword recall for metadata-based queries, allowing searches to match on document names and structural elements in addition to content.
- Persistence: This environment variable is a `ConfigVar` variable.

info

Enabling this feature increases the text volume indexed by BM25, which may impact storage requirements and indexing performance. However, it significantly improves search results when users query based on document names, titles, or structural elements rather than just content.

#### `RAG_TEMPLATE` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_template "Direct link to rag_template")

- Type: `str`
- Default: The value of `DEFAULT_RAG_TEMPLATE` environment variable.

`DEFAULT_RAG_TEMPLATE`:

```text

### Task:
Respond to the user query using the provided context, incorporating inline citations in the format [id] **only when the <source> tag includes an explicit id attribute** (e.g., <source id="1">).

### Guidelines:
- If you don't know the answer, clearly state that.
- If uncertain, ask the user for clarification.
- Respond in the same language as the user's query.
- If the context is unreadable or of poor quality, inform the user and provide the best possible answer.
- If the answer isn't present in the context but you possess the knowledge, explain this to the user and provide the answer using your own understanding.
- **Only include inline citations using [id] (e.g., [1], [2]) when the <source> tag includes an id attribute.**
- Do not cite if the <source> tag does not contain an id attribute.
- Do not use XML tags in your response.
- Ensure citations are concise and directly related to the information provided.

### Example of Citation:
If the user asks about a specific topic and the information is found in a source with a provided id attribute, the response should include the citation like in the following example:
* "According to the study, the proposed method increases efficiency by 20% [1]."

### Output:
Provide a clear and direct response to the user's query, including inline citations in the format [id] only when the <source> tag with id attribute is present in the context.

<context>
{{CONTEXT}}
</context>
```

- Description: Template to use when injecting RAG documents into chat completion. The template wraps the retrieved context (use the `{{CONTEXT}}` placeholder); the user's query is appended automatically, so do **not** add a `{{QUERY}}` / `[query]` placeholder or the query will appear twice in the final prompt. See [RAG Template Customization](https://docs.openwebui.com/features/chat-conversations/rag#rag-template-customization).
- Persistence: This environment variable is a `ConfigVar` variable.

### Document Processing [​](https://docs.openwebui.com/reference/env-configuration/\#document-processing "Direct link to Document Processing")

#### `CHUNK_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#chunk_size "Direct link to chunk_size")

- Type: `int`
- Default: `1000`
- Description: Sets the document chunk size for embeddings.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CHUNK_OVERLAP` [​](https://docs.openwebui.com/reference/env-configuration/\#chunk_overlap "Direct link to chunk_overlap")

- Type: `int`
- Default: `100`
- Description: Specifies how much overlap there should be between chunks.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `CHUNK_MIN_SIZE_TARGET` [​](https://docs.openwebui.com/reference/env-configuration/\#chunk_min_size_target "Direct link to chunk_min_size_target")

- Type: `int`
- Default: `0`
- Description: Chunks smaller than this threshold will be intelligently merged with neighboring chunks when possible. This helps prevent tiny, low-quality fragments that can hurt retrieval performance and waste embedding resources. This feature only works when `ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER` is enabled. Set to `0` to disable merging. For more information on the benefits and configuration, see the [RAG guide](https://docs.openwebui.com/features/chat-conversations/rag#chunking-configuration).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_TEXT_SPLITTER` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_text_splitter "Direct link to rag_text_splitter")

- Type: `str`
- Options:
  - `character`
  - `token`
- Default: `character`
- Description: Sets the text splitter for RAG models. Use `character` for RecursiveCharacterTextSplitter or `token` for TokenTextSplitter. By default the `token` splitter is Tiktoken-based; set `RAG_TOKENIZER_MODEL` to use a HuggingFace tokenizer instead.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_TOKENIZER_MODEL` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_tokenizer_model "Direct link to rag_tokenizer_model")

- Type: `str`
- Default: `(empty)`
- Description: When `RAG_TEXT_SPLITTER=token`, selects a HuggingFace transformers tokenizer (by model id, e.g. `bert-base-uncased`) to measure token length for chunking, instead of the default Tiktoken encoder. Leave empty to use Tiktoken. The tokenizer is downloaded and cached (honoring `SENTENCE_TRANSFORMERS_HOME` / `HF_HUB_CACHE`); use it to match chunk boundaries to your embedding model's own tokenizer.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_markdown_header_text_splitter "Direct link to enable_markdown_header_text_splitter")

- Type: `bool`
- Default: `True`
- Description: Enables markdown header text splitting as a preprocessing step before character or token splitting. When enabled, documents are first split by markdown headers (h1-h6), then the resulting chunks are further processed by the configured text splitter (`RAG_TEXT_SPLITTER`). This helps preserve document structure and context across chunks.
- Persistence: This environment variable is a `ConfigVar` variable.

info

**Migration from `markdown_header` TEXT\_SPLITTER**

The `markdown_header` option has been removed from `RAG_TEXT_SPLITTER`. Markdown header splitting is now a preprocessing step controlled by `ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER`. If you were using `RAG_TEXT_SPLITTER=markdown_header`, switch to `character` or `token` and ensure `ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER` is enabled (it is enabled by default).

#### `TIKTOKEN_CACHE_DIR` [​](https://docs.openwebui.com/reference/env-configuration/\#tiktoken_cache_dir "Direct link to tiktoken_cache_dir")

- Type: `str`
- Default: `{CACHE_DIR}/tiktoken`
- Description: Sets the directory for TikToken cache.

#### `TIKTOKEN_ENCODING_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#tiktoken_encoding_name "Direct link to tiktoken_encoding_name")

- Type: `str`
- Default: `cl100k_base`
- Description: Sets the encoding name for TikToken.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `PDF_EXTRACT_IMAGES` [​](https://docs.openwebui.com/reference/env-configuration/\#pdf_extract_images "Direct link to pdf_extract_images")

- Type: `bool`
- Default: `False`
- Description: Extracts images from PDFs using OCR when loading documents.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `PDF_LOADER_MODE` [​](https://docs.openwebui.com/reference/env-configuration/\#pdf_loader_mode "Direct link to pdf_loader_mode")

- Type: `str`
- Options:
  - `page`: Creates one document per page (default).
  - `single`: Combines all pages into one document for better chunking across page boundaries.
- Default: `page`
- Description: Controls how PDFs are loaded and split into documents when using the **default content extraction engine** (PyPDFLoader). Page mode creates one document per page, while single mode combines all pages into one document, which can improve chunking quality when content spans across page boundaries. This setting has no effect when using external content extraction engines like Tika, Docling, Document Intelligence, MinerU, or Mistral OCR, as those engines have their own document handling logic.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_FILE_MAX_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_file_max_size "Direct link to rag_file_max_size")

- Type: `int`
- Description: Sets the maximum size of a file in megabytes that can be uploaded for document ingestion.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_FILE_MAX_COUNT` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_file_max_count "Direct link to rag_file_max_count")

- Type: `int`
- Description: Sets the maximum number of files that can be uploaded at once for document ingestion.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_FILE_CONTENT_SEARCH_MAX_CHARS` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_file_content_search_max_chars "Direct link to rag_file_content_search_max_chars")

- Type: `int`
- Default: `67108864` (64 MiB)
- Description: Caps how many characters of a file's extracted content are scanned during content search. Guards against a single very large document making search slow or memory-heavy.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

#### `FILE_IMAGE_COMPRESSION_WIDTH` [​](https://docs.openwebui.com/reference/env-configuration/\#file_image_compression_width "Direct link to file_image_compression_width")

- Type: `int`
- Default: `None`
- Description: Sets the maximum width, in pixels, used for client-side compression of image files uploaded. When unset, no backend-configured width limit is applied.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `FILE_IMAGE_COMPRESSION_HEIGHT` [​](https://docs.openwebui.com/reference/env-configuration/\#file_image_compression_height "Direct link to file_image_compression_height")

- Type: `int`
- Default: `None`
- Description: Sets the maximum height, in pixels, used for client-side compression of image files uploaded. When unset, no backend-configured height limit is applied.
- Persistence: This environment variable is a `ConfigVar` variable.

note

These values are exposed through app config and consumed by the frontend chat upload flow for image files. Compression happens client-side with aspect ratio preserved. Non-image file uploads are not affected.

#### `RAG_ALLOWED_FILE_EXTENSIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_allowed_file_extensions "Direct link to rag_allowed_file_extensions")

- Type: `list` of `str`
- Default: `[]` (which means all supported file types are allowed)
- Description: Specifies which file extensions are permitted for upload.

```
["pdf,docx,txt"]
```

- Persistence: This environment variable is a `ConfigVar` variable.

info

When configuring `RAG_FILE_MAX_SIZE` and `RAG_FILE_MAX_COUNT`, ensure that the values are reasonable to prevent excessive file uploads and potential performance issues.

### Embedding Engine Configuration [​](https://docs.openwebui.com/reference/env-configuration/\#embedding-engine-configuration "Direct link to Embedding Engine Configuration")

#### General Embedding Settings [​](https://docs.openwebui.com/reference/env-configuration/\#general-embedding-settings "Direct link to General Embedding Settings")

#### `RAG_EMBEDDING_BATCH_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_embedding_batch_size "Direct link to rag_embedding_batch_size")

- Type: `int`
- Default: `1`
- Description: Controls how many text chunks are embedded in a single API request when using external embedding providers (Ollama, OpenAI, or Azure OpenAI). Higher values (20-100+; max 16000 (not recommended)) may process documents faster by sending less, but larger API requests. Some external APIs do not support batching or sending more than 1 chunk per request. In such casey you must leave this at `1`. Default is 1 (safest option if the API does not support batching / more than 1 chunk per request). This setting only applies to external embedding engines, not the default SentenceTransformers engine.
- Persistence: This environment variable is a `ConfigVar` variable.

info

Check if your API and embedding model supports batched processing.
Only increase this variable's value if it does. Otherwise you might run into unexpected issues.

#### `ENABLE_ASYNC_EMBEDDING` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_async_embedding "Direct link to enable_async_embedding")

- Type: `bool`
- Default: `true`
- Description: Runs embedding tasks asynchronously (parallelized) for maximum performance. Only works for Ollama, OpenAI and Azure OpenAI, does not affect sentence transformer setups.
- Persistence: This environment variable is a `ConfigVar` variable.

tip

It may be needed to increase the value of `THREAD_POOL_SIZE` if many other users are simultaneously using your Open WebUI instance while having async embeddings turned on to prevent

warning

Enabling this will potentially send thousands of requests per minute.
If you are embedding locally, ensure that you can handle this amount of requests, otherwise turn this off to return to sequential embedding (slower but will always work).
If you are embedding externally via API, ensure your rate limits are high enough to handle parallel embedding.
(Usually, OpenAI can handle thousands of embedding requests per minute, even on the lowest API tier).

#### `RAG_EMBEDDING_CONCURRENT_REQUESTS` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_embedding_concurrent_requests "Direct link to rag_embedding_concurrent_requests")

- Type: `int`
- Default: `0`
- Description: Limits the number of concurrent embedding API requests when async embedding is enabled. Uses an asyncio semaphore to throttle parallel requests. Set to `0` for unlimited concurrency (default behavior), or set to a positive integer to cap simultaneous requests. Useful for respecting rate limits on external embedding APIs or reducing load on local embedding servers.
- Persistence: This environment variable is a `ConfigVar` variable.

tip

If you are hitting rate limits from your embedding provider (e.g., 429 errors), set this to a value that keeps you within your API tier's rate limit (e.g., `5` or `10`). This is especially helpful when uploading large documents that generate many embedding batches.

#### `RAG_EMBEDDING_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_embedding_timeout "Direct link to rag_embedding_timeout")

- Type: `int` (seconds)
- Default: `None` (no timeout)
- Description: Sets an optional timeout in seconds for embedding operations during document upload. When set, embedding requests that exceed this duration will be aborted with a timeout error. When unset (default), embedding operations run without a time limit. This setting is primarily relevant for deployments using the default **SentenceTransformers** embedding engine, where embeddings run locally and can take longer on slower hardware. External embedding engines (Ollama, OpenAI, Azure OpenAI) have their own timeout mechanisms and are generally not affected by this setting.

info

This variable was introduced alongside a fix for **uvicorn worker death during document uploads**. Previously, local embedding operations could block the worker thread long enough to trigger uvicorn's health check timeout (default: 5 seconds), causing the worker process to be killed. The underlying fix uses `run_coroutine_threadsafe` to keep the main event loop responsive to health checks regardless of this timeout setting. The timeout is purely a safety net for aborting abnormally long embedding operations; it does not affect worker health check behavior.

#### `RAG_EMBEDDING_CONTENT_PREFIX` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_embedding_content_prefix "Direct link to rag_embedding_content_prefix")

- Type: `str`
- Default: `None`
- Description: Sets the prefix string prepended to document content before generating embeddings. Some embedding models (e.g., nomic-embed-text) require task-specific prefixes to differentiate between content being stored vs. queries being searched. For nomic-embed-text, set this to `search_document:`. Only needed if your embedding model's documentation specifies a content/document prefix.

#### `RAG_EMBEDDING_QUERY_PREFIX` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_embedding_query_prefix "Direct link to rag_embedding_query_prefix")

- Type: `str`
- Default: `None`
- Description: Sets the prefix string prepended to user queries before generating embeddings for retrieval. This is the counterpart to `RAG_EMBEDDING_CONTENT_PREFIX`. For nomic-embed-text, set this to `search_query:`. Only needed if your embedding model's documentation specifies a query prefix.

#### `RAG_EMBEDDING_PREFIX_FIELD_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_embedding_prefix_field_name "Direct link to rag_embedding_prefix_field_name")

- Type: `str`
- Default: `None`
- Description: Specifies the JSON field name used to pass the prefix to the embedding API request body. When set along with a prefix value, the prefix is sent as a separate field in the API request rather than being prepended to the text. Required for embedding APIs that accept the prefix as a dedicated parameter instead of inline text.

#### OpenAI Embeddings [​](https://docs.openwebui.com/reference/env-configuration/\#openai-embeddings "Direct link to OpenAI Embeddings")

#### `RAG_OPENAI_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_openai_api_base_url "Direct link to rag_openai_api_base_url")

- Type: `str`
- Default: `${OPENAI_API_BASE_URL}`
- Description: Sets the OpenAI base API URL to use for RAG embeddings.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_OPENAI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_openai_api_key "Direct link to rag_openai_api_key")

- Type: `str`
- Default: `${OPENAI_API_KEY}`
- Description: Sets the OpenAI API key to use for RAG embeddings.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_EMBEDDING_OPENAI_BATCH_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_embedding_openai_batch_size "Direct link to rag_embedding_openai_batch_size")

- Type: `int`
- Default: `1`
- Description: Sets the batch size for OpenAI embeddings.

#### Azure OpenAI Embeddings [​](https://docs.openwebui.com/reference/env-configuration/\#azure-openai-embeddings "Direct link to Azure OpenAI Embeddings")

#### `RAG_AZURE_OPENAI_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_azure_openai_base_url "Direct link to rag_azure_openai_base_url")

- Type: `str`
- Default: `None`
- Description: Sets the base URL for Azure OpenAI Services when using Azure OpenAI for RAG embeddings. Should be in the format `https://{your-resource-name}.openai.azure.com`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_AZURE_OPENAI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_azure_openai_api_key "Direct link to rag_azure_openai_api_key")

- Type: `str`
- Default: `None`
- Description: Sets the API key for Azure OpenAI Services when using Azure OpenAI for RAG embeddings.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_AZURE_OPENAI_API_VERSION` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_azure_openai_api_version "Direct link to rag_azure_openai_api_version")

- Type: `str`
- Default: `None`
- Description: Sets the API version for Azure OpenAI Services when using Azure OpenAI for RAG embeddings. Common values include `2023-05-15`, `2023-12-01-preview`, or `2024-02-01`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### Ollama Embeddings [​](https://docs.openwebui.com/reference/env-configuration/\#ollama-embeddings "Direct link to Ollama Embeddings")

#### `RAG_OLLAMA_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_ollama_base_url "Direct link to rag_ollama_base_url")

- Type: `str`
- Description: Sets the base URL for Ollama API used in RAG models.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_OLLAMA_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_ollama_api_key "Direct link to rag_ollama_api_key")

- Type: `str`
- Description: Sets the API key for Ollama API used in RAG models.
- Persistence: This environment variable is a `ConfigVar` variable.

### Reranking [​](https://docs.openwebui.com/reference/env-configuration/\#reranking "Direct link to Reranking")

#### `RAG_RERANKING_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_reranking_engine "Direct link to rag_reranking_engine")

- Type: `str`
- Options: `external`, or empty for local Sentence-Transformer CrossEncoder
- Default: Empty string (local reranking)
- Description: Specifies the reranking engine to use. Set to `external` to use an external reranker API (requires `RAG_EXTERNAL_RERANKER_URL`). Leave empty to use a local Sentence-Transformer CrossEncoder model.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_RERANKING_MODEL` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_reranking_model "Direct link to rag_reranking_model")

- Type: `str`
- Description: Sets a model for reranking results. Locally, a Sentence-Transformer model is used.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_RERANKING_BATCH_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_reranking_batch_size "Direct link to rag_reranking_batch_size")

- Type: `int`
- Default: `32`
- Description: Controls how many query-document pairs are scored in a single batch during local reranking. Higher values use more memory but can be faster on GPUs with sufficient VRAM. This applies to the local ColBERT/CrossEncoder reranking model's `predict()` call.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SENTENCE_TRANSFORMERS_CROSS_ENCODER_SIGMOID_ACTIVATION_FUNCTION` [​](https://docs.openwebui.com/reference/env-configuration/\#sentence_transformers_cross_encoder_sigmoid_activation_function "Direct link to sentence_transformers_cross_encoder_sigmoid_activation_function")

- Type: `bool`
- Default: `True`
- Description: When enabled (default), applies sigmoid normalization to local CrossEncoder reranking scores to ensure they fall within the 0-1 range. This allows the relevance threshold setting to work correctly with models like MS MARCO that output raw logits.

#### `RAG_EXTERNAL_RERANKER_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_external_reranker_timeout "Direct link to rag_external_reranker_timeout")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the timeout in seconds for external reranker API requests during RAG document retrieval. Leave empty to use default timeout behavior.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_EXTERNAL_RERANKER_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_external_reranker_url "Direct link to rag_external_reranker_url")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the **full URL** for the external reranking API.
- Persistence: This environment variable is a `ConfigVar` variable.

warning

You **MUST** provide the full URL, including the endpoint path (e.g., `https://api.yourprovider.com/v1/rerank`). The system does **not** automatically append `/v1/rerank` or any other path to the base URL you provide.

#### `RAG_EXTERNAL_RERANKER_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_external_reranker_api_key "Direct link to rag_external_reranker_api_key")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the API key for the external reranking API.
- Persistence: This environment variable is a `ConfigVar` variable.

### Query Generation [​](https://docs.openwebui.com/reference/env-configuration/\#query-generation "Direct link to Query Generation")

#### `ENABLE_RETRIEVAL_QUERY_GENERATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_retrieval_query_generation "Direct link to enable_retrieval_query_generation")

- Type: `bool`
- Default: `True`
- Description: Enables or disables retrieval query generation.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_QUERIES_CACHE` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_queries_cache "Direct link to enable_queries_cache")

- Type: `bool`
- Default: `False`
- Description: Enables request-scoped caching of LLM-generated search queries. When enabled, queries generated for web search are **cached** and automatically **reused** for file/knowledge base retrieval within the same request. This **eliminates duplicate LLM calls** when both web search and RAG are active, **reducing token usage and latency** while maintaining search quality. It is highly recommended to enable this especially in larger setups.

#### `QUERY_GENERATION_PROMPT_TEMPLATE` [​](https://docs.openwebui.com/reference/env-configuration/\#query_generation_prompt_template "Direct link to query_generation_prompt_template")

- Type: `str`
- Default: The value of `DEFAULT_QUERY_GENERATION_PROMPT_TEMPLATE` environment variable.

`DEFAULT_QUERY_GENERATION_PROMPT_TEMPLATE`:

```text

### Task:
Analyze the chat history to determine the necessity of generating search queries, in the given language. By default, **prioritize generating 1-3 broad and relevant search queries** unless it is absolutely certain that no additional information is required. The aim is to retrieve comprehensive, updated, and valuable information even with minimal uncertainty. If no search is unequivocally needed, return an empty list.

### Guidelines:
- Respond **EXCLUSIVELY** with a JSON object. Any form of extra commentary, explanation, or additional text is strictly prohibited.
- When generating search queries, respond in the format: { "queries": ["query1", "query2"] }, ensuring each query is distinct, concise, and relevant to the topic.
- If and only if it is entirely certain that no useful results can be retrieved by a search, return: { "queries": [] }.
- Err on the side of suggesting search queries if there is **any chance** they might provide useful or updated information.
- Be concise and focused on composing high-quality search queries, avoiding unnecessary elaboration, commentary, or assumptions.
- Today's date is: {{CURRENT_DATE}}.
- Always prioritize providing actionable and broad queries that maximize informational coverage.

### Output:
Strictly return in JSON format:
{
  "queries": ["query1", "query2"]
}

### Chat History:
<chat_history>
{{MESSAGES:END:6}}
</chat_history>
```

- Description: Sets the prompt template for query generation.
- Persistence: This environment variable is a `ConfigVar` variable.

### Document Intelligence (Azure) [​](https://docs.openwebui.com/reference/env-configuration/\#document-intelligence-azure "Direct link to Document Intelligence (Azure)")

#### `DOCUMENT_INTELLIGENCE_ENDPOINT` [​](https://docs.openwebui.com/reference/env-configuration/\#document_intelligence_endpoint "Direct link to document_intelligence_endpoint")

- Type: `str`
- Default: `None`
- Description: Specifies the endpoint for document intelligence.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `DOCUMENT_INTELLIGENCE_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#document_intelligence_key "Direct link to document_intelligence_key")

- Type: `str`
- Default: `None`
- Description: Specifies the key for document intelligence.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `DOCUMENT_INTELLIGENCE_MODEL` [​](https://docs.openwebui.com/reference/env-configuration/\#document_intelligence_model "Direct link to document_intelligence_model")

- Type: `str`
- Default: `None`
- Description: Specifies the model for document intelligence.
- Persistence: This environment variable is a `ConfigVar` variable.

### Advanced Settings [​](https://docs.openwebui.com/reference/env-configuration/\#advanced-settings "Direct link to Advanced Settings")

#### `BYPASS_EMBEDDING_AND_RETRIEVAL` [​](https://docs.openwebui.com/reference/env-configuration/\#bypass_embedding_and_retrieval "Direct link to bypass_embedding_and_retrieval")

- Type: `bool`
- Default: `False`
- Description: Bypasses the embedding and retrieval process.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_FULL_CONTEXT` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_full_context "Direct link to rag_full_context")

- Type: `bool`
- Default: `False`
- Description: Specifies whether to use the full context for RAG.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `RAG_SYSTEM_CONTEXT` [​](https://docs.openwebui.com/reference/env-configuration/\#rag_system_context "Direct link to rag_system_context")

- Type: `bool`
- Default: `False`
- Description: When enabled, injects RAG context into the **system message** instead of the user message. For models that support **KV prefix caching** or **Prompt Caching** (local engines like Ollama, llama.cpp or vLLM, and cloud providers like OpenAI and Vertex AI), this keeps the context at a stable position at the start of the conversation, so the cache can persist across turns. When disabled (default), context is injected into the user message, which shifts position each turn and invalidates the cache.

#### `ENABLE_RAG_LOCAL_WEB_FETCH` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_rag_local_web_fetch "Direct link to enable_rag_local_web_fetch")

- Type: `bool`
- Default: `False`
- Description: Controls whether outbound fetches can access URLs that resolve to private/local network IP addresses. It started as a RAG web-fetch guard, but the same SSRF gate now also covers other caller-influenced fetch surfaces, including user and automation **webhooks**, retrieval, remote image loading and OAuth profile-picture fetches.
- Persistence: This environment variable is a `ConfigVar` variable.

When disabled (default), Open WebUI blocks web fetch requests to URLs that resolve to private IP addresses, including:

- IPv4 private ranges (`10.x.x.x`, `172.16.x.x`-`172.31.x.x`, `192.168.x.x`, `127.x.x.x`)
- IPv6 private ranges

This is a **Server-Side Request Forgery (SSRF) protection**. Without this safeguard, a malicious user could provide URLs that appear external but resolve to internal addresses, potentially exposing internal services, cloud metadata endpoints, or other sensitive resources.

warning

Only enable this setting if you need to fetch content from internal network resources (e.g., an internal wiki or intranet) **and** you trust all users with access to your Open WebUI instance. Enabling this in a multi-tenant or public-facing deployment introduces significant security risk.

### Google Drive [​](https://docs.openwebui.com/reference/env-configuration/\#google-drive "Direct link to Google Drive")

#### `ENABLE_GOOGLE_DRIVE_INTEGRATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_google_drive_integration "Direct link to enable_google_drive_integration")

- Type: `bool`
- Default: `False`
- Description: Enables or disables Google Drive integration. If set to true, and `GOOGLE_DRIVE_CLIENT_ID` & `GOOGLE_DRIVE_API_KEY` are both configured, Google Drive will appear as an upload option in the chat UI.
- Persistence: This environment variable is a `ConfigVar` variable.

info

When enabling `GOOGLE_DRIVE_INTEGRATION`, ensure that you have configured `GOOGLE_DRIVE_CLIENT_ID` and `GOOGLE_DRIVE_API_KEY` correctly, and have reviewed Google's terms of service and usage guidelines.

#### `GOOGLE_DRIVE_CLIENT_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#google_drive_client_id "Direct link to google_drive_client_id")

- Type: `str`
- Description: Sets the client ID for Google Drive (client must be configured with Drive API and Picker API enabled).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `GOOGLE_DRIVE_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#google_drive_api_key "Direct link to google_drive_api_key")

- Type: `str`
- Description: Sets the API key for Google Drive integration.
- Persistence: This environment variable is a `ConfigVar` variable.

### OneDrive [​](https://docs.openwebui.com/reference/env-configuration/\#onedrive "Direct link to OneDrive")

info

For a step-by-step setup guide, check out our tutorial: [Configuring OneDrive & SharePoint Integration](https://docs.openwebui.com/tutorials/integrations/onedrive-sharepoint/).

#### `ENABLE_ONEDRIVE_INTEGRATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_onedrive_integration "Direct link to enable_onedrive_integration")

- Type: `bool`
- Default: `False`
- Description: Enables or disables the Microsoft OneDrive integration feature globally.
- Persistence: This environment variable is a `ConfigVar` variable.

warning

Configuring OneDrive integration is a multi-step process that requires creating and correctly configuring an Azure App Registration.
The authentication flow also depends on a browser pop-up window. Please ensure that your browser's pop-up blocker is disabled for your Open WebUI domain to allow the authentication and file selection window to appear.

#### `ENABLE_ONEDRIVE_PERSONAL` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_onedrive_personal "Direct link to enable_onedrive_personal")

- Type: `bool`
- Default: `True`
- Description: Controls whether the "Personal OneDrive" option appears in the attachment menu. The option is only shown when `ONEDRIVE_CLIENT_ID_PERSONAL` (or the legacy `ONEDRIVE_CLIENT_ID`) is configured. Without a client ID, the option stays hidden even if this variable is `True`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_ONEDRIVE_BUSINESS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_onedrive_business "Direct link to enable_onedrive_business")

- Type: `bool`
- Default: `True`
- Description: Controls whether the "Work/School OneDrive" option appears in the attachment menu. The option is only shown when `ONEDRIVE_CLIENT_ID_BUSINESS` (or the legacy `ONEDRIVE_CLIENT_ID`) is configured. Without a client ID, the option stays hidden even if this variable is `True`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ONEDRIVE_CLIENT_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#onedrive_client_id "Direct link to onedrive_client_id")

- Type: `str`
- Default: `None`
- Description: Generic environment variable for the OneDrive Client ID. You should rather use the specific `ONEDRIVE_CLIENT_ID_PERSONAL` or `ONEDRIVE_CLIENT_ID_BUSINESS` variables. This exists as a legacy option for backwards compatibility.

#### `ONEDRIVE_CLIENT_ID_PERSONAL` [​](https://docs.openwebui.com/reference/env-configuration/\#onedrive_client_id_personal "Direct link to onedrive_client_id_personal")

- Type: `str`
- Default: `None`
- Description: Specifies the Application (client) ID for the **Personal OneDrive** integration. This requires a separate Azure App Registration configured to support personal Microsoft accounts. **Do not put the business OneDrive client ID here!**

#### `ONEDRIVE_CLIENT_ID_BUSINESS` [​](https://docs.openwebui.com/reference/env-configuration/\#onedrive_client_id_business "Direct link to onedrive_client_id_business")

- Type: `str`
- Default: `None`
- Description: Specifies the Application (client) ID for the **Work/School (Business) OneDrive** integration. This requires a separate Azure App Registration configured to support personal Microsoft accounts. **Do not put the personal OneDrive client ID here!**

info

This Client ID (also known as Application ID) is obtained from an Azure App Registration within your Microsoft Entra ID (formerly Azure AD) tenant.
When configuring the App Registration in Azure, the Redirect URI must be set to the URL of your Open WebUI instance and configured as a **Single-page application (SPA)** type for the authentication to succeed.

#### `ONEDRIVE_SHAREPOINT_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#onedrive_sharepoint_url "Direct link to onedrive_sharepoint_url")

- Type: `str`
- Default: `None`
- Description: Specifies the root SharePoint site URL for the work/school integration, e.g., `https://companyname.sharepoint.com`.
- Persistence: This environment variable is a `ConfigVar` variable.

info

This variable is essential for the work/school integration. It should point to the root SharePoint site associated with your tenant, enabling access to SharePoint document libraries.

#### `ONEDRIVE_SHAREPOINT_TENANT_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#onedrive_sharepoint_tenant_id "Direct link to onedrive_sharepoint_tenant_id")

- Type: `str`
- Default: `None`
- Description: Specifies the Directory (tenant) ID for the work/school integration. This is obtained from your business-focused Azure App Registration.
- Persistence: This environment variable is a `ConfigVar` variable.

info

This Tenant ID (also known as Directory ID) is required for the work/school integration. You can find this value on the main overview page of your Azure App Registration in the Microsoft Entra ID portal.

## Web Search [​](https://docs.openwebui.com/reference/env-configuration/\#web-search "Direct link to Web Search")

#### `ENABLE_WEB_SEARCH` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_web_search "Direct link to enable_web_search")

- Type: `bool`
- Default: `False`
- Description: Enable web search toggle.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_SEARCH_QUERY_GENERATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_search_query_generation "Direct link to enable_search_query_generation")

- Type: `bool`
- Default: `True`
- Description: Only applies to Default Function Calling mode, which is legacy and no longer supported. If True: an LLM generates optimized, distilled search queries from the conversation context. If False: the user's last message is used verbatim as the web search query. Native Mode (the supported mode) uses the model's own `search_web` tool call and does not consult this setting.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WEB_SEARCH_TRUST_ENV` [​](https://docs.openwebui.com/reference/env-configuration/\#web_search_trust_env "Direct link to web_search_trust_env")

- Type: `bool`
- Default: `True`
- Description: Routes the web-page content fetcher (the stage that scrapes result pages after a web search, and the general website/URL loader) through the proxy defined by the http\_proxy / https\_proxy environment variables, also honoring no\_proxy and .netrc. Needed because the default fetcher uses aiohttp, which, unlike requests, ignores these proxy variables unless told to trust the environment. This does not affect the search-engine query request itself (that already respects proxy env vars), and it never overrides an explicitly configured proxy; for the Firecrawl/Tavily/Playwright loaders it only acts as a fallback when no proxy is otherwise set.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WEB_FETCH_FILTER_LIST` [​](https://docs.openwebui.com/reference/env-configuration/\#web_fetch_filter_list "Direct link to web_fetch_filter_list")

- Type: `string` (comma-separated list)
- Default: `""` (empty, but default blocklist is always applied)
- Description: Configures additional URL filtering rules for web fetch operations to prevent Server-Side Request Forgery (SSRF) attacks. The system includes a default blocklist that protects against access to cloud metadata endpoints (AWS, Google Cloud, Azure, Alibaba Cloud). Entries without a ! prefix are treated as an allow list (only these domains are permitted), while entries with a ! prefix are added to the block list (these domains are always denied). The default blocklist includes !169.254.169.254, !fd00:ec2::254, !metadata.google.internal, !metadata.azure.com, and !100.100.100.200. Custom entries are merged with the default blocklist.

info

Example:

Block additional domains: WEB\_FETCH\_FILTER\_LIST="!internal.company.com,!192.168.1.1"
Allow only specific domains: WEB\_FETCH\_FILTER\_LIST="example.com,trusted-site.org"

#### `WEB_SEARCH_DOMAIN_FILTER_LIST` [​](https://docs.openwebui.com/reference/env-configuration/\#web_search_domain_filter_list "Direct link to web_search_domain_filter_list")

- Type: `list` of `str`
- Default: `[]`
- Description: Comma-separated list of domains to filter web search results. Domains prefixed with `!` are blocked; domains without prefix create an allowlist (only those domains permitted).
- Example: `wikipedia.org,github.com,!malicious-site.com`
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WEB_SEARCH_RESULT_COUNT` [​](https://docs.openwebui.com/reference/env-configuration/\#web_search_result_count "Direct link to web_search_result_count")

- Type: `int`
- Default: `3`
- Description: Maximum number of web search results to crawl. In Native/Agentic tool calling, this is also the default `search_web` result count when the model omits `count`, and the maximum cap when the model provides `count`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WEB_SEARCH_CONCURRENT_REQUESTS` [​](https://docs.openwebui.com/reference/env-configuration/\#web_search_concurrent_requests "Direct link to web_search_concurrent_requests")

- Type: `int`
- Default: `0`
- Description: Limits the number of concurrent search requests to the search engine provider. Set to `0` for unlimited concurrency (default). Set to `1` for sequential execution to prevent rate limiting errors (e.g., Brave Free Tier).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WEB_FETCH_MAX_CONTENT_LENGTH` [​](https://docs.openwebui.com/reference/env-configuration/\#web_fetch_max_content_length "Direct link to web_fetch_max_content_length")

- Type: `int`
- Default: None (no limit)
- Description: Maximum number of characters to return from fetched URLs. When set, content exceeding this limit is truncated. Previously hardcoded at 50,000 characters. Leave empty or unset to return full content without truncation. Useful for controlling context window usage with large web pages.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WEB_LOADER_CONCURRENT_REQUESTS` [​](https://docs.openwebui.com/reference/env-configuration/\#web_loader_concurrent_requests "Direct link to web_loader_concurrent_requests")

- Type: `int`
- Default: `10`
- Description: Specifies the number of concurrent requests used by the web loader to fetch content from web pages returned by search results. This directly impacts how many pages can be crawled simultaneously.
- Persistence: This environment variable is a `ConfigVar` variable.

info

"WEB\_LOADER\_CONCURRENT\_REQUESTS" was previously named "WEB\_SEARCH\_CONCURRENT\_REQUESTS". The variable "WEB\_SEARCH\_CONCURRENT\_REQUESTS" has been repurposed to control the concurrency of the search engine requests (see above). To control the web _loader_ concurrency (fetching content from results), you MUST use "WEB\_LOADER\_CONCURRENT\_REQUESTS".

#### `WEB_SEARCH_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#web_search_engine "Direct link to web_search_engine")

- Type: `str`
- Options:
  - `searxng`: Uses the [SearXNG](https://github.com/searxng/searxng) search engine.
  - `google_pse`: Uses the [Google Programmable Search Engine](https://programmablesearchengine.google.com/about/).
  - `brave`: Uses the [Brave search engine](https://brave.com/search/api/).
  - `brave_llm_context`: Uses Brave's [LLM Context API](https://brave.com/search/api/) endpoint (`/res/v1/llm/context`). Returns pre-extracted, relevance-scored page passages instead of short snippets, so Open WebUI skips the post-search scraping step. Same API key and rate limits as `brave`.
  - `kagi`: Uses the [Kagi](https://www.kagi.com/) search engine.
  - `mojeek`: Uses the [Mojeek](https://www.mojeek.com/) search engine.
  - `bocha`: Uses the Bocha search engine.
  - `serpstack`: Uses the [Serpstack](https://serpstack.com/) search engine.
  - `serper`: Uses the [Serper](https://serper.dev/) search engine.
  - `serply`: Uses the [Serply](https://serply.io/) search engine.
  - `searchapi`: Uses the [SearchAPI](https://www.searchapi.io/) search engine.
  - `serpapi`: Uses the [SerpApi](https://serpapi.com/) search engine.
  - `duckduckgo`: Uses the [DuckDuckGo](https://duckduckgo.com/) search engine.
  - `tavily`: Uses the [Tavily](https://tavily.com/) search engine.
  - `linkup`: Uses the [Linkup](https://www.linkup.so/) search API. Requires `LINKUP_API_KEY`; tunable via `LINKUP_SEARCH_PARAMS` (search depth, output type).
  - `jina`: Uses the [Jina](https://jina.ai/) search engine.
  - `bing`: Uses the [Bing](https://www.bing.com/) search engine.
  - `exa`: Uses the [Exa](https://exa.ai/) search engine.
  - `perplexity`: Uses the [Perplexity API](https://www.perplexity.ai/) to access perplexity's AI models. Calls their AI models, which execute a search and also return a full response.
  - `serphouse`: Uses the [SERPHouse](https://www.serphouse.com/) search API. Requires `SERPHOUSE_API_KEY`; `SERPHOUSE_DOMAIN` picks the Google domain (default `google.com`).
  - `microsoft_web_iq`: Uses the **Microsoft Web IQ** search API. Requires `MICROSOFT_WEB_IQ_API_KEY`; `MICROSOFT_WEB_IQ_API_BASE_URL` and `MICROSOFT_WEB_IQ_LANGUAGE` are configurable.
  - `perplexity_search`: Uses the [Perplexity Search API](https://www.perplexity.ai/) search engine. In contrast to the `perplexity` option, this uses Perplexity's web search API for searching the web and retrieving results.
  - `sougou`: Uses the [Sougou](https://www.sogou.com/) search engine.
  - `ollama_cloud`: Uses the [Ollama Cloud](https://ollama.com/blog/web-search) search engine.
  - `azure_ai_search`
  - `yacy`
  - `yandex`: Uses the [Yandex Search API](https://yandex.cloud/en/docs/search-api/api-ref/WebSearch/search).
  - `youcom`: Uses the [You.com](https://you.com/) YDC Index API for web search.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `DDGS_BACKEND` [​](https://docs.openwebui.com/reference/env-configuration/\#ddgs_backend "Direct link to ddgs_backend")

- Type: `str`
- Default: `auto`
- Options: `auto` (Random), `bing`, `brave`, `duckduckgo`, `google`, `grokipedia`, `mojeek`, `wikipedia`, `yahoo`, `yandex`.
- Description: Specifies the backend to be used by the DDGS engine.
- Persistence: This environment variable is a `ConfigVar` variable. It can be configured in the **Admin Panel > Settings > Web Search > DDGS Backend** when DDGS is selected as the search engine.

#### `BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL` [​](https://docs.openwebui.com/reference/env-configuration/\#bypass_web_search_embedding_and_retrieval "Direct link to bypass_web_search_embedding_and_retrieval")

- Type: `bool`
- Default: `False`
- Description: Bypasses the web search embedding and retrieval process.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `BYPASS_WEB_SEARCH_WEB_LOADER` [​](https://docs.openwebui.com/reference/env-configuration/\#bypass_web_search_web_loader "Direct link to bypass_web_search_web_loader")

- Type: `bool`
- Default: `False`
- Description: Bypasses the web loader when performing web search. When enabled, only snippets from the search engine are used, and the full page content is not fetched.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SEARXNG_QUERY_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#searxng_query_url "Direct link to searxng_query_url")

- Type: `str`
- Description: The [SearXNG search API](https://docs.searxng.org/dev/search_api.html) URL supporting JSON output. `<query>` is replaced with
the search query. Example: `http://searxng.local/search?q=<query>`
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SEARXNG_LANGUAGE` [​](https://docs.openwebui.com/reference/env-configuration/\#searxng_language "Direct link to searxng_language")

- Type: `str`
- Default: `all`
- Description: This variable is used in the request to searxng as the "search language" (arguement "language").
- Persistence: This environment variable is a `ConfigVar` variable.

#### `GOOGLE_PSE_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#google_pse_api_key "Direct link to google_pse_api_key")

- Type: `str`
- Description: Sets the API key for the Google Programmable Search Engine (PSE) service.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `GOOGLE_PSE_ENGINE_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#google_pse_engine_id "Direct link to google_pse_engine_id")

- Type: `str`
- Description: The engine ID for the Google Programmable Search Engine (PSE) service.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `BRAVE_SEARCH_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#brave_search_api_key "Direct link to brave_search_api_key")

- Type: `str`
- Description: Sets the API key for the Brave Search API. Used by both the `brave` and `brave_llm_context` engines.
- Persistence: This environment variable is a `ConfigVar` variable.

info

Brave's free tier enforces a rate limit of 1 request per second. Open WebUI automatically retries requests that receive HTTP 429 rate limit errors after a 1-second delay. For free tier users, set `WEB_SEARCH_CONCURRENT_REQUESTS` to `1` to ensure sequential request processing. See the [Brave web search documentation](https://docs.openwebui.com/features/chat-conversations/web-search/providers/brave) for more details.

#### `BRAVE_SEARCH_CONTEXT_TOKENS` [​](https://docs.openwebui.com/reference/env-configuration/\#brave_search_context_tokens "Direct link to brave_search_context_tokens")

- Type: `int`
- Default: `8192`
- Description: Maximum total tokens to retrieve per query when `WEB_SEARCH_ENGINE=brave_llm_context`. Sent to Brave's LLM Context API as `maximum_number_of_tokens`. Valid range is `1024` to `32768`. Higher values pull richer extracted passages at the cost of API quota; lower values keep responses lean. Configurable via **Admin Panel → Settings → Web Search → Context Tokens** (only shown when the `brave_llm_context` engine is selected).
- Persistence: This environment variable is a `ConfigVar` variable. Stored at config key `rag.web.search.brave_search_context_tokens`.

#### `KAGI_SEARCH_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#kagi_search_api_key "Direct link to kagi_search_api_key")

- Type: `str`
- Description: Sets the API key for Kagi Search API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MOJEEK_SEARCH_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#mojeek_search_api_key "Direct link to mojeek_search_api_key")

- Type: `str`
- Description: Sets the API key for Mojeek Search API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SERPSTACK_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#serpstack_api_key "Direct link to serpstack_api_key")

- Type: `str`
- Description: Sets the API key for Serpstack search API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SERPSTACK_HTTPS` [​](https://docs.openwebui.com/reference/env-configuration/\#serpstack_https "Direct link to serpstack_https")

- Type: `bool`
- Default: `True`
- Description: Configures the use of HTTPS for Serpstack requests. Free tier requests are restricted to HTTP only.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SERPER_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#serper_api_key "Direct link to serper_api_key")

- Type: `str`
- Description: Sets the API key for Serper search API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SERPLY_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#serply_api_key "Direct link to serply_api_key")

- Type: `str`
- Description: Sets the API key for Serply search API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SEARCHAPI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#searchapi_api_key "Direct link to searchapi_api_key")

- Type: `str`
- Description: Sets the API key for SearchAPI.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SEARCHAPI_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#searchapi_engine "Direct link to searchapi_engine")

- Type: `str`
- Description: Sets the SearchAPI engine.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `TAVILY_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#tavily_api_key "Direct link to tavily_api_key")

- Type: `str`
- Description: Sets the API key for Tavily search API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LINKUP_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#linkup_api_key "Direct link to linkup_api_key")

- Type: `str`
- Default: `''`
- Description: Sets the API key for the [Linkup](https://www.linkup.so/) search API. Required when `WEB_SEARCH_ENGINE=linkup`.
- Persistence: This environment variable is a `ConfigVar` variable. Stored at config key `rag.web.search.linkup_api_key`.

#### `LINKUP_SEARCH_PARAMS` [​](https://docs.openwebui.com/reference/env-configuration/\#linkup_search_params "Direct link to linkup_search_params")

- Type: `str` (JSON object)
- Default: `''` (parsed to `{}`; effective defaults are `{"url": "https://api.linkup.so/v1/search", "depth": "standard", "outputType": "sourcedAnswer"}`)
- Description: Optional JSON object merged over the Linkup request defaults. Recognized keys include `depth` (`standard` or `deep`), `outputType` (`sourcedAnswer` or `searchResults`), and `url` (overrides the API endpoint). `q` (the query) and `maxResults` are injected automatically and cannot be overridden. Invalid JSON falls back to `{}`. Configurable via **Admin Panel → Settings → Web Search** when the `linkup` engine is selected.
- Persistence: This environment variable is a `ConfigVar` variable. Stored at config key `rag.web.search.linkup_search_params`.

#### `JINA_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#jina_api_key "Direct link to jina_api_key")

- Type: `str`
- Description: Sets the API key for Jina.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `JINA_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#jina_api_base_url "Direct link to jina_api_base_url")

- Type: `str`
- Default: `https://s.jina.ai/`
- Description: Sets the Base URL for Jina Search API. Useful for specifying custom or regional endpoints (e.g., `https://eu-s-beta.jina.ai/`).
- Persistence: This environment variable is a `ConfigVar` variable. It can be configured in the **Admin Panel > Settings > Web Search > Jina API Base URL**.

#### `BING_SEARCH_V7_ENDPOINT` [​](https://docs.openwebui.com/reference/env-configuration/\#bing_search_v7_endpoint "Direct link to bing_search_v7_endpoint")

- Type: `str`
- Description: Sets the endpoint for Bing Search API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `BING_SEARCH_V7_SUBSCRIPTION_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#bing_search_v7_subscription_key "Direct link to bing_search_v7_subscription_key")

- Type: `str`
- Default: `https://api.bing.microsoft.com/v7.0/search`
- Description: Sets the subscription key for Bing Search API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `BOCHA_SEARCH_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#bocha_search_api_key "Direct link to bocha_search_api_key")

- Type: `str`
- Default: `None`
- Description: Sets the API key for Bocha Search API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `EXA_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#exa_api_key "Direct link to exa_api_key")

- Type: `str`
- Default: `None`
- Description: Sets the API key for Exa search API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SERPAPI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#serpapi_api_key "Direct link to serpapi_api_key")

- Type: `str`
- Default: `None`
- Description: Sets the API key for SerpAPI.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SERPAPI_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#serpapi_engine "Direct link to serpapi_engine")

- Type: `str`
- Default: `None`
- Description: Specifies the search engine to use for SerpAPI.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AZURE_AI_SEARCH_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#azure_ai_search_api_key "Direct link to azure_ai_search_api_key")

- Type: `str`
- Default: `None`
- Description: API key (query key or admin key) for authenticating with Azure AI Search service. Required for using Azure AI Search as a web search provider.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AZURE_AI_SEARCH_ENDPOINT` [​](https://docs.openwebui.com/reference/env-configuration/\#azure_ai_search_endpoint "Direct link to azure_ai_search_endpoint")

- Type: `str`
- Default: `None`
- Description: Azure Search service endpoint URL. Specifies which Azure Search service instance to connect to.
- Example: `https://myservice.search.windows.net`, `https://company-search.search.windows.net`
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AZURE_AI_SEARCH_INDEX_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#azure_ai_search_index_name "Direct link to azure_ai_search_index_name")

- Type: `str`
- Default: `None`
- Description: Name of the search index to query within your Azure Search service. Different indexes can contain different types of searchable content.
- Example: `my-search-index`, `documents-index`, `knowledge-base`
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SOUGOU_API_SID` [​](https://docs.openwebui.com/reference/env-configuration/\#sougou_api_sid "Direct link to sougou_api_sid")

- Type: `str`
- Default: `None`
- Description: Sets the Sogou API SID.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SOUGOU_API_SK` [​](https://docs.openwebui.com/reference/env-configuration/\#sougou_api_sk "Direct link to sougou_api_sk")

- Type: `str`
- Default: `None`
- Description: Sets the Sogou API SK.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OLLAMA_CLOUD_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#ollama_cloud_api_key "Direct link to ollama_cloud_api_key")

- Type: `str`
- Default: `None`
- Description: Sets your Ollama Cloud API key. It is currently used to authenticate the Ollama Cloud web search provider (the search service hosted at `ollama.com`).
- Persistence: This environment variable is a `ConfigVar` variable.

Environment variable name vs. config field name

The setting is named **Ollama Cloud Web Search API Key** in the admin UI, and the config API and persisted value use the key `OLLAMA_CLOUD_WEB_SEARCH_API_KEY` (`rag.web.search.ollama_cloud_api_key`). The environment variable that seeds it on startup is `OLLAMA_CLOUD_API_KEY`, not `OLLAMA_CLOUD_WEB_SEARCH_API_KEY`. Setting `OLLAMA_CLOUD_WEB_SEARCH_API_KEY` in the environment has no effect, so use `OLLAMA_CLOUD_API_KEY`.

#### `TAVILY_EXTRACT_DEPTH` [​](https://docs.openwebui.com/reference/env-configuration/\#tavily_extract_depth "Direct link to tavily_extract_depth")

- Type: `str`
- Default: `basic`
- Description: Specifies the extract depth for Tavily search results.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `YACY_QUERY_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#yacy_query_url "Direct link to yacy_query_url")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the query URL for YaCy search engine integration. Should point to a YaCy instance's search API endpoint.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `YACY_USERNAME` [​](https://docs.openwebui.com/reference/env-configuration/\#yacy_username "Direct link to yacy_username")

- Type: `str`
- Default: Empty string (' ')
- Description: Specifies the username for authenticated access to YaCy search engine.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `YACY_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#yacy_password "Direct link to yacy_password")

- Type: `str`
- Default: Empty string (' ')
- Description: Specifies the password for authenticated access to YaCy search engine.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `EXTERNAL_WEB_SEARCH_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#external_web_search_url "Direct link to external_web_search_url")

- Type: `str`
- Default: Empty string (' ')
- Description: Specifies the URL of an external web search service API endpoint for custom search integrations.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `EXTERNAL_WEB_SEARCH_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#external_web_search_api_key "Direct link to external_web_search_api_key")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the API key for authenticating with the external web search service.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `EXTERNAL_WEB_LOADER_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#external_web_loader_url "Direct link to external_web_loader_url")

- Type: `str`
- Default: Empty string (' ')
- Description: Specifies the URL of an external web content loader service for fetching and processing web pages.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `EXTERNAL_WEB_LOADER_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#external_web_loader_api_key "Direct link to external_web_loader_api_key")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the API key for authenticating with the external web loader service.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `YANDEX_WEB_SEARCH_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#yandex_web_search_url "Direct link to yandex_web_search_url")

- Type: `str`
- Default: `https://searchapi.api.cloud.yandex.net/v2/web/search`
- Description: Specifies the URL of the Yandex Web Search service API endpoint.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `YANDEX_WEB_SEARCH_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#yandex_web_search_api_key "Direct link to yandex_web_search_api_key")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the API key for authenticating with the Yandex Web Search service.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `YANDEX_WEB_SEARCH_CONFIG` [​](https://docs.openwebui.com/reference/env-configuration/\#yandex_web_search_config "Direct link to yandex_web_search_config")

- Type: `str`
- Default: Empty string (' ')
- Description: Optional JSON configuration string for Yandex Web Search. Can be used to set parameters like `searchType` or `region` as per the Yandex API documentation.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `PERPLEXITY_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#perplexity_api_key "Direct link to perplexity_api_key")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the API key for Perplexity API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `PERPLEXITY_SEARCH_API_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#perplexity_search_api_url "Direct link to perplexity_search_api_url")

- Type: `str`
- Default: `https://api.perplexity.ai/search`
- Description: Configures the API endpoint for Perplexity Search. Allows using custom or self-hosted Perplexity-compatible API endpoints (such as LiteLLM's `/search` endpoint) instead of the hardcoded default for the official Perplexity API. This enables flexibility in routing search requests to alternative providers or internal proxies. **Note: If using LiteLLM, append the specific provider name to the URL path.**
- Example: `http://my-litellm-server.com/search/perplexity-search`
- Persistence: This environment variable is a `ConfigVar` variable.

#### `PERPLEXITY_MODEL` [​](https://docs.openwebui.com/reference/env-configuration/\#perplexity_model "Direct link to perplexity_model")

- Type: `str`
- Default: `sonar`
- Description: Specifies the Perplexity AI model to use for search queries when using `Perplexity` as the web search engine.
- Persistence: This environment variable is a `ConfigVar` variable.

info

`Perplexity` is different from `perplexity_search`.
If you use `perplexity_search`, this variable is not relevant to you.

#### `PERPLEXITY_SEARCH_CONTEXT_USAGE` [​](https://docs.openwebui.com/reference/env-configuration/\#perplexity_search_context_usage "Direct link to perplexity_search_context_usage")

- Type: `str`
- Default: `medium`
- Description: Controls the amount of search context used by Perplexity AI. Options typically include `low`, `medium`, `high`.
- Persistence: This environment variable is a `ConfigVar` variable.

info

`Perplexity` is different from `perplexity_search`.
If you use `perplexity`, this variable is not relevant to you.

#### `YOUCOM_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#youcom_api_key "Direct link to youcom_api_key")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the API key for [You.com](https://you.com/) YDC Index API web search. Required when `WEB_SEARCH_ENGINE` is set to `youcom`. Obtain an API key from [You.com API](https://you.com/api). Also accepts `YDC_API_KEY` as an alternative variable name; `YOUCOM_API_KEY` takes precedence if both are set.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SERPHOUSE_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#serphouse_api_key "Direct link to serphouse_api_key")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the API key for the [SERPHouse](https://www.serphouse.com/) web search engine. Required when `WEB_SEARCH_ENGINE` is set to `serphouse`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SERPHOUSE_DOMAIN` [​](https://docs.openwebui.com/reference/env-configuration/\#serphouse_domain "Direct link to serphouse_domain")

- Type: `str`
- Default: `google.com`
- Description: The Google domain SERPHouse queries against (e.g. `google.com`, `google.co.uk`). Used only when `WEB_SEARCH_ENGINE` is set to `serphouse`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MICROSOFT_WEB_IQ_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft_web_iq_api_key "Direct link to microsoft_web_iq_api_key")

- Type: `str`
- Default: Empty string (' ')
- Description: API key for the **Microsoft Web IQ** search engine. Required when `WEB_SEARCH_ENGINE` is set to `microsoft_web_iq`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MICROSOFT_WEB_IQ_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft_web_iq_api_base_url "Direct link to microsoft_web_iq_api_base_url")

- Type: `str`
- Default: `https://api.microsoft.ai/v3`
- Description: Base URL for the Microsoft Web IQ API. Used only when `WEB_SEARCH_ENGINE` is set to `microsoft_web_iq`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MICROSOFT_WEB_IQ_LANGUAGE` [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft_web_iq_language "Direct link to microsoft_web_iq_language")

- Type: `str`
- Default: `en`
- Description: Language code for Microsoft Web IQ results (e.g. `en`, `de`). Used only when `WEB_SEARCH_ENGINE` is set to `microsoft_web_iq`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_WEB_SEARCH_CONFIRMATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_web_search_confirmation "Direct link to enable_web_search_confirmation")

- Type: `bool`
- Default: `False`
- Description: When enabled, the user is shown a confirmation prompt before a web search runs, so a query is not sent to the external provider without consent. The prompt text is set by `WEB_SEARCH_CONFIRMATION_CONTENT`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WEB_SEARCH_CONFIRMATION_CONTENT` [​](https://docs.openwebui.com/reference/env-configuration/\#web_search_confirmation_content "Direct link to web_search_confirmation_content")

- Type: `str`
- Default: `Your query will be sent to the configured web search provider.`
- Description: The message shown in the web-search confirmation prompt when `ENABLE_WEB_SEARCH_CONFIRMATION` is `True`.
- Persistence: This environment variable is a `ConfigVar` variable.

### Web Loader Configuration [​](https://docs.openwebui.com/reference/env-configuration/\#web-loader-configuration "Direct link to Web Loader Configuration")

#### `WEB_LOADER_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#web_loader_engine "Direct link to web_loader_engine")

- Type: `str`
- Default: `(empty)`
- Description: Specifies the loader to use for retrieving and processing web content.
- Options:
  - `safe_web` (default): Uses internal fetching with enhanced error handling.
  - `playwright`: Uses Playwright for rendering pages with JavaScript support.
  - `firecrawl`: Uses Firecrawl service.
  - `tavily`: Uses Tavily service.
  - `external`: Uses an external web loader API.
- Persistence: This environment variable is a `ConfigVar` variable.

info

When using `playwright`, you have two options:

1. If `PLAYWRIGHT_WS_URI` is not set, Playwright with Chromium dependencies will be automatically installed in the Open WebUI container on launch.
2. If `PLAYWRIGHT_WS_URI` is set, Open WebUI will connect to a remote browser instance instead of installing dependencies locally.

#### `PLAYWRIGHT_WS_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#playwright_ws_url "Direct link to playwright_ws_url")

- Type: `str`
- Default: `None`
- Description: Specifies the WebSocket URI of a remote Playwright browser instance. When set, Open WebUI will use this remote browser instead of installing browser dependencies locally. This is particularly useful in containerized environments where you want to keep the Open WebUI container lightweight and separate browser concerns. Example: `ws://playwright:3000`
- Persistence: This environment variable is a `ConfigVar` variable.

tip

Using a remote Playwright browser via `PLAYWRIGHT_WS_URL` can be beneficial for:

- Reducing the size of the Open WebUI container
- Using a different browser other than the default Chromium
- Connecting to a non-headless (GUI) browser

#### `FIRECRAWL_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#firecrawl_api_base_url "Direct link to firecrawl_api_base_url")

- Type: `str`
- Default: `https://api.firecrawl.dev`
- Description: Sets the base URL for Firecrawl API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `FIRECRAWL_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#firecrawl_api_key "Direct link to firecrawl_api_key")

- Type: `str`
- Default: `None`
- Description: Sets the API key for Firecrawl API.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `FIRECRAWL_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#firecrawl_timeout "Direct link to firecrawl_timeout")

- Type: `int`
- Default: `None`
- Description: Specifies the timeout in milliseconds for Firecrawl requests. If not set, the default Firecrawl timeout is used.
- Persistence: This environment variable is a `ConfigVar` variable. It can be configured in the **Admin Panel > Settings > Web Search > Firecrawl Timeout**.

#### `PLAYWRIGHT_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#playwright_timeout "Direct link to playwright_timeout")

- Type: `int`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the timeout for Playwright requests.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WEB_LOADER_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#web_loader_timeout "Direct link to web_loader_timeout")

- Type: `float`
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the request timeout in seconds for the SafeWebBaseLoader when scraping web pages. Without this setting, web scraping operations can hang indefinitely on slow or unresponsive pages. Recommended values are 10 to 30 seconds depending on your network conditions.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WEB_FETCH_MAX_CONTENT_LENGTH` [​](https://docs.openwebui.com/reference/env-configuration/\#web_fetch_max_content_length-1 "Direct link to web_fetch_max_content_length-1")

- Type: `int`
- Default: unset (no limit)
- Description: Caps the number of characters kept from a fetched web page (e.g. the `fetch_url` tool / URL content retrieval). Content beyond the limit is truncated, preventing one very large page from flooding the context. Leave unset for no limit.
- Persistence: This environment variable is a `ConfigVar` variable.

warning

This **timeout only applies when `WEB_LOADER_ENGINE` is set to `safe_web`** or left empty (the default). It has no effect on Playwright or Firecrawl loader engines, which have their own timeout configurations (`PLAYWRIGHT_TIMEOUT` and Firecrawl's internal settings respectively).

### YouTube Loader [​](https://docs.openwebui.com/reference/env-configuration/\#youtube-loader "Direct link to YouTube Loader")

#### `YOUTUBE_LOADER_PROXY_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#youtube_loader_proxy_url "Direct link to youtube_loader_proxy_url")

- Type: `str`
- Description: Sets the proxy URL for YouTube loader.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `YOUTUBE_LOADER_LANGUAGE` [​](https://docs.openwebui.com/reference/env-configuration/\#youtube_loader_language "Direct link to youtube_loader_language")

- Type: `str`
- Default: `en`
- Description: Comma-separated list of language codes to try when fetching YouTube video transcriptions, in priority order.
- Example: If set to `es,de`, Spanish transcriptions will be attempted first, then German if Spanish was not available, and lastly English.

note

Note: If none of the specified languages are available and `en` was not in your list, the system will automatically try English as a final fallback.

- Persistence: This environment variable is a `ConfigVar` variable.

## Audio [​](https://docs.openwebui.com/reference/env-configuration/\#audio "Direct link to Audio")

#### `BYPASS_PYDUB_PREPROCESSING` [​](https://docs.openwebui.com/reference/env-configuration/\#bypass_pydub_preprocessing "Direct link to bypass_pydub_preprocessing")

- Type: `bool`
- Default: `False`
- Description: When enabled, skips pydub-based preprocessing (format conversion to MP3, compression, and chunked splitting by size) before audio is sent to the Speech-to-Text engine. Useful when the upstream provider already handles these steps, when ffmpeg is unavailable on the host, or when you want to pass audio through untouched. Applies to all STT engines.

### Whisper Speech-to-Text (Local) [​](https://docs.openwebui.com/reference/env-configuration/\#whisper-speech-to-text-local "Direct link to Whisper Speech-to-Text (Local)")

#### `WHISPER_MODEL` [​](https://docs.openwebui.com/reference/env-configuration/\#whisper_model "Direct link to whisper_model")

- Type: `str`
- Default: `base`
- Description: Sets the Whisper model to use for Speech-to-Text. The backend used is faster\_whisper with quantization to `int8`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `WHISPER_MODEL_DIR` [​](https://docs.openwebui.com/reference/env-configuration/\#whisper_model_dir "Direct link to whisper_model_dir")

- Type: `str`
- Default: `${DATA_DIR}/cache/whisper/models`
- Description: Specifies the directory to store Whisper model files.

#### `WHISPER_COMPUTE_TYPE` [​](https://docs.openwebui.com/reference/env-configuration/\#whisper_compute_type "Direct link to whisper_compute_type")

- Type: `str`
- Default: `int8` (CPU), `float16` (CUDA)
- Description: Sets the compute type for Whisper model inference. Defaults to `int8` for CPU and `float16` for CUDA (with fallback to `int8/int8_float16`).

#### `WHISPER_VAD_FILTER` [​](https://docs.openwebui.com/reference/env-configuration/\#whisper_vad_filter "Direct link to whisper_vad_filter")

- Type: `bool`
- Default: `False`
- Description: Specifies whether to apply a Voice Activity Detection (VAD) filter to Whisper Speech-to-Text.

#### `WHISPER_MODEL_AUTO_UPDATE` [​](https://docs.openwebui.com/reference/env-configuration/\#whisper_model_auto_update "Direct link to whisper_model_auto_update")

- Type: `bool`
- Default: `False`
- Description: Toggles automatic update of the Whisper model.

#### `WHISPER_LANGUAGE` [​](https://docs.openwebui.com/reference/env-configuration/\#whisper_language "Direct link to whisper_language")

- Type: `str`
- Default: `None`
- Description: Specifies the ISO 639-1 language Whisper uses for STT (ISO 639-2 for Hawaiian and Cantonese). Whisper predicts the language by default.

#### `WHISPER_MULTILINGUAL` [​](https://docs.openwebui.com/reference/env-configuration/\#whisper_multilingual "Direct link to whisper_multilingual")

- Type: `bool`
- Default: `False`
- Description: Toggles whether to use the multilingual Whisper model. When set to `False`, the system will use the English-only model for better performance in English-centric tasks. When `True`, it supports multiple languages.

### Speech-to-Text (OpenAI) [​](https://docs.openwebui.com/reference/env-configuration/\#speech-to-text-openai "Direct link to Speech-to-Text (OpenAI)")

#### `AUDIO_STT_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_engine "Direct link to audio_stt_engine")

- Type: `str`
- Options:
  - `""` (empty string): Uses the built-in local Whisper engine for Speech-to-Text. This runs Whisper on the backend server.
  - `openai`: Uses an OpenAI-compatible API for Speech-to-Text.
  - `deepgram`: Uses Deepgram engine for Speech-to-Text.
  - `azure`: Uses Azure Cognitive Services for Speech-to-Text.
  - `mistral`: Uses Mistral API for Speech-to-Text.
- Description: Specifies the Speech-to-Text engine to use. When left as an empty string (the default), the backend runs a local Whisper instance. Note: The "Web API" option seen in User Settings is a frontend-only setting that uses the browser's built-in speech recognition and does not call this backend endpoint at all.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_STT_MODEL` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_model "Direct link to audio_stt_model")

- Type: `str`
- Default: `whisper-1`
- Description: Specifies the Speech-to-Text model to use for OpenAI-compatible endpoints.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_STT_OPENAI_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_openai_api_base_url "Direct link to audio_stt_openai_api_base_url")

- Type: `str`
- Default: `${OPENAI_API_BASE_URL}`
- Description: Sets the OpenAI-compatible base URL to use for Speech-to-Text.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_STT_OPENAI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_openai_api_key "Direct link to audio_stt_openai_api_key")

- Type: `str`
- Default: `${OPENAI_API_KEY}`
- Description: Sets the OpenAI API key to use for Speech-to-Text.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_STT_OPENAI_API_REQUEST_FORMAT` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_openai_api_request_format "Direct link to audio_stt_openai_api_request_format")

- Type: `str`
- Default: `multipart`
- Options: `multipart`, `json`
- Description: Controls how audio is sent to the OpenAI-compatible Speech-to-Text endpoint. `multipart` uploads the audio as a file (the standard OpenAI format); `json` sends it as base64-encoded audio in a JSON body, which some OpenAI-compatible transcription services require.
- Persistence: This environment variable is a `ConfigVar` variable.

### Speech-to-Text (Azure) [​](https://docs.openwebui.com/reference/env-configuration/\#speech-to-text-azure "Direct link to Speech-to-Text (Azure)")

#### `AUDIO_STT_AZURE_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_azure_api_key "Direct link to audio_stt_azure_api_key")

- Type: `str`
- Default: `None`
- Description: Specifies the Azure API key to use for Speech-to-Text.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_STT_AZURE_REGION` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_azure_region "Direct link to audio_stt_azure_region")

- Type: `str`
- Default: `None`
- Description: Specifies the Azure region to use for Speech-to-Text.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_STT_AZURE_LOCALES` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_azure_locales "Direct link to audio_stt_azure_locales")

- Type: `str`
- Default: `None`
- Description: Specifies the locales to use for Azure Speech-to-Text.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_STT_AZURE_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_azure_base_url "Direct link to audio_stt_azure_base_url")

- Type: `str`
- Default: `None`
- Description: Specifies a custom Azure base URL for Speech-to-Text. Use this if you have a custom Azure endpoint.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_STT_AZURE_MAX_SPEAKERS` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_azure_max_speakers "Direct link to audio_stt_azure_max_speakers")

- Type: `int`
- Default: `3`
- Description: Sets the maximum number of speakers for Azure Speech-to-Text diarization.
- Persistence: This environment variable is a `ConfigVar` variable.

### Speech-to-Text (Deepgram) [​](https://docs.openwebui.com/reference/env-configuration/\#speech-to-text-deepgram "Direct link to Speech-to-Text (Deepgram)")

#### `DEEPGRAM_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#deepgram_api_key "Direct link to deepgram_api_key")

- Type: `str`
- Default: `None`
- Description: Specifies the Deepgram API key to use for Speech-to-Text.
- Persistence: This environment variable is a `ConfigVar` variable.

### Speech-to-Text (Mistral) [​](https://docs.openwebui.com/reference/env-configuration/\#speech-to-text-mistral "Direct link to Speech-to-Text (Mistral)")

#### `AUDIO_STT_MISTRAL_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_mistral_api_key "Direct link to audio_stt_mistral_api_key")

- Type: `str`
- Default: `None`
- Description: Specifies the Mistral API key to use for Speech-to-Text.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_STT_MISTRAL_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_mistral_api_base_url "Direct link to audio_stt_mistral_api_base_url")

- Type: `str`
- Default: `https://api.mistral.ai/v1`
- Description: Specifies the Mistral API base URL to use for Speech-to-Text.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_STT_MISTRAL_USE_CHAT_COMPLETIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_mistral_use_chat_completions "Direct link to audio_stt_mistral_use_chat_completions")

- Type: `bool`
- Default: `False`
- Description: When enabled, uses the chat completions endpoint for Mistral Speech-to-Text instead of the dedicated transcription endpoint.
- Persistence: This environment variable is a `ConfigVar` variable.

### Speech-to-Text (General) [​](https://docs.openwebui.com/reference/env-configuration/\#speech-to-text-general "Direct link to Speech-to-Text (General)")

#### `AUDIO_STT_SUPPORTED_CONTENT_TYPES` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_supported_content_types "Direct link to audio_stt_supported_content_types")

- Type: `str`
- Default: `None`
- Description: Comma-separated list of supported audio MIME types for Speech-to-Text (e.g., `audio/wav,audio/mpeg,video/*`). Leave empty to use defaults.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_STT_ALLOWED_EXTENSIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_stt_allowed_extensions "Direct link to audio_stt_allowed_extensions")

- Type: `str`
- Default: `mp3,wav,m4a,webm,ogg,flac,mp4,mpga,mpeg`
- Description: Comma-separated list of audio file extensions accepted by the Speech-to-Text upload endpoint. Uploads with extensions outside this list are rejected with `400 Invalid audio file extension`. Comparison is case-insensitive. Set to an empty value to skip the extension check (MIME-type validation via `AUDIO_STT_SUPPORTED_CONTENT_TYPES` still applies). Configurable via **Admin Settings → Audio → STT**.
- Persistence: This environment variable is a `ConfigVar` variable.

### Text-to-Speech [​](https://docs.openwebui.com/reference/env-configuration/\#text-to-speech "Direct link to Text-to-Speech")

#### `AUDIO_TTS_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_api_key "Direct link to audio_tts_api_key")

- Type: `str`
- Description: Sets the API key for Text-to-Speech.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_TTS_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_engine "Direct link to audio_tts_engine")

- Type: `str`
- Options:
  - `""` (empty string): **Disables backend TTS.** When empty, TTS requests do not reach the backend. All TTS is handled client-side using the browser's Web Speech API or the user-configurable "Browser Kokoro" option in User Settings.
  - `openai`: Uses an OpenAI-compatible API for Text-to-Speech.
  - `mistral`: Uses Mistral's Text-to-Speech API.
  - `elevenlabs`: Uses ElevenLabs engine for Text-to-Speech.
  - `azure`: Uses Azure Cognitive Services for Text-to-Speech.
  - `transformers`: Uses a local SentenceTransformers-based model for Text-to-Speech (runs on the backend).
- Description: Specifies the Text-to-Speech engine to use on the backend. When left as an empty string (the default), no backend TTS service is configured, and audio playback relies entirely on the user's browser capabilities or frontend options like "Browser Kokoro".
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_TTS_MODEL` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_model "Direct link to audio_tts_model")

- Type: `str`
- Default: `tts-1`
- Description: Specifies the OpenAI text-to-speech model to use.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_TTS_VOICE` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_voice "Direct link to audio_tts_voice")

- Type: `str`
- Default: `alloy`
- Description: Sets the OpenAI text-to-speech voice to use.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_TTS_SPLIT_ON` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_split_on "Direct link to audio_tts_split_on")

- Type: `str`
- Default: `punctuation`
- Description: Sets the OpenAI text-to-speech split on to use.
- Persistence: This environment variable is a `ConfigVar` variable.

### Azure Text-to-Speech [​](https://docs.openwebui.com/reference/env-configuration/\#azure-text-to-speech "Direct link to Azure Text-to-Speech")

#### `AUDIO_TTS_AZURE_SPEECH_REGION` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_azure_speech_region "Direct link to audio_tts_azure_speech_region")

- Type: `str`
- Description: Sets the region for Azure Text to Speech.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_TTS_AZURE_SPEECH_OUTPUT_FORMAT` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_azure_speech_output_format "Direct link to audio_tts_azure_speech_output_format")

- Type: `str`
- Default: `audio-24khz-160kbitrate-mono-mp3`
- Description: Sets the output format for Azure Text to Speech.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_TTS_AZURE_SPEECH_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_azure_speech_base_url "Direct link to audio_tts_azure_speech_base_url")

- Type: `str`
- Default: `None`
- Description: Specifies a custom Azure Speech base URL for Text-to-Speech. Use this if you have a custom Azure endpoint.
- Persistence: This environment variable is a `ConfigVar` variable.

### Voice Mode [​](https://docs.openwebui.com/reference/env-configuration/\#voice-mode "Direct link to Voice Mode")

#### `ENABLE_VOICE_MODE_PROMPT` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_voice_mode_prompt "Direct link to enable_voice_mode_prompt")

- Type: `bool`
- Default: `True`
- Description: Master switch for the voice-mode system prompt. When `True`, voice-mode chats prepend either the custom `VOICE_MODE_PROMPT_TEMPLATE` (if set) or `DEFAULT_VOICE_MODE_PROMPT_TEMPLATE`. When `False`, no voice-specific system prompt is injected: the model uses only the regular system prompt and chat history. Configurable in **Admin Settings → Interface → Voice Mode Custom Prompt** (toggle).
- Persistence: This environment variable is a `ConfigVar` variable. Stored at config key `task.voice.prompt.enable`.

#### `VOICE_MODE_PROMPT_TEMPLATE` [​](https://docs.openwebui.com/reference/env-configuration/\#voice_mode_prompt_template "Direct link to voice_mode_prompt_template")

- Type: `str`
- Default: The value of `DEFAULT_VOICE_MODE_PROMPT_TEMPLATE` environment variable.
- Description: Configures a custom system prompt for voice mode interactions. Allows administrators to control how the AI responds in voice conversations (style, length, tone). Leave empty to use the default prompt optimized for voice conversations, or provide custom instructions to tailor the voice assistant's behavior. Only applied when `ENABLE_VOICE_MODE_PROMPT` is `True`.
- Persistence: This environment variable is a `ConfigVar` variable.

### OpenAI Text-to-Speech [​](https://docs.openwebui.com/reference/env-configuration/\#openai-text-to-speech "Direct link to OpenAI Text-to-Speech")

#### `AUDIO_TTS_OPENAI_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_openai_api_base_url "Direct link to audio_tts_openai_api_base_url")

- Type: `str`
- Default: `${OPENAI_API_BASE_URL}`
- Description: Sets the OpenAI-compatible base URL to use for text-to-speech.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_TTS_OPENAI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_openai_api_key "Direct link to audio_tts_openai_api_key")

- Type: `str`
- Default: `${OPENAI_API_KEY}`
- Description: Sets the API key to use for text-to-speech.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_TTS_OPENAI_PARAMS` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_openai_params "Direct link to audio_tts_openai_params")

- Type: `str` (JSON)
- Default: `{}`
- Description: Additional parameters for OpenAI-compatible TTS API in JSON format. Allows customization of API-specific settings.
- Example: `{"speed": 1.0}`
- Persistence: This environment variable is a `ConfigVar` variable.

### Mistral Text-to-Speech [​](https://docs.openwebui.com/reference/env-configuration/\#mistral-text-to-speech "Direct link to Mistral Text-to-Speech")

#### `AUDIO_TTS_MISTRAL_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_mistral_api_key "Direct link to audio_tts_mistral_api_key")

- Type: `str`
- Default: `None`
- Description: Sets the API key used for Mistral Text-to-Speech.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUDIO_TTS_MISTRAL_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#audio_tts_mistral_api_base_url "Direct link to audio_tts_mistral_api_base_url")

- Type: `str`
- Default: `https://api.mistral.ai/v1`
- Description: Sets the base URL used for Mistral Text-to-Speech.
- Persistence: This environment variable is a `ConfigVar` variable.

info

When `AUDIO_TTS_ENGINE=mistral`, Open WebUI uses `mistral-tts-latest` when `AUDIO_TTS_MODEL` is empty.

### Elevenlabs Text-to-Speech [​](https://docs.openwebui.com/reference/env-configuration/\#elevenlabs-text-to-speech "Direct link to Elevenlabs Text-to-Speech")

#### `ELEVENLABS_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#elevenlabs_api_base_url "Direct link to elevenlabs_api_base_url")

- Type: `str`
- Default: `https://api.elevenlabs.io`
- Description: Configures custom ElevenLabs API endpoints, enabling support for EU residency API requirements and other regional deployments.
- Persistence: This environment variable is a `ConfigVar` variable.

## Image Generation [​](https://docs.openwebui.com/reference/env-configuration/\#image-generation "Direct link to Image Generation")

### General Settings [​](https://docs.openwebui.com/reference/env-configuration/\#general-settings "Direct link to General Settings")

#### `ENABLE_IMAGE_GENERATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_image_generation "Direct link to enable_image_generation")

- Type: `bool`
- Default: `False`
- Description: Enables or disables image generation features.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_IMAGE_PROMPT_GENERATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_image_prompt_generation "Direct link to enable_image_prompt_generation")

- Type: `bool`
- Default: `True`
- Description: Enables or disables automatic enhancement of user prompts for better image generation results.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE` [​](https://docs.openwebui.com/reference/env-configuration/\#image_prompt_generation_prompt_template "Direct link to image_prompt_generation_prompt_template")

- Type: `str`
- Default: `None`
- Description: Specifies the template to use for generating image prompts.
- Persistence: This environment variable is a `ConfigVar` variable.

`DEFAULT_IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE`:

```text
### Task:
Generate a detailed prompt for an image generation task based on the given language and context. Describe the image as if you were explaining it to someone who cannot see it. Include relevant details, colors, shapes, and any other important elements.

### Guidelines:
- Be descriptive and detailed, focusing on the most important aspects of the image.
- Avoid making assumptions or adding information not present in the image.
- Use the chat's primary language; default to English if multilingual.
- If the image is too complex, focus on the most prominent elements.

### Output:
Strictly return in JSON format:
{
    "prompt": "Your detailed description here."
}

### Chat History:
<chat_history>
{{MESSAGES:END:6}}
</chat_history>
```

* * *

### Image Creation [​](https://docs.openwebui.com/reference/env-configuration/\#image-creation "Direct link to Image Creation")

#### `IMAGE_GENERATION_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#image_generation_engine "Direct link to image_generation_engine")

- Type: `str`
- Options:
  - `openai`: Uses OpenAI DALL-E for image generation.
  - `comfyui`: Uses ComfyUI engine for image generation.
  - `automatic1111`: Uses AUTOMATIC1111 engine for image generation.
  - `gemini`: Uses Gemini for image generation.
- Default: `openai`
- Description: Specifies the engine to use for image generation.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `IMAGE_GENERATION_MODEL` [​](https://docs.openwebui.com/reference/env-configuration/\#image_generation_model "Direct link to image_generation_model")

- Type: `str`
- Default: \`\`
- Description: Default model to use for image generation (e.g., `dall-e-3`, `gemini-2.0-flash-exp`).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `IMAGE_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#image_size "Direct link to image_size")

- Type: `str`
- Default: `512x512`
- Description: Sets the default output dimensions for generated images in WIDTHxHEIGHT format (e.g., `1024x1024`). Set to `auto` to let the model determine the appropriate size (only supported by models matching `IMAGE_AUTO_SIZE_MODELS_REGEX_PATTERN`).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `IMAGE_AUTO_SIZE_MODELS_REGEX_PATTERN` [​](https://docs.openwebui.com/reference/env-configuration/\#image_auto_size_models_regex_pattern "Direct link to image_auto_size_models_regex_pattern")

- Type: `str`
- Default: `^gpt-image`
- Description: A regex pattern to match model names that support `IMAGE_SIZE = "auto"`. When a model matches this pattern, the `auto` size option becomes available, allowing the model to determine the appropriate output dimensions. By default, only models starting with `gpt-image` (e.g., `gpt-image-1`) are matched.

#### `IMAGE_URL_RESPONSE_MODELS_REGEX_PATTERN` [​](https://docs.openwebui.com/reference/env-configuration/\#image_url_response_models_regex_pattern "Direct link to image_url_response_models_regex_pattern")

- Type: `str`
- Default: `^gpt-image`
- Description: A regex pattern to match model names that return image URLs directly instead of base64-encoded data. Models matching this pattern will not include `response_format: b64_json` in API requests. By default, only models starting with `gpt-image` are matched. For other models, Open WebUI requests base64 responses and handles the conversion internally.

#### `IMAGE_STEPS` [​](https://docs.openwebui.com/reference/env-configuration/\#image_steps "Direct link to image_steps")

- Type: `int`
- Default: `50`
- Description: Sets the default iteration steps for image generation. Used for ComfyUI and AUTOMATIC1111 engines.
- Persistence: This environment variable is a `ConfigVar` variable.

* * *

### Image Editing [​](https://docs.openwebui.com/reference/env-configuration/\#image-editing "Direct link to Image Editing")

#### `ENABLE_IMAGE_EDIT` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_image_edit "Direct link to enable_image_edit")

- Type: `boolean`
- Default: `true`
- Description: When disabled, Image Editing will not be used and instead, images will be created only using the image generation engine.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `IMAGE_EDIT_ENGINE` [​](https://docs.openwebui.com/reference/env-configuration/\#image_edit_engine "Direct link to image_edit_engine")

- Type: `str`
- Options:
  - `openai`: Uses OpenAI DALL-E for image editing.
  - `gemini`: Uses Gemini for image editing.
  - `comfyui`: Uses ComfyUI engine for image editing.
- Default: `openai`
- Description: Configures the engine used for image editing operations, enabling modification of existing images using text prompts.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `IMAGE_EDIT_MODEL` [​](https://docs.openwebui.com/reference/env-configuration/\#image_edit_model "Direct link to image_edit_model")

- Type: `str`
- Default: \`\`
- Description: Specifies the model to use for image editing operations within the selected engine (e.g., `dall-e-2`, `gemini-2.5-flash`).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_OPENAI_IMAGE_EDIT_NORMALIZATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_openai_image_edit_normalization "Direct link to enable_openai_image_edit_normalization")

- Type: `bool`
- Default: `True`
- Description: When `IMAGE_EDIT_ENGINE=openai`, normalizes the input image (re-encoding it to a format/shape the OpenAI image-edit API accepts) before sending the edit request. Disable only if your input images are already in a compatible format and you want to skip the conversion.
- Persistence: Set via environment variable; applied at startup (not a `ConfigVar`).

#### `IMAGE_EDIT_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#image_edit_size "Direct link to image_edit_size")

- Type: `str`
- Default: \`\`
- Description: Defines the output dimensions for edited images in WIDTHxHEIGHT format (e.g., `1024x1024`). Leave empty to preserve original dimensions.
- Persistence: This environment variable is a `ConfigVar` variable.

* * *

### OpenAI DALL-E [​](https://docs.openwebui.com/reference/env-configuration/\#openai-dall-e "Direct link to OpenAI DALL-E")

#### Image Generation [​](https://docs.openwebui.com/reference/env-configuration/\#image-generation-1 "Direct link to Image Generation")

##### `IMAGES_OPENAI_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#images_openai_api_base_url "Direct link to images_openai_api_base_url")

- Type: `str`
- Default: `${OPENAI_API_BASE_URL}`
- Description: Sets the OpenAI-compatible base URL to use for DALL-E image generation.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `IMAGES_OPENAI_API_VERSION` [​](https://docs.openwebui.com/reference/env-configuration/\#images_openai_api_version "Direct link to images_openai_api_version")

- Type: `str`
- Default: `${OPENAI_API_VERSION}`
- Description: Optional setting. If provided it sets the `api-version` query parameter when calling the image generation endpoint. Required for Azure OpenAI deployments.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `IMAGES_OPENAI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#images_openai_api_key "Direct link to images_openai_api_key")

- Type: `str`
- Default: `${OPENAI_API_KEY}`
- Description: Sets the API key to use for DALL-E image generation.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `IMAGES_OPENAI_API_PARAMS` [​](https://docs.openwebui.com/reference/env-configuration/\#images_openai_api_params "Direct link to images_openai_api_params")

- Type: `str` (JSON)
- Default: `{}`
- Description: Additional parameters for OpenAI image generation API in JSON format. Allows customization of API-specific settings such as quality parameters for DALL-E models (e.g., `{"quality": "hd"}` for dall-e-3).
- Example: `{"quality": "hd", "style": "vivid"}`
- Persistence: This environment variable is a `ConfigVar` variable.

#### Image Editing [​](https://docs.openwebui.com/reference/env-configuration/\#image-editing-1 "Direct link to Image Editing")

##### `IMAGES_EDIT_OPENAI_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#images_edit_openai_api_base_url "Direct link to images_edit_openai_api_base_url")

- Type: `str`
- Default: `${OPENAI_API_BASE_URL}`
- Description: Configures the OpenAI API base URL specifically for image editing operations, allowing separate endpoints from image generation.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `IMAGES_EDIT_OPENAI_API_VERSION` [​](https://docs.openwebui.com/reference/env-configuration/\#images_edit_openai_api_version "Direct link to images_edit_openai_api_version")

- Type: `str`
- Default: \`\`
- Description: Specifies the OpenAI API version for image editing, enabling support for Azure OpenAI deployments with versioned endpoints.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `IMAGES_EDIT_OPENAI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#images_edit_openai_api_key "Direct link to images_edit_openai_api_key")

- Type: `str`
- Default: `${OPENAI_API_KEY}`
- Description: Provides authentication for OpenAI image editing API requests, with support for separate keys from image generation.
- Persistence: This environment variable is a `ConfigVar` variable.

* * *

### Gemini [​](https://docs.openwebui.com/reference/env-configuration/\#gemini "Direct link to Gemini")

tip

For a detailed setup guide and example configuration, please refer to the [Gemini Image Generation Guide](https://docs.openwebui.com/features/chat-conversations/image-generation-and-editing/gemini).

#### Image Generation [​](https://docs.openwebui.com/reference/env-configuration/\#image-generation-2 "Direct link to Image Generation")

##### `IMAGES_GEMINI_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#images_gemini_api_base_url "Direct link to images_gemini_api_base_url")

- Type: `str`
- Default: `${GEMINI_API_BASE_URL}`
- Description: Specifies the URL to Gemini's image generation API.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `IMAGES_GEMINI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#images_gemini_api_key "Direct link to images_gemini_api_key")

- Type: `str`
- Default: `${GEMINI_API_KEY}`
- Description: Sets the Gemini API key for image generation.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `IMAGES_GEMINI_ENDPOINT_METHOD` [​](https://docs.openwebui.com/reference/env-configuration/\#images_gemini_endpoint_method "Direct link to images_gemini_endpoint_method")

- Type: `str`
- Options:
  - `predict`: Uses the predict endpoint (default for Imagen models).
  - `generateContent`: Uses the generateContent endpoint (for Gemini 2.5 Flash and newer models).
- Default: \`\`
- Description: Specifies the Gemini API endpoint method for image generation, supporting both legacy Imagen models and newer Gemini models with image generation capabilities.
- Persistence: This environment variable is a `ConfigVar` variable.

#### Image Editing [​](https://docs.openwebui.com/reference/env-configuration/\#image-editing-2 "Direct link to Image Editing")

##### `IMAGES_EDIT_GEMINI_API_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#images_edit_gemini_api_base_url "Direct link to images_edit_gemini_api_base_url")

- Type: `str`
- Default: `${GEMINI_API_BASE_URL}`
- Description: Configures the Gemini API base URL for image editing operations with Gemini models.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `IMAGES_EDIT_GEMINI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#images_edit_gemini_api_key "Direct link to images_edit_gemini_api_key")

- Type: `str`
- Default: `${GEMINI_API_KEY}`
- Description: Provides authentication for Gemini image editing API requests.
- Persistence: This environment variable is a `ConfigVar` variable.

* * *

### ComfyUI [​](https://docs.openwebui.com/reference/env-configuration/\#comfyui "Direct link to ComfyUI")

#### Image Generation [​](https://docs.openwebui.com/reference/env-configuration/\#image-generation-3 "Direct link to Image Generation")

##### `COMFYUI_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#comfyui_base_url "Direct link to comfyui_base_url")

- Type: `str`
- Default: \`\`
- Description: Specifies the URL to the ComfyUI image generation API (e.g., `http://127.0.0.1:8188`).
- Persistence: This environment variable is a `ConfigVar` variable.

##### `COMFYUI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#comfyui_api_key "Direct link to comfyui_api_key")

- Type: `str`
- Default: \`\`
- Description: Sets the API key for ComfyUI authentication.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `COMFYUI_WORKFLOW` [​](https://docs.openwebui.com/reference/env-configuration/\#comfyui_workflow "Direct link to comfyui_workflow")

- Type: `str` (JSON)
- Default:

```
{
  "3": {
    "inputs": {
      "seed": 0,
      "steps": 20,
      "cfg": 8,
      "sampler_name": "euler",
      "scheduler": "normal",
      "denoise": 1,
      "model": ["4", 0],
      "positive": ["6", 0],
      "negative": ["7", 0],
      "latent_image": ["5", 0]
    },
    "class_type": "KSampler",
    "_meta": {
      "title": "KSampler"
    }
  },
  "4": {
    "inputs": {
      "ckpt_name": "model.safetensors"
    },
    "class_type": "CheckpointLoaderSimple",
    "_meta": {
      "title": "Load Checkpoint"
    }
  },
  "5": {
    "inputs": {
      "width": 512,
      "height": 512,
      "batch_size": 1
    },
    "class_type": "EmptyLatentImage",
    "_meta": {
      "title": "Empty Latent Image"
    }
  },
  "6": {
    "inputs": {
      "text": "Prompt",
      "clip": ["4", 1]
    },
    "class_type": "CLIPTextEncode",
    "_meta": {
      "title": "CLIP Text Encode (Prompt)"
    }
  },
  "7": {
    "inputs": {
      "text": "",
      "clip": ["4", 1]
    },
    "class_type": "CLIPTextEncode",
    "_meta": {
      "title": "CLIP Text Encode (Prompt)"
    }
  },
  "8": {
    "inputs": {
      "samples": ["3", 0],
      "vae": ["4", 2]
    },
    "class_type": "VAEDecode",
    "_meta": {
      "title": "VAE Decode"
    }
  },
  "9": {
    "inputs": {
      "filename_prefix": "ComfyUI",
      "images": ["8", 0]
    },
    "class_type": "SaveImage",
    "_meta": {
      "title": "Save Image"
    }
  }
}
```

- Description: Defines the ComfyUI workflow configuration in JSON format. Export from ComfyUI using "Save (API Format)" to ensure compatibility.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `COMFYUI_WORKFLOW_NODES` [​](https://docs.openwebui.com/reference/env-configuration/\#comfyui_workflow_nodes "Direct link to comfyui_workflow_nodes")

- Type: `list[dict]`
- Default: `[]`
- Description: Specifies the ComfyUI workflow node mappings for image generation, defining which nodes handle prompt, model, dimensions, and other parameters. Configured automatically via the admin UI.
- Persistence: This environment variable is a `ConfigVar` variable.

#### Image Editing [​](https://docs.openwebui.com/reference/env-configuration/\#image-editing-3 "Direct link to Image Editing")

##### `IMAGES_EDIT_COMFYUI_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#images_edit_comfyui_base_url "Direct link to images_edit_comfyui_base_url")

- Type: `str`
- Default: \`\`
- Description: Configures the ComfyUI base URL for image editing operations, enabling self-hosted ComfyUI workflows for image manipulation.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `IMAGES_EDIT_COMFYUI_API_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#images_edit_comfyui_api_key "Direct link to images_edit_comfyui_api_key")

- Type: `str`
- Default: \`\`
- Description: Provides authentication for ComfyUI image editing API requests when the ComfyUI instance requires API key authentication.
- Persistence: This environment variable is a `ConfigVar` variable.

##### `IMAGES_EDIT_COMFYUI_WORKFLOW` [​](https://docs.openwebui.com/reference/env-configuration/\#images_edit_comfyui_workflow "Direct link to images_edit_comfyui_workflow")

- Type: `str` (JSON)
- Default: \`\`
- Description: Defines the ComfyUI workflow configuration in JSON format for image editing operations. Must include nodes for image input, prompt, and output. Export from ComfyUI using "Save (API Format)".
- Persistence: This environment variable is a `ConfigVar` variable.

##### `IMAGES_EDIT_COMFYUI_WORKFLOW_NODES` [​](https://docs.openwebui.com/reference/env-configuration/\#images_edit_comfyui_workflow_nodes "Direct link to images_edit_comfyui_workflow_nodes")

- Type: `list[dict]`
- Default: `[]`
- Description: Specifies the ComfyUI workflow node mappings for image editing, defining which nodes handle image input, prompt, model, dimensions, and other parameters. Configured automatically via the admin UI.
- Persistence: This environment variable is a `ConfigVar` variable.

* * *

### AUTOMATIC1111 [​](https://docs.openwebui.com/reference/env-configuration/\#automatic1111 "Direct link to AUTOMATIC1111")

#### `AUTOMATIC1111_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#automatic1111_base_url "Direct link to automatic1111_base_url")

- Type: `str`
- Default: \`\`
- Description: Specifies the URL to AUTOMATIC1111's Stable Diffusion API (e.g., `http://127.0.0.1:7860`).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUTOMATIC1111_API_AUTH` [​](https://docs.openwebui.com/reference/env-configuration/\#automatic1111_api_auth "Direct link to automatic1111_api_auth")

- Type: `str`
- Default: \`\`
- Description: Sets the AUTOMATIC1111 API authentication credentials if required.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `AUTOMATIC1111_PARAMS` [​](https://docs.openwebui.com/reference/env-configuration/\#automatic1111_params "Direct link to automatic1111_params")

- Type: `str` (JSON)
- Default: `{}`
- Description: Additional parameters in JSON format to pass to AUTOMATIC1111 API requests (e.g., `{"cfg_scale": 7, "sampler_name": "Euler a", "scheduler": "normal"}`).
- Persistence: This environment variable is a `ConfigVar` variable.

## OAuth [​](https://docs.openwebui.com/reference/env-configuration/\#oauth "Direct link to OAuth")

info

You can only configure one OAUTH provider at a time. You cannot have two or more OAUTH providers configured simultaneously.

#### `ENABLE_OAUTH_SIGNUP` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_oauth_signup "Direct link to enable_oauth_signup")

- Type: `bool`
- Default: `False`
- Description: Enables account creation when signing up via OAuth. Distinct from `ENABLE_SIGNUP`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_AUTO_REDIRECT` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_auto_redirect "Direct link to oauth_auto_redirect")

- Type: `bool`
- Default: `False`
- Description: When enabled, an unauthenticated visitor to `/auth` is redirected straight to the OAuth provider's login page, skipping the "Continue with SSO" screen. It only fires on an unambiguously SSO-only deployment: exactly one OAuth provider configured, [`ENABLE_LOGIN_FORM`](https://docs.openwebui.com/reference/env-configuration/#enable_login_form) set to `False` and no LDAP or trusted-header auth. The redirect is suppressed during onboarding, after a failed sign-in and for an existing session. Visit `/auth?form=true` to reach the local login form anyway (an escape hatch for admins).
- Persistence: This environment variable is a `ConfigVar` variable.

danger

`ENABLE_LOGIN_FORM` must be set to `False` when `ENABLE_OAUTH_SIGNUP` is set to `True`. Failure to do so will result in the inability to login.

#### `ENABLE_OAUTH_PERSISTENT_CONFIG` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_oauth_persistent_config "Direct link to enable_oauth_persistent_config")

- Type: `bool`
- Default: `False`
- Description: When [`ENABLE_PERSISTENT_CONFIG`](https://docs.openwebui.com/reference/env-configuration/#enable_persistent_config) is enabled, controls whether OAuth-related settings (config paths starting with `oauth.`) are also loaded from the database. When `False`, OAuth settings are always read from the environment variables instead.

info

By default (`False`), OAuth settings are read from your environment variables on every restart and are **not** loaded from the database, even if you previously changed them in the Admin Panel and even when `ENABLE_PERSISTENT_CONFIG` is `True`. This keeps environment variables authoritative for OAuth, which suits GitOps or immutable infrastructure where configuration lives in external files (e.g. Docker Compose, Kubernetes ConfigMaps).

Set this variable to `True` to persist OAuth settings in the database and manage them through the Admin Panel after initial setup, the same way other persistent settings behave.

#### `OAUTH_SUB_CLAIM` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_sub_claim "Direct link to oauth_sub_claim")

- Type: `str`
- Default: `None`
- Description: Overrides the default claim used to identify a user's unique ID (`sub`) from the OAuth/OIDC provider's user info response. By default, Open WebUI attempts to infer this from the provider's configuration. This variable allows you to explicitly specify which claim to use. For example, if your identity provider uses 'employee\_id' as the unique identifier, you would set this variable to 'employee\_id'.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_MERGE_ACCOUNTS_BY_EMAIL` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_merge_accounts_by_email "Direct link to oauth_merge_accounts_by_email")

- Type: `bool`
- Default: `False`
- Description: If enabled, merges OAuth accounts with existing accounts using the same email
address. This is considered unsafe as not all OAuth providers will verify email addresses and can lead to potential account takeovers.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_OAUTH_WITHOUT_EMAIL` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_oauth_without_email "Direct link to enable_oauth_without_email")

- Type: `bool`
- Default: `False`
- Description: Enables authentication with OpenID Connect (OIDC) providers that do not support or expose an email scope. When enabled, Open WebUI will create and manage user accounts without requiring an email address from the OAuth provider.
- Persistence: This environment variable is a `ConfigVar` variable.

warning

**Use with Caution**

Enabling this option bypasses email-based user identification, which is the standard method for uniquely identifying users across authentication systems. When enabled:

- User accounts will be created using the `sub` claim (or the claim specified in `OAUTH_SUB_CLAIM`) as the primary identifier
- Email-based features such as password recovery, email notifications, and account merging via `OAUTH_MERGE_ACCOUNTS_BY_EMAIL` will not function properly
- Ensure your OIDC provider's `sub` claim is stable and unique to prevent authentication conflicts

Only enable this if your identity provider does not support email scope and you have alternative user identification mechanisms in place.

This setting is designed for enterprise environments using identity providers that:

- Use employee IDs, usernames, or other non-email identifiers as the primary user claim
- Have privacy policies that prevent sharing email addresses via OAuth
- Operate in air-gapped or highly restricted networks where email-based services are unavailable

For most standard OAuth providers (Google, Microsoft, GitHub, etc.), this setting should remain `False`.

#### `OAUTH_UPDATE_PICTURE_ON_LOGIN` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_update_picture_on_login "Direct link to oauth_update_picture_on_login")

- Type: `bool`
- Default: `False`
- Description: If enabled, updates the local user profile picture with the OAuth-provided picture on login.
- Persistence: This environment variable is a `ConfigVar` variable.

info

If the OAuth picture claim is disabled by setting `OAUTH_PICTURE_CLAIM` to `''` (empty string), then setting this variable to `true` will not update the user profile pictures.

#### `ENABLE_OAUTH_ID_TOKEN_COOKIE` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_oauth_id_token_cookie "Direct link to enable_oauth_id_token_cookie")

- Type: `bool`
- Default: `True`
- Description: Controls whether the **legacy**`oauth_id_token` cookie (unsafe, not recommended, token can go stale/orphaned) is set in the browser upon a successful OAuth login. This is provided for **backward compatibility** with custom tools or older versions that might rely on scraping this cookie. **The new, recommended approach is to use the server-side session management.**
- Usage: For new and secure deployments, **it is recommended to set this to `False`** to minimize the information exposed to the client-side. Keep it as `True` only if you have integrations that depend on the old cookie-based method.

#### `ENABLE_OAUTH_TOKEN_EXCHANGE` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_oauth_token_exchange "Direct link to enable_oauth_token_exchange")

- Type: `bool`
- Default: `False`
- Description: Enables the OAuth token exchange endpoint, allowing external applications to exchange an OAuth provider's access token for an Open WebUI JWT session token. This enables programmatic authentication for external tools and services that already have OAuth tokens from your identity provider.
- Usage: Set to `true` to enable the token exchange endpoint at `/api/v1/oauth/{provider}/token/exchange`. When enabled, external applications can POST to this endpoint with an OAuth access token to obtain an Open WebUI session token.

warning

**Security Note**: This feature should only be enabled when you have external applications that need to authenticate with Open WebUI using OAuth tokens from your identity provider. Ensure proper access controls are in place for any external applications using this endpoint.

**Request Example:**

```
curl -X POST "http://localhost:8080/api/v1/oauth/google/token/exchange" \
  -H "Content-Type: application/json" \
  -d '{"token": "ya29.a0AfH6SMB..."}'
```

**Response:**

```
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_at": 1735682400,
  "id": 1,
  "email": "user@example.com",
  "name": "John Doe",
  "role": "user",
  "profile_image_url": "https://...",
  "permissions": {...}
}
```

**Requirements:**

- The user must already exist in Open WebUI (they must have signed in via the web interface at least once)
- The OAuth provider must be properly configured
- The token exchange uses the same user lookup logic as regular OAuth login (by OAuth `sub` claim first, then by email if `OAUTH_MERGE_ACCOUNTS_BY_EMAIL` is enabled)

#### `ENABLE_OAUTH_BACKCHANNEL_LOGOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_oauth_backchannel_logout "Direct link to enable_oauth_backchannel_logout")

- Type: `bool`
- Default: `False`
- Description: Enables OpenID Connect Back-Channel Logout support. When enabled, Open WebUI exposes `POST /oauth/backchannel-logout` so your identity provider can trigger server-side logout without browser redirects.
- Usage: Set to `true` to enable the endpoint. Your identity provider should send a form-encoded `logout_token` that follows the OpenID Connect Back-Channel Logout 1.0 specification.

warning

**Redis Requirement for JWT Revocation**

Back-channel logout revokes existing Open WebUI JWT sessions through Redis-based revocation keys. Without Redis, Open WebUI can still remove stored OAuth sessions, but already-issued JWTs remain valid until they naturally expire.

For production SSO deployments, especially with multiple workers or replicas, configure `REDIS_URL` when enabling this feature.

info

**Behavior Notes**

- The endpoint returns `200` with an empty body for valid requests, including cases where no matching user is found.
- Invalid or malformed `logout_token` requests return `400` with `invalid_request` details.
- Back-channel logout revokes users by provider + `sub` claim matching. `sid`-only logout matching is not currently supported.

#### `OAUTH_CLIENT_INFO_ENCRYPTION_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_client_info_encryption_key "Direct link to oauth_client_info_encryption_key")

- Type: `str`
- Default: Falls back to the value of `WEBUI_SECRET_KEY`.
- Description: Specifies the secret key used to encrypt and decrypt OAuth client tokens stored server-side in the database. This is a critical security component for OAuth client tokens. If not set, it defaults to using the main `WEBUI_SECRET_KEY`, but it is highly recommended to set it to a unique, securely generated value for production environments. `OAUTH_CLIENT_INFO_ENCRYPTION_KEY` is used in conjunction with OAuth 2.1 MCP server authentication.

#### `OAUTH_SESSION_TOKEN_ENCRYPTION_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_session_token_encryption_key "Direct link to oauth_session_token_encryption_key")

- Type: `str`
- Default: Falls back to the value of `WEBUI_SECRET_KEY`.
- Description: Specifies the secret key used to encrypt and decrypt OAuth tokens stored server-side in the database. This is a critical security component for protecting user credentials at rest. If not set, it defaults to using the main `WEBUI_SECRET_KEY`, but it is highly recommended to set it to a unique, securely generated value for production environments.

warning

**Required for Multi-Replica Deployments**
In any production environment running more than one instance of Open WebUI (e.g., Docker Swarm, Kubernetes), this variable **MUST** be explicitly set to a persistent, shared secret. If left unset, each replica will generate or use a different key, causing session decryption to fail intermittently as user requests are load-balanced across instances.

#### `OAUTH_MAX_SESSIONS_PER_USER` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_max_sessions_per_user "Direct link to oauth_max_sessions_per_user")

- Type: `int`
- Default: `10`
- Description: Maximum number of concurrent OAuth sessions allowed per user per provider. When a user logs in and the number of existing sessions for that user/provider combination meets or exceeds this limit, the oldest sessions are pruned to make room for the new one. This prevents unbounded session growth while allowing multi-device usage (e.g., logging in from a desktop and a mobile device without invalidating either session).

#### `OAUTH_REFRESH_TOKEN_INCLUDE_SCOPE` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_refresh_token_include_scope "Direct link to oauth_refresh_token_include_scope")

- Type: `bool`
- Default: `False`
- Description: Ensures the full OAuth scope is included during refresh token requests instead of relying on provider defaults. When enabled, the configured scope (e.g. `MICROSOFT_OAUTH_SCOPE`) is passed to the identity provider during token refresh. This is required for providers like Microsoft where missing scopes can cause refresh failures, especially when using custom API scopes.

#### `WEBUI_AUTH_TRUSTED_EMAIL_HEADER` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_auth_trusted_email_header "Direct link to webui_auth_trusted_email_header")

- Type: `str`
- Description: Defines the trusted request header for authentication. See [SSO docs](https://docs.openwebui.com/features/authentication-access/auth/sso).

#### `WEBUI_AUTH_TRUSTED_NAME_HEADER` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_auth_trusted_name_header "Direct link to webui_auth_trusted_name_header")

- Type: `str`
- Description: Defines the trusted request header for the username of anyone registering with the
`WEBUI_AUTH_TRUSTED_EMAIL_HEADER` header. See [SSO docs](https://docs.openwebui.com/features/authentication-access/auth/sso).

#### `WEBUI_AUTH_TRUSTED_GROUPS_HEADER` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_auth_trusted_groups_header "Direct link to webui_auth_trusted_groups_header")

- Type: `str`
- Description: Defines the trusted request header containing a comma-separated list of group memberships for the user when using trusted header authentication. See [SSO docs](https://docs.openwebui.com/features/authentication-access/auth/sso).

#### `WEBUI_AUTH_TRUSTED_ROLE_HEADER` [​](https://docs.openwebui.com/reference/env-configuration/\#webui_auth_trusted_role_header "Direct link to webui_auth_trusted_role_header")

- Type: `str`
- Description: Defines the trusted request header that determines the user's role (`admin`, `user`, or `pending`) when using trusted header authentication. When set, the user's role is updated to match the header value on every sign-in. Invalid values are ignored with a warning. See [SSO docs](https://docs.openwebui.com/features/authentication-access/auth/sso).

### Google [​](https://docs.openwebui.com/reference/env-configuration/\#google "Direct link to Google")

See [https://support.google.com/cloud/answer/6158849?hl=en](https://support.google.com/cloud/answer/6158849?hl=en)

info

You must also set `OPENID_PROVIDER_URL` or otherwise logout may not work.

#### `GOOGLE_CLIENT_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#google_client_id "Direct link to google_client_id")

- Type: `str`
- Description: Sets the client ID for Google OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `GOOGLE_CLIENT_SECRET` [​](https://docs.openwebui.com/reference/env-configuration/\#google_client_secret "Direct link to google_client_secret")

- Type: `str`
- Description: Sets the client secret for Google OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `GOOGLE_OAUTH_SCOPE` [​](https://docs.openwebui.com/reference/env-configuration/\#google_oauth_scope "Direct link to google_oauth_scope")

- Type: `str`
- Default: `openid email profile`
- Description: Sets the scope for Google OAuth authentication.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `GOOGLE_REDIRECT_URI` [​](https://docs.openwebui.com/reference/env-configuration/\#google_redirect_uri "Direct link to google_redirect_uri")

- Type: `str`
- Default: `<backend>/oauth/google/callback`
- Description: Sets the redirect URI for Google OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `GOOGLE_OAUTH_AUTHORIZE_PARAMS` [​](https://docs.openwebui.com/reference/env-configuration/\#google_oauth_authorize_params "Direct link to google_oauth_authorize_params")

- Type: `str` (JSON object)
- Default: `{}`
- Description: Adds Google-specific parameters to the OAuth `/authorize` request. Useful for Google flows that require extra parameters such as `prompt`, `login_hint`, or `hd`.

```
# Example (.env)
GOOGLE_OAUTH_AUTHORIZE_PARAMS={"prompt":"consent","login_hint":"user@example.com","hd":"example.com"}
```

warning

`GOOGLE_OAUTH_AUTHORIZE_PARAMS` must be valid JSON and must be a JSON object. If parsing fails, Open WebUI ignores it and logs a warning.

### Microsoft [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft "Direct link to Microsoft")

See [https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app)

info

You must also set `OPENID_PROVIDER_URL` or otherwise logout may not work.

#### `MICROSOFT_CLIENT_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft_client_id "Direct link to microsoft_client_id")

- Type: `str`
- Description: Sets the client ID for Microsoft OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MICROSOFT_CLIENT_SECRET` [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft_client_secret "Direct link to microsoft_client_secret")

- Type: `str`
- Description: Sets the client secret for Microsoft OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MICROSOFT_CLIENT_TENANT_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft_client_tenant_id "Direct link to microsoft_client_tenant_id")

- Type: `str`
- Description: Sets the tenant ID for Microsoft OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MICROSOFT_OAUTH_SCOPE` [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft_oauth_scope "Direct link to microsoft_oauth_scope")

- Type: `str`
- Default: `openid email profile`
- Description: Sets the scope for Microsoft OAuth authentication. This scope is also included in refresh token requests when `OAUTH_REFRESH_TOKEN_INCLUDE_SCOPE` is enabled, which is required by Azure AD to avoid `AADSTS90009` errors. If you use custom API scopes, include them here (e.g., `openid email profile offline_access api://<Application ID URI>/<custom_scope>`).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MICROSOFT_REDIRECT_URI` [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft_redirect_uri "Direct link to microsoft_redirect_uri")

- Type: `str`
- Default: `<backend>/oauth/microsoft/callback`
- Description: Sets the redirect URI for Microsoft OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MICROSOFT_CLIENT_LOGIN_BASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft_client_login_base_url "Direct link to microsoft_client_login_base_url")

- Type: `str`
- Default: `https://login.microsoftonline.com`
- Description: Sets the base login URL for Microsoft OAuth authentication. Allows configuration of alternative login endpoints for government clouds or custom deployments.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `MICROSOFT_CLIENT_PICTURE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft_client_picture_url "Direct link to microsoft_client_picture_url")

- Type: `str`
- Default: `https://graph.microsoft.com/v1.0/me/photo/$value`
- Description: Specifies the Microsoft Graph API endpoint for retrieving user profile pictures during OAuth authentication.
- Persistence: This environment variable is a `ConfigVar` variable.

### GitHub [​](https://docs.openwebui.com/reference/env-configuration/\#github "Direct link to GitHub")

See [https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps)

info

You must also set `OPENID_PROVIDER_URL` or otherwise logout may not work.

#### `GITHUB_CLIENT_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#github_client_id "Direct link to github_client_id")

- Type: `str`
- Description: Sets the client ID for GitHub OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `GITHUB_CLIENT_SECRET` [​](https://docs.openwebui.com/reference/env-configuration/\#github_client_secret "Direct link to github_client_secret")

- Type: `str`
- Description: Sets the client secret for GitHub OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `GITHUB_CLIENT_SCOPE` [​](https://docs.openwebui.com/reference/env-configuration/\#github_client_scope "Direct link to github_client_scope")

- Type: `str`
- Default: `user:email`
- Description: Specifies the scope for GitHub OAuth authentication.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `GITHUB_CLIENT_REDIRECT_URI` [​](https://docs.openwebui.com/reference/env-configuration/\#github_client_redirect_uri "Direct link to github_client_redirect_uri")

- Type: `str`
- Default: `<backend>/oauth/github/callback`
- Description: Sets the redirect URI for GitHub OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

### Feishu [​](https://docs.openwebui.com/reference/env-configuration/\#feishu "Direct link to Feishu")

See [https://open.feishu.cn/document/sso/web-application-sso/login-overview](https://open.feishu.cn/document/sso/web-application-sso/login-overview)

#### `FEISHU_CLIENT_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#feishu_client_id "Direct link to feishu_client_id")

- Type: `str`
- Description: Sets the client ID for Feishu OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `FEISHU_CLIENT_SECRET` [​](https://docs.openwebui.com/reference/env-configuration/\#feishu_client_secret "Direct link to feishu_client_secret")

- Type: `str`
- Description: Sets the client secret for Feishu OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `FEISHU_OAUTH_SCOPE` [​](https://docs.openwebui.com/reference/env-configuration/\#feishu_oauth_scope "Direct link to feishu_oauth_scope")

- Type: `str`
- Default: `contact:user.base:readonly`
- Description: Specifies the scope for Feishu OAuth authentication.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `FEISHU_REDIRECT_URI` [​](https://docs.openwebui.com/reference/env-configuration/\#feishu_redirect_uri "Direct link to feishu_redirect_uri")

- Type: `str`
- Description: Sets the redirect URI for Feishu OAuth.
- Persistence: This environment variable is a `ConfigVar` variable.

### OpenID (OIDC) [​](https://docs.openwebui.com/reference/env-configuration/\#openid-oidc "Direct link to OpenID (OIDC)")

#### `OAUTH_CLIENT_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_client_id "Direct link to oauth_client_id")

- Type: `str`
- Description: Sets the client ID for OIDC.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_CLIENT_SECRET` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_client_secret "Direct link to oauth_client_secret")

- Type: `str`
- Description: Sets the client secret for OIDC.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OPENID_PROVIDER_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#openid_provider_url "Direct link to openid_provider_url")

- Type: `str`
- Description: Path to the `.well-known/openid-configuration` endpoint
- Persistence: This environment variable is a `ConfigVar` variable.

danger

The environment variable `OPENID_PROVIDER_URL` MUST be configured, otherwise the logout functionality will not work for most providers.
Even when using Microsoft, GitHub or other providers, you MUST set the `OPENID_PROVIDER_URL` environment variable.

Alternatively, if your provider does not support standard OIDC discovery (e.g., AWS Cognito), you can set `OPENID_END_SESSION_ENDPOINT` to a custom logout URL instead.

#### `OPENID_END_SESSION_ENDPOINT` [​](https://docs.openwebui.com/reference/env-configuration/\#openid_end_session_endpoint "Direct link to openid_end_session_endpoint")

- Type: `str`
- Default: Empty string (`""`)
- Description: Sets a custom end-session (logout) endpoint URL. When configured, Open WebUI will redirect to this URL on logout instead of attempting OIDC discovery via `OPENID_PROVIDER_URL`. This is useful for OAuth providers that do not support standard OIDC discovery for logout, such as AWS Cognito.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OPENID_REDIRECT_URI` [​](https://docs.openwebui.com/reference/env-configuration/\#openid_redirect_uri "Direct link to openid_redirect_uri")

- Type: `str`
- Default: `<backend>/oauth/oidc/callback`
- Description: Sets the redirect URI for OIDC
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_SCOPES` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_scopes "Direct link to oauth_scopes")

- Type: `str`
- Default: `openid email profile`
- Description: Sets the scope for OIDC authentication. `openid` and `email` are required.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_CODE_CHALLENGE_METHOD` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_code_challenge_method "Direct link to oauth_code_challenge_method")

- Type: `str`
- Options:
  - `S256`: Hash `code_verifier` with SHA-256.
- Default: Empty string (' '), since `None` is set as default.
- Description: Specifies the code challenge method for OAuth authentication. Set to `S256` when PKCE is required by the provider.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_PROVIDER_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_provider_name "Direct link to oauth_provider_name")

- Type: `str`
- Default: `SSO`
- Description: Sets the name for the OIDC provider.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_USERNAME_CLAIM` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_username_claim "Direct link to oauth_username_claim")

- Type: `str`
- Default: `name`
- Description: Set username claim for OpenID.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_EMAIL_CLAIM` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_email_claim "Direct link to oauth_email_claim")

- Type: `str`
- Default: `email`
- Description: Set email claim for OpenID.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_PICTURE_CLAIM` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_picture_claim "Direct link to oauth_picture_claim")

- Type: `str`
- Default: `picture`
- Description: Set picture (avatar) claim for OpenID.
- Persistence: This environment variable is a `ConfigVar` variable.

info

If `OAUTH_PICTURE_CLAIM` is set to `''` (empty string), then the OAuth picture claim is disabled and the user profile pictures will not be saved.

#### `OAUTH_GROUP_CLAIM` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_group_claim "Direct link to oauth_group_claim")

- Type: `str`
- Default: `groups`
- Description: Specifies the group claim for OAuth authentication.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_OAUTH_ROLE_MANAGEMENT` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_oauth_role_management "Direct link to enable_oauth_role_management")

- Type: `bool`
- Default: `False`
- Description: Enables role management for OAuth delegation.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_OAUTH_GROUP_MANAGEMENT` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_oauth_group_management "Direct link to enable_oauth_group_management")

- Type: `bool`
- Default: `False`
- Description: Enables or disables OAuth group management.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_OAUTH_GROUP_CREATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_oauth_group_creation "Direct link to enable_oauth_group_creation")

- Type: `bool`
- Default: `False`
- Description: When enabled, groups from OAuth claims that don't exist in Open WebUI will be automatically created.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_GROUP_DEFAULT_SHARE` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_group_default_share "Direct link to oauth_group_default_share")

- Type: `str`
- Default: `true`
- Options:
  - `true`: Groups created via OAuth will have sharing enabled for anyone.
  - `members`: Groups created via OAuth will only allow sharing with group members.
  - `false`: Groups created via OAuth will have sharing disabled (no one can share).
- Description: Controls the default sharing permission for groups that are automatically created via OAuth group management. Only applies when `ENABLE_OAUTH_GROUP_CREATION` is enabled. Existing groups are not affected by this setting.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_BLOCKED_GROUPS` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_blocked_groups "Direct link to oauth_blocked_groups")

- Type: `str`
- Default: `[]`
- Description: JSON array of group names that are blocked from accessing the application. Users belonging to these groups will be denied access even if they have valid OAuth credentials.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_ROLES_CLAIM` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_roles_claim "Direct link to oauth_roles_claim")

- Type: `str`
- Default: `roles`
- Description: Sets the roles claim to look for in the OIDC token.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_ALLOWED_ROLES` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_allowed_roles "Direct link to oauth_allowed_roles")

- Type: `str`
- Default: `user,admin`
- Description: Sets the roles that are allowed access to the platform. A value of `*` in the list acts as a wildcard that matches any role, so any user presenting a roles claim is allowed.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_ADMIN_ROLES` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_admin_roles "Direct link to oauth_admin_roles")

- Type: `str`
- Default: `admin`
- Description: Sets the roles that are considered administrators.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_ROLES_SEPARATOR` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_roles_separator "Direct link to oauth_roles_separator")

- Type: `str`
- Default: `,`
- Description: Allows custom role separators for for splitting the `OAUTH_*_ROLES` variables. Meant for OAuth roles that contain commas; useful for roles specified in LDAP syntax or other systems where commas are part of role names. If the claim is a string and contains the separator, it will be also split by that separator.

#### `OAUTH_GROUPS_SEPARATOR` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_groups_separator "Direct link to oauth_groups_separator")

- Type: `str`
- Default: `;`
- Description: Specifies the delimiter used to parse multiple group names from the OAuth group claim. This separator is used when the identity provider returns group memberships as a delimited string rather than an array. Useful when integrating with systems that use non-standard separators or when group names themselves contain commas.

#### `OAUTH_ALLOWED_DOMAINS` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_allowed_domains "Direct link to oauth_allowed_domains")

- Type: `str`
- Default: `*`
- Description: Specifies the allowed domains for OAuth authentication. (e.g., "example1.com,example2.com").
- Persistence: This environment variable is a `ConfigVar` variable.

#### `OAUTH_AUDIENCE` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_audience "Direct link to oauth_audience")

- Type: `str`
- Default: Empty string (' ')
- Description: Specifies an audience parameter passed to the OAuth provider's authorization endpoint during login. Some providers (such as Auth0 and Ory) use this value to determine the type of access token returned. Without it, providers typically return an opaque token, while with it, they return a JWT that can be decoded and validated. This parameter is not part of the official OAuth/OIDC spec for authorization endpoints but is widely supported by some providers.

info

This is useful when you need a JWT access token for downstream validation or when your OAuth provider requires an audience hint for proper token generation. For Auth0, this is typically your API identifier (e.g., `https://your-api.auth0.com/api/v2/`). For Ory, specify the resource server you want to access.

#### `OAUTH_AUTHORIZE_PARAMS` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_authorize_params "Direct link to oauth_authorize_params")

- Type: `str` (JSON object)
- Default: `{}`
- Description: Passes extra parameters directly to the OAuth provider's authorization endpoint during login. Use this when your provider requires custom authorize-time parameters that are not covered by dedicated variables.

Common examples include parameters like `prompt`, `login_hint`, `domain_hint`, `resource`, `audience`, or provider-specific flags.

```
# Example (.env)
OAUTH_AUTHORIZE_PARAMS={"prompt":"consent","login_hint":"user@example.com"}
```

```
# Example (docker-compose)
environment:
  - OAUTH_AUTHORIZE_PARAMS={"prompt":"consent","login_hint":"user@example.com"}
```

warning

`OAUTH_AUTHORIZE_PARAMS` must be valid JSON and must be a JSON object (key/value map). If parsing fails, Open WebUI ignores it and logs a warning.

info

If you set both `OAUTH_AUDIENCE` and `OAUTH_AUTHORIZE_PARAMS` containing an `audience` key, the value from `OAUTH_AUTHORIZE_PARAMS` takes precedence.

#### `OAUTH_REFRESH_TOKEN_INCLUDE_SCOPE` [​](https://docs.openwebui.com/reference/env-configuration/\#oauth_refresh_token_include_scope-1 "Direct link to oauth_refresh_token_include_scope-1")

- Type: `bool`
- Default: `False`
- Description: When enabled, includes the configured OAuth scope in refresh token requests. Some OAuth providers, notably Microsoft Azure AD, require the scope to be explicitly provided when refreshing a token. Without it, Azure AD treats the request as the application requesting a token for itself, resulting in `AADSTS90009` errors. Enable this if you encounter token refresh failures with your OAuth provider.
- Persistence: This environment variable is a `ConfigVar` variable.

info

This setting is compliant with [RFC 6749 Section 6](https://datatracker.ietf.org/doc/html/rfc6749#section-6), where the `scope` parameter is optional during refresh token requests. Only enable this for providers that require it, such as certain Azure AD configurations.

## LDAP [​](https://docs.openwebui.com/reference/env-configuration/\#ldap "Direct link to LDAP")

#### `ENABLE_LDAP` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_ldap "Direct link to enable_ldap")

- Type: `bool`
- Default: `False`
- Description: Enables or disables LDAP authentication.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_SERVER_LABEL` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_server_label "Direct link to ldap_server_label")

- Type: `str`
- Description: Sets the label of the LDAP server.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_SERVER_HOST` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_server_host "Direct link to ldap_server_host")

- Type: `str`
- Default: `localhost`
- Description: Sets the hostname of the LDAP server.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_SERVER_PORT` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_server_port "Direct link to ldap_server_port")

- Type: `int`
- Default: `389`
- Description: Sets the port number of the LDAP server.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_ATTRIBUTE_FOR_MAIL` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_attribute_for_mail "Direct link to ldap_attribute_for_mail")

- Type: `str`
- Description: Sets the attribute to use as mail for LDAP authentication.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_ATTRIBUTE_FOR_USERNAME` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_attribute_for_username "Direct link to ldap_attribute_for_username")

- Type: `str`
- Description: Sets the attribute to use as a username for LDAP authentication.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_APP_DN` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_app_dn "Direct link to ldap_app_dn")

- Type: `str`
- Description: Sets the distinguished name for the LDAP application.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_APP_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_app_password "Direct link to ldap_app_password")

- Type: `str`
- Description: Sets the password for the LDAP application.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_SEARCH_BASE` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_search_base "Direct link to ldap_search_base")

- Type: `str`
- Description: Sets the base to search for LDAP authentication.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_SEARCH_FILTER` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_search_filter "Direct link to ldap_search_filter")

- Type: `str`
- Default: `None`
- Description: Sets additional filter conditions for LDAP user search. This filter is **appended** to the automatically-generated username filter. Open WebUI automatically constructs the username portion of the filter using `LDAP_ATTRIBUTE_FOR_USERNAME`, so you should **not** include user placeholders like `%(user)s` or `%s`; these are not supported. Use this for additional conditions such as group membership restrictions (e.g., `(memberOf=cn=allowed-users,ou=groups,dc=example,dc=com)`). Alternative to `LDAP_SEARCH_FILTERS`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_SEARCH_FILTERS` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_search_filters "Direct link to ldap_search_filters")

- Type: `str`
- Description: Sets additional filter conditions for LDAP user search. This is an alias for `LDAP_SEARCH_FILTER`. The filter is appended to the automatically-generated username filter. Do **not** include user placeholders like `%(user)s` or `%s`.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_USE_TLS` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_use_tls "Direct link to ldap_use_tls")

- Type: `bool`
- Default: `True`
- Description: Enables or disables TLS for LDAP connection.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_CA_CERT_FILE` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_ca_cert_file "Direct link to ldap_ca_cert_file")

- Type: `str`
- Description: Sets the path to the LDAP CA certificate file.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_VALIDATE_CERT` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_validate_cert "Direct link to ldap_validate_cert")

- Type: `bool`
- Description: Sets whether to validate the LDAP CA certificate.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_CIPHERS` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_ciphers "Direct link to ldap_ciphers")

- Type: `str`
- Default: `ALL`
- Description: Sets the ciphers to use for LDAP connection.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_LDAP_GROUP_MANAGEMENT` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_ldap_group_management "Direct link to enable_ldap_group_management")

- Type: `bool`
- Default: `False`
- Description: Enables the group management feature.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `ENABLE_LDAP_GROUP_CREATION` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_ldap_group_creation "Direct link to enable_ldap_group_creation")

- Type: `bool`
- Default: `False`
- Description: If a group from LDAP does not exist in Open WebUI, it will be created automatically.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `LDAP_ATTRIBUTE_FOR_GROUPS` [​](https://docs.openwebui.com/reference/env-configuration/\#ldap_attribute_for_groups "Direct link to ldap_attribute_for_groups")

- Type: `str`
- Default: `memberOf`
- Description: Specifies the LDAP attribute that contains the user's group memberships. `memberOf` is a standard attribute for this purpose in Active Directory environments.
- Persistence: This environment variable is a `ConfigVar` variable.

## SCIM [​](https://docs.openwebui.com/reference/env-configuration/\#scim "Direct link to SCIM")

#### `SCIM_ENABLED` [​](https://docs.openwebui.com/reference/env-configuration/\#scim_enabled "Direct link to scim_enabled")

- Type: `bool`
- Default: `False`
- Description: Enables or disables SCIM 2.0 (System for Cross-domain Identity Management) support for automated user and group provisioning from identity providers like Okta, Azure AD, and Google Workspace.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SCIM_TOKEN` [​](https://docs.openwebui.com/reference/env-configuration/\#scim_token "Direct link to scim_token")

- Type: `str`
- Default: `""`
- Description: Sets the bearer token for SCIM authentication. This token must be provided by identity providers when making SCIM API requests. Generate a secure random token (e.g., using `openssl rand -base64 32`) and configure it in both Open WebUI and your identity provider.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `SCIM_AUTH_PROVIDER` [​](https://docs.openwebui.com/reference/env-configuration/\#scim_auth_provider "Direct link to scim_auth_provider")

- Type: `str`
- Default: `""`
- Description: Specifies the OAuth provider name to associate with SCIM `externalId` values (e.g., `microsoft`, `oidc`). When set, SCIM operations store and look up `externalId` under this provider key in the user's `scim` JSON field, enabling account linking between SCIM-provisioned identities and OAuth logins. A warning is logged on startup if SCIM is enabled but this variable is not set.

## User Permissions [​](https://docs.openwebui.com/reference/env-configuration/\#user-permissions "Direct link to User Permissions")

### Chat Permissions [​](https://docs.openwebui.com/reference/env-configuration/\#chat-permissions "Direct link to Chat Permissions")

#### `USER_PERMISSIONS_CHAT_CONTROLS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_controls "Direct link to user_permissions_chat_controls")

- Type: `bool`
- Default: `True`
- Description: Acts as a master switch to enable or disable the main "Controls" button and panel in the chat interface. **If this is set to False, users will not see the Controls button, and the granular permissions below will have no effect**.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_VALVES` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_valves "Direct link to user_permissions_chat_valves")

- Type: `bool`
- Default: `True`
- Description: When `USER_PERMISSIONS_CHAT_CONTROLS` is enabled, this setting specifically controls the visibility of the "Valves" section within the chat controls panel.

#### `USER_PERMISSIONS_CHAT_SYSTEM_PROMPT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_system_prompt "Direct link to user_permissions_chat_system_prompt")

- Type: `bool`
- Default: `True`
- Description: When `USER_PERMISSIONS_CHAT_CONTROLS` is enabled, this setting specifically controls the visibility of the customizable "System Prompt" section within the chat controls panel, folders and the user settings.

#### `USER_PERMISSIONS_CHAT_PARAMS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_params "Direct link to user_permissions_chat_params")

- Type: `bool`
- Default: `True`
- Description: When `USER_PERMISSIONS_CHAT_CONTROLS` is enabled, this setting specifically controls the visibility of the "Advanced Parameters" section within the chat controls panel.

#### `USER_PERMISSIONS_CHAT_FILE_UPLOAD` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_file_upload "Direct link to user_permissions_chat_file_upload")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to upload files to chats.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_WEB_UPLOAD` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_web_upload "Direct link to user_permissions_chat_web_upload")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to attach web pages (URLs) in chats via the "Attach Webpage" option. When set to `False`, the "Attach Webpage" button is hidden for non-admin users. Also configurable per-group in **Admin Panel → Users → Groups → Permissions → Chat Permissions → Allow Web Upload**.

#### `USER_PERMISSIONS_CHAT_DELETE` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_delete "Direct link to user_permissions_chat_delete")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to delete chats.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_EDIT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_edit "Direct link to user_permissions_chat_edit")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to edit chats.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_IMPORT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_import "Direct link to user_permissions_chat_import")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to import chats (uploading a previously exported chat back into Open WebUI). When disabled, non-admins cannot import chats.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_DELETE_MESSAGE` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_delete_message "Direct link to user_permissions_chat_delete_message")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to delete individual messages within chats. This provides granular control over message deletion capabilities separate from full chat deletion.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_CONTINUE_RESPONSE` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_continue_response "Direct link to user_permissions_chat_continue_response")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to continue AI responses. When disabled, users cannot use the "Continue Response" button, which helps prevent potential system prompt leakage through response continuation manipulation.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_REGENERATE_RESPONSE` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_regenerate_response "Direct link to user_permissions_chat_regenerate_response")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to regenerate AI responses. Controls access to both the standard regenerate button and the guided regeneration menu.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_RATE_RESPONSE` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_rate_response "Direct link to user_permissions_chat_rate_response")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to rate AI responses using the thumbs up/down feedback system. This controls access to the response rating functionality for evaluation and feedback collection.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_STT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_stt "Direct link to user_permissions_chat_stt")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to use Speech-to-Text in chats.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_TTS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_tts "Direct link to user_permissions_chat_tts")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to use Text-to-Speech in chats.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_CALL` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_call "Direct link to user_permissions_chat_call")

- Type: `str`
- Default: `True`
- Description: Enables or disables user permission to make calls in chats.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_MULTIPLE_MODELS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_multiple_models "Direct link to user_permissions_chat_multiple_models")

- Type: `str`
- Default: `True`
- Description: Enables or disables user permission to use multiple models in chats.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_TEMPORARY` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_temporary "Direct link to user_permissions_chat_temporary")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user permission to create temporary chats. **Note:** Temporary chats disable backend document parsing for privacy.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_TEMPORARY_ENFORCED` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_temporary_enforced "Direct link to user_permissions_chat_temporary_enforced")

- Type: `str`
- Default: `False`
- Description: Enables or disables enforced temporary chats for users.
- Persistence: This environment variable is a `ConfigVar` variable.

### Feature Permissions [​](https://docs.openwebui.com/reference/env-configuration/\#feature-permissions "Direct link to Feature Permissions")

#### `USER_PERMISSIONS_FEATURES_DIRECT_TOOL_SERVERS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_direct_tool_servers "Direct link to user_permissions_features_direct_tool_servers")

- Type: `str`
- Default: `False`
- Description: Enables or disables user permission to access direct tool servers.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_FEATURES_WEB_SEARCH` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_web_search "Direct link to user_permissions_features_web_search")

- Type: `str`
- Default: `True`
- Description: Enables or disables user permission to use the web search feature.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_FEATURES_IMAGE_GENERATION` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_image_generation "Direct link to user_permissions_features_image_generation")

- Type: `str`
- Default: `True`
- Description: Enables or disables user permission to use the image generation feature.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_FEATURES_CODE_INTERPRETER` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_code_interpreter "Direct link to user_permissions_features_code_interpreter")

- Type: `str`
- Default: `True`
- Description: Enables or disables user permission to use code interpreter feature.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_FEATURES_MEMORIES` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_memories "Direct link to user_permissions_features_memories")

- Type: `str`
- Default: `True`
- Description: Enables or disables user permission to use the [memory feature](https://docs.openwebui.com/features/chat-conversations/memory).
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_FEATURES_AUTOMATIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_automations "Direct link to user_permissions_features_automations")

- Type: `str`
- Default: `False`
- Description: Enables or disables Automations access for non-admin users. When enabled, users can access `/automations` and manage their own scheduled automations.
- Persistence: This environment variable is a `ConfigVar` variable.

info

This setting maps to **Features > Automations** in RBAC permissions.

- Non-admin users need this permission to access and use Automations.
- Admin users are exempt from this specific permission check.

See [Permissions](https://docs.openwebui.com/features/authentication-access/rbac/permissions#4-features-permissions) for role/permission behavior.

#### `USER_PERMISSIONS_FEATURES_CALENDAR` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_calendar "Direct link to user_permissions_features_calendar")

- Type: `str`
- Default: `True`
- Description: Enables or disables Calendar access for non-admin users. When enabled, users can access the Calendar feature to create calendars, manage events, and view shared calendars.
- Persistence: This environment variable is a `ConfigVar` variable.

info

This setting maps to **Features > Calendar** in RBAC permissions.

- Non-admin users need this permission to access and use Calendar.
- Admin users are exempt from this specific permission check.

See [Permissions](https://docs.openwebui.com/features/authentication-access/rbac/permissions#4-features-permissions) for role/permission behavior.

#### `USER_PERMISSIONS_FEATURES_FOLDERS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_folders "Direct link to user_permissions_features_folders")

- Type: `str`
- Default: `True`
- Description: Enables or disables the visibility of the Folders feature (chat sidebar) to users.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_FEATURES_NOTES` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_notes "Direct link to user_permissions_features_notes")

- Type: `str`
- Default: `True`
- Description: Enables or disables the visibility of the Notes feature to users.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_FEATURES_CHANNELS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_channels "Direct link to user_permissions_features_channels")

- Type: `str`
- Default: `True`
- Description: Enables or disables the ability for users to create their own group channels.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_FEATURES_USER_WEBHOOKS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_user_webhooks "Direct link to user_permissions_features_user_webhooks")

- Type: `str`
- Default: `False`
- Description: Enables or disables the ability for users to set their own personal webhook URL (under **Settings > Account**) for notifications. Disabled by default.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_FEATURES_API_KEYS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_features_api_keys "Direct link to user_permissions_features_api_keys")

- Type: `bool`
- Default: `False`
- Description: Sets the permission for API key creation feature for users. When enabled, users will have the ability to create and manage API keys for programmatic access.
- Persistence: This environment variable is a `ConfigVar` variable.

info

For API Key creation (and the API keys themselves):

1. This setting controls API key creation permission for non-admin users (directly or via User Groups)
2. API keys must also be globally enabled using `ENABLE_API_KEYS`

**Note:** Administrators can generate API keys whenever `ENABLE_API_KEYS` is enabled, even without `features.api_keys`. See the [API Keys](https://docs.openwebui.com/features/authentication-access/api-keys) guide for detailed setup instructions.

### Workspace Permissions [​](https://docs.openwebui.com/reference/env-configuration/\#workspace-permissions "Direct link to Workspace Permissions")

#### `USER_PERMISSIONS_WORKSPACE_MODELS_ACCESS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_models_access "Direct link to user_permissions_workspace_models_access")

- Type: `bool`
- Default: `False`
- Description: Enables or disables user permission to access workspace models.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_KNOWLEDGE_ACCESS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_knowledge_access "Direct link to user_permissions_workspace_knowledge_access")

- Type: `bool`
- Default: `False`
- Description: Enables or disables user permission to access workspace knowledge.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_PROMPTS_ACCESS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_prompts_access "Direct link to user_permissions_workspace_prompts_access")

- Type: `bool`
- Default: `False`
- Description: Enables or disables user permission to access workspace prompts.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_TOOLS_ACCESS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_tools_access "Direct link to user_permissions_workspace_tools_access")

- Type: `bool`
- Default: `False`
- Description: Enables or disables user permission to access workspace tools.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_SKILLS_ACCESS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_skills_access "Direct link to user_permissions_workspace_skills_access")

- Type: `bool`
- Default: `False`
- Description: Enables or disables user permission to access workspace skills.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_SKILLS_IMPORT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_skills_import "Direct link to user_permissions_workspace_skills_import")

- Type: `bool`
- Default: `False`
- Description: Enables or disables user permission to **import** skills into the Skills workspace.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_SKILLS_EXPORT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_skills_export "Direct link to user_permissions_workspace_skills_export")

- Type: `bool`
- Default: `False`
- Description: Enables or disables user permission to **export** skills from the Skills workspace.
- Persistence: This environment variable is a `ConfigVar` variable.

### Sharing (Private) [​](https://docs.openwebui.com/reference/env-configuration/\#sharing-private "Direct link to Sharing (Private)")

These settings control whether users can share workspace items with other users **privately** (non-public sharing).

#### `USER_PERMISSIONS_WORKSPACE_MODELS_ALLOW_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_models_allow_sharing "Direct link to user_permissions_workspace_models_allow_sharing")

- Type: `str`
- Default: `False`
- Description: Enables or disables **private sharing** of workspace models.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_KNOWLEDGE_ALLOW_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_knowledge_allow_sharing "Direct link to user_permissions_workspace_knowledge_allow_sharing")

- Type: `str`
- Default: `False`
- Description: Enables or disables **private sharing** of workspace knowledge.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_PROMPTS_ALLOW_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_prompts_allow_sharing "Direct link to user_permissions_workspace_prompts_allow_sharing")

- Type: `str`
- Default: `False`
- Description: Enables or disables **private sharing** of workspace prompts.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_TOOLS_ALLOW_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_tools_allow_sharing "Direct link to user_permissions_workspace_tools_allow_sharing")

- Type: `str`
- Default: `False`
- Description: Enables or disables **private sharing** of workspace tools.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_SKILLS_ALLOW_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_skills_allow_sharing "Direct link to user_permissions_workspace_skills_allow_sharing")

- Type: `str`
- Default: `False`
- Description: Enables or disables **private sharing** of workspace skills.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_NOTES_ALLOW_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_notes_allow_sharing "Direct link to user_permissions_notes_allow_sharing")

- Type: `str`
- Default: `True`
- Description: Enables or disables **private sharing** of notes.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_FOLDERS_ALLOW_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_folders_allow_sharing "Direct link to user_permissions_folders_allow_sharing")

- Type: `str`
- Default: `False`
- Description: Enables or disables **private sharing** of chat folders with specific users or groups.
- Persistence: This environment variable is a `ConfigVar` variable.

### Sharing (Public) [​](https://docs.openwebui.com/reference/env-configuration/\#sharing-public "Direct link to Sharing (Public)")

These settings control whether users can share workspace items **publicly**.

#### `USER_PERMISSIONS_WORKSPACE_MODELS_ALLOW_PUBLIC_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_models_allow_public_sharing "Direct link to user_permissions_workspace_models_allow_public_sharing")

- Type: `str`
- Default: `False`
- Description: Enables or disables **public sharing** of workspace models.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_KNOWLEDGE_ALLOW_PUBLIC_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_knowledge_allow_public_sharing "Direct link to user_permissions_workspace_knowledge_allow_public_sharing")

- Type: `str`
- Default: `False`
- Description: Enables or disables **public sharing** of workspace knowledge.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_PROMPTS_ALLOW_PUBLIC_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_prompts_allow_public_sharing "Direct link to user_permissions_workspace_prompts_allow_public_sharing")

- Type: `str`
- Default: `False`
- Description: Enables or disables **public sharing** of workspace prompts.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_TOOLS_ALLOW_PUBLIC_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_tools_allow_public_sharing "Direct link to user_permissions_workspace_tools_allow_public_sharing")

- Type: `str`
- Default: `False`
- Description: Enables or disables **public sharing** of workspace tools.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_SKILLS_ALLOW_PUBLIC_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_skills_allow_public_sharing "Direct link to user_permissions_workspace_skills_allow_public_sharing")

- Type: `str`
- Default: `False`
- Description: Enables or disables **public sharing** of workspace skills.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_NOTES_ALLOW_PUBLIC_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_notes_allow_public_sharing "Direct link to user_permissions_notes_allow_public_sharing")

- Type: `str`
- Default: `True`
- Description: Enables or disables **public sharing** of notes.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CHAT_ALLOW_PUBLIC_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_chat_allow_public_sharing "Direct link to user_permissions_chat_allow_public_sharing")

- Type: `bool`
- Default: `False`
- Description: Enables or disables **public sharing** of chat conversations. When disabled, the access-control selector in the chat share modal hides the "Public" option for non-admin users. They can still create share links scoped to specific users or groups, but cannot make a chat reachable by anyone with the link. Admins always retain the ability to share chats publicly. Requires `USER_PERMISSIONS_CHAT_SHARE` (Share Chat) to be enabled for the user. Configurable per-group in **Admin Panel → Users → Groups → Permissions → Chats Public Sharing**.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_CALENDAR_ALLOW_PUBLIC_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_calendar_allow_public_sharing "Direct link to user_permissions_calendar_allow_public_sharing")

- Type: `bool`
- Default: `False`
- Description: Enables or disables **public sharing** of calendars. When disabled, non-admin owners cannot attach a wildcard `read` or `write` access grant to a calendar on create or update. Public principals are silently filtered out of the access grant list, so a calendar cannot be made readable or writable by every user with the Calendar feature without an admin-granted sharing permission. Per-user and per-group grants remain unaffected. Admins always retain the ability to share calendars publicly. Configurable per-group in **Admin Panel → Users → Groups → Permissions → Calendars Public Sharing**.
- Persistence: This environment variable is a `ConfigVar` variable.

### Access Grants [​](https://docs.openwebui.com/reference/env-configuration/\#access-grants "Direct link to Access Grants")

#### `USER_PERMISSIONS_ACCESS_GRANTS_ALLOW_USERS` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_access_grants_allow_users "Direct link to user_permissions_access_grants_allow_users")

- Type: `bool`
- Default: `True`
- Description: Controls whether non-admin users can share resources (knowledge bases, models, prompts, notes, skills, and tools) with **specific individual users**. When set to `False`, individual user grants are silently stripped from access grant lists; group sharing and public sharing remain unaffected. Admins always retain the ability to share with individual users regardless of this setting. Also configurable per-group in **Admin Panel → Users → Groups → Permissions → Access Grants → Allow Sharing With Users**.

### Import / Export [​](https://docs.openwebui.com/reference/env-configuration/\#import--export "Direct link to Import / Export")

#### `USER_PERMISSIONS_WORKSPACE_MODELS_IMPORT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_models_import "Direct link to user_permissions_workspace_models_import")

- Type: `str`
- Default: `True`
- Description: Enables or disables user permission to import workspace models.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_MODELS_EXPORT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_models_export "Direct link to user_permissions_workspace_models_export")

- Type: `str`
- Default: `True`
- Description: Enables or disables user permission to export workspace models.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_PROMPTS_IMPORT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_prompts_import "Direct link to user_permissions_workspace_prompts_import")

- Type: `str`
- Default: `True`
- Description: Enables or disables user permission to import workspace prompts.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_PROMPTS_EXPORT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_prompts_export "Direct link to user_permissions_workspace_prompts_export")

- Type: `str`
- Default: `True`
- Description: Enables or disables user permission to export workspace prompts.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_TOOLS_IMPORT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_tools_import "Direct link to user_permissions_workspace_tools_import")

- Type: `str`
- Default: `False`
- Description: Enables or disables user permission to import workspace tools.
- Persistence: This environment variable is a `ConfigVar` variable.

#### `USER_PERMISSIONS_WORKSPACE_TOOLS_EXPORT` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_workspace_tools_export "Direct link to user_permissions_workspace_tools_export")

- Type: `str`
- Default: `False`
- Description: Enables or disables user permission to export workspace tools.
- Persistence: This environment variable is a `ConfigVar` variable.

### Settings Permissions [​](https://docs.openwebui.com/reference/env-configuration/\#settings-permissions "Direct link to Settings Permissions")

#### `USER_PERMISSIONS_SETTINGS_INTERFACE` [​](https://docs.openwebui.com/reference/env-configuration/\#user_permissions_settings_interface "Direct link to user_permissions_settings_interface")

- Type: `bool`
- Default: `True`
- Description: Enables or disables user / group permissions for the interface settings section in the Settings Modal.
- Persistence: This environment variable is a `ConfigVar` variable.

## Misc Environment Variables [​](https://docs.openwebui.com/reference/env-configuration/\#misc-environment-variables "Direct link to Misc Environment Variables")

These variables are not specific to Open WebUI but can still be valuable in certain contexts.

### Cloud Storage [​](https://docs.openwebui.com/reference/env-configuration/\#cloud-storage "Direct link to Cloud Storage")

#### `STORAGE_PROVIDER` [​](https://docs.openwebui.com/reference/env-configuration/\#storage_provider "Direct link to storage_provider")

- Type: `str`
- Options:
  - `s3`: uses the S3 client library and related environment variables mentioned in [Amazon S3 Storage](https://docs.openwebui.com/reference/env-configuration/#amazon-s3-storage)
  - `gcs`: uses the GCS client library and related environment variables mentioned in [Google Cloud Storage](https://docs.openwebui.com/reference/env-configuration/#google-cloud-storage)
  - `azure`: uses the Azure client library and related environment variables mentioned in [Microsoft Azure Storage](https://docs.openwebui.com/reference/env-configuration/#microsoft-azure-storage)
- Default: empty string (' '), which defaults to `local`
- Description: Sets the storage provider.

#### `STORAGE_LOCAL_CACHE` [​](https://docs.openwebui.com/reference/env-configuration/\#storage_local_cache "Direct link to storage_local_cache")

- Type: `bool`
- Default: `True`
- Description: Controls whether a local copy of a file is retained after it has been uploaded to a cloud storage provider (S3, GCS, Azure). When `True` (the default), the local cache copy in `UPLOAD_DIR` is preserved, matching previous behavior. When `False`, the local copy is removed automatically once processing completes, so files live only in cloud storage. Has no effect when `STORAGE_PROVIDER=local`.

#### Amazon S3 Storage [​](https://docs.openwebui.com/reference/env-configuration/\#amazon-s3-storage "Direct link to Amazon S3 Storage")

#### `S3_ACCESS_KEY_ID` [​](https://docs.openwebui.com/reference/env-configuration/\#s3_access_key_id "Direct link to s3_access_key_id")

- Type: `str`
- Description: Sets the access key ID for S3 storage.

#### `S3_ADDRESSING_STYLE` [​](https://docs.openwebui.com/reference/env-configuration/\#s3_addressing_style "Direct link to s3_addressing_style")

- Type: `str`
- Default: `None`
- Description: Specifies the addressing style to use for S3 storage (e.g., 'path', 'virtual').

#### `S3_BUCKET_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#s3_bucket_name "Direct link to s3_bucket_name")

- Type: `str`
- Description: Sets the bucket name for S3 storage.

#### `S3_ENDPOINT_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#s3_endpoint_url "Direct link to s3_endpoint_url")

- Type: `str`
- Description: Sets the endpoint URL for S3 storage.

info

If the endpoint is an S3-compatible provider like MinIO that uses a TLS certificate signed by a private CA, set the environment variable `AWS_CA_BUNDLE` to the path of your PEM-encoded CA certificates file. See the [Amazon SDK Docs](https://docs.aws.amazon.com/sdkref/latest/guide/feature-gen-config.html) for more information.

#### `S3_KEY_PREFIX` [​](https://docs.openwebui.com/reference/env-configuration/\#s3_key_prefix "Direct link to s3_key_prefix")

- Type: `str`
- Description: Sets the key prefix for a S3 object.

#### `S3_REGION_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#s3_region_name "Direct link to s3_region_name")

- Type: `str`
- Description: Sets the region name for S3 storage.

#### `S3_SECRET_ACCESS_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#s3_secret_access_key "Direct link to s3_secret_access_key")

- Type: `str`
- Description: Sets the secret access key for S3 storage.

#### `S3_USE_ACCELERATE_ENDPOINT` [​](https://docs.openwebui.com/reference/env-configuration/\#s3_use_accelerate_endpoint "Direct link to s3_use_accelerate_endpoint")

- Type: `str`
- Default: `False`
- Description: Specifies whether to use the accelerated endpoint for S3 storage.

#### `S3_ENABLE_TAGGING` [​](https://docs.openwebui.com/reference/env-configuration/\#s3_enable_tagging "Direct link to s3_enable_tagging")

- Type: `str`
- Default: `False`
- Description: Enables S3 object tagging after uploads for better organization, searching, and integration with file management policies. Always set to `False` when using Cloudflare R2, as R2 does not support object tagging.

#### Google Cloud Storage [​](https://docs.openwebui.com/reference/env-configuration/\#google-cloud-storage "Direct link to Google Cloud Storage")

#### `GOOGLE_APPLICATION_CREDENTIALS_JSON` [​](https://docs.openwebui.com/reference/env-configuration/\#google_application_credentials_json "Direct link to google_application_credentials_json")

- Type: `str`
- Description: Contents of Google Application Credentials JSON file.
  - Optional: if not provided, credentials will be taken from the environment. User credentials if run locally and Google Metadata server if run on a Google Compute Engine.
  - A file can be generated for a service account following this [guide.](https://developers.google.com/workspace/guides/create-credentials#service-account)

#### `GCS_BUCKET_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#gcs_bucket_name "Direct link to gcs_bucket_name")

- Type: `str`
- Description: Sets the bucket name for Google Cloud Storage. Bucket must already exist.

#### Microsoft Azure Storage [​](https://docs.openwebui.com/reference/env-configuration/\#microsoft-azure-storage "Direct link to Microsoft Azure Storage")

#### `AZURE_STORAGE_ENDPOINT` [​](https://docs.openwebui.com/reference/env-configuration/\#azure_storage_endpoint "Direct link to azure_storage_endpoint")

- Type: `str`
- Description: Sets the endpoint URL for Azure Storage.

#### `AZURE_STORAGE_CONTAINER_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#azure_storage_container_name "Direct link to azure_storage_container_name")

- Type: `str`
- Description: Sets the container name for Azure Storage.

#### `AZURE_STORAGE_KEY` [​](https://docs.openwebui.com/reference/env-configuration/\#azure_storage_key "Direct link to azure_storage_key")

- Type: `str`
- Description: Set the access key for Azure Storage.
  - Optional: if not provided, credentials will be taken from the environment. User credentials if run locally and Managed Identity if run in Azure services.

### OpenTelemetry Configuration [​](https://docs.openwebui.com/reference/env-configuration/\#opentelemetry-configuration "Direct link to OpenTelemetry Configuration")

Additional Dependencies May Be Required

OpenTelemetry support requires additional Python dependencies that **may not be included by default** depending on your installation method (e.g., standard `pip install open-webui` versus Docker images).

If you encounter `ImportError` or missing module errors related to OpenTelemetry, you may need to install them manually:

```
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp
```

#### `ENABLE_OTEL` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_otel "Direct link to enable_otel")

- Type: `bool`
- Default: `False`
- Description: Enables or disables OpenTelemetry for observability. When enabled, tracing, metrics, and logging data can be collected and exported to an OTLP endpoint.

#### `ENABLE_OTEL_TRACES` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_otel_traces "Direct link to enable_otel_traces")

- Type: `bool`
- Default: `False`
- Description: Enables or disables OpenTelemetry traces collection and export. This variable works in conjunction with `ENABLE_OTEL`.

#### `ENABLE_OTEL_METRICS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_otel_metrics "Direct link to enable_otel_metrics")

- Type: `bool`
- Default: `False`
- Description: Enables or disables OpenTelemetry metrics collection and export. This variable works in conjunction with `ENABLE_OTEL`.

#### `ENABLE_OTEL_LOGS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_otel_logs "Direct link to enable_otel_logs")

- Type: `bool`
- Default: `False`
- Description: Enables or disables OpenTelemetry logging export. When enabled, application logs are sent to the configured OTLP endpoint. This variable works in conjunction with `ENABLE_OTEL`.

#### `OTEL_EXPORTER_OTLP_ENDPOINT` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_exporter_otlp_endpoint "Direct link to otel_exporter_otlp_endpoint")

- Type: `str`
- Default: `http://localhost:4317`
- Description: Specifies the default OTLP (OpenTelemetry Protocol) endpoint for exporting traces, metrics, and logs. This can be overridden for metrics if `OTEL_METRICS_EXPORTER_OTLP_ENDPOINT` is set, and for logs if `OTEL_LOGS_EXPORTER_OTLP_ENDPOINT` is set.

#### `OTEL_METRICS_EXPORTER_OTLP_ENDPOINT` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_metrics_exporter_otlp_endpoint "Direct link to otel_metrics_exporter_otlp_endpoint")

- Type: `str`
- Default: Value of `OTEL_EXPORTER_OTLP_ENDPOINT`
- Description: Specifies the dedicated OTLP endpoint for exporting OpenTelemetry metrics. If not set, it defaults to the value of `OTEL_EXPORTER_OTLP_ENDPOINT`. This is useful when separate endpoints for traces and metrics are used.

#### `OTEL_LOGS_EXPORTER_OTLP_ENDPOINT` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_logs_exporter_otlp_endpoint "Direct link to otel_logs_exporter_otlp_endpoint")

- Type: `str`
- Default: Value of `OTEL_EXPORTER_OTLP_ENDPOINT`
- Description: Specifies the dedicated OTLP endpoint for exporting OpenTelemetry logs. If not set, it defaults to the value of `OTEL_EXPORTER_OTLP_ENDPOINT`. This is useful when separate endpoints for logs, traces, and metrics are used.

#### `OTEL_EXPORTER_OTLP_INSECURE` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_exporter_otlp_insecure "Direct link to otel_exporter_otlp_insecure")

- Type: `bool`
- Default: `False`
- Description: If set to `True`, the OTLP exporter will use an insecure connection (e.g., HTTP for gRPC) for traces. For metrics, its behavior is governed by `OTEL_METRICS_EXPORTER_OTLP_INSECURE`, and for logs by `OTEL_LOGS_EXPORTER_OTLP_INSECURE`.

#### `OTEL_METRICS_EXPORTER_OTLP_INSECURE` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_metrics_exporter_otlp_insecure "Direct link to otel_metrics_exporter_otlp_insecure")

- Type: `bool`
- Default: Value of `OTEL_EXPORTER_OTLP_INSECURE`
- Description: If set to `True`, the OTLP exporter will use an insecure connection for metrics. If not specified, it uses the value of `OTEL_EXPORTER_OTLP_INSECURE`.

#### `OTEL_LOGS_EXPORTER_OTLP_INSECURE` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_logs_exporter_otlp_insecure "Direct link to otel_logs_exporter_otlp_insecure")

- Type: `bool`
- Default: Value of `OTEL_EXPORTER_OTLP_INSECURE`
- Description: If set to `True`, the OTLP exporter will use an insecure connection for logs. If not specified, it uses the value of `OTEL_EXPORTER_OTLP_INSECURE`.

#### `OTEL_SERVICE_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_service_name "Direct link to otel_service_name")

- Type: `str`
- Default: `open-webui`
- Description: Sets the service name that will be reported to your OpenTelemetry collector or observability platform. This helps identify your Open WebUI instance.

#### `OTEL_RESOURCE_ATTRIBUTES` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_resource_attributes "Direct link to otel_resource_attributes")

- Type: `str`
- Default: Empty string (' ')
- Description: Allows you to define additional resource attributes to be attached to all telemetry data, in a comma-separated `key1=val1,key2=val2` format.

#### `OTEL_TRACES_SAMPLER` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_traces_sampler "Direct link to otel_traces_sampler")

- Type: `str`
- Options: `parentbased_always_on`, `always_on`, `always_off`, `parentbased_always_off`, etc.
- Default: `parentbased_always_on`
- Description: Configures the sampling strategy for OpenTelemetry traces. This determines which traces are collected and exported to reduce data volume.

#### `OTEL_BASIC_AUTH_USERNAME` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_basic_auth_username "Direct link to otel_basic_auth_username")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the username for basic authentication with the default OTLP endpoint. This applies to traces, and by default, to metrics and logs unless overridden by their specific authentication variables.

#### `OTEL_BASIC_AUTH_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_basic_auth_password "Direct link to otel_basic_auth_password")

- Type: `str`
- Default: Empty string (' ')
- Description: Sets the password for basic authentication with the default OTLP endpoint. This applies to traces, and by default, to metrics and logs unless overridden by their specific authentication variables.

#### `OTEL_METRICS_EXPORT_INTERVAL_MILLIS` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_metrics_export_interval_millis "Direct link to otel_metrics_export_interval_millis")

- Type: `int`
- Default: `10000` (10 seconds)
- Description: Controls how often OpenTelemetry metrics are exported, in milliseconds. The default of 10 seconds produces approximately 6 data points per minute. Lower this value for higher resolution, or increase it to reduce cost on platforms that charge per data point (e.g. Grafana Cloud recommends staying below 1 DPM: set to `60000` for one export per minute).

#### `OTEL_METRICS_BASIC_AUTH_USERNAME` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_metrics_basic_auth_username "Direct link to otel_metrics_basic_auth_username")

- Type: `str`
- Default: Value of `OTEL_BASIC_AUTH_USERNAME`
- Description: Sets the username for basic authentication specifically for the OTLP metrics endpoint. If not specified, it uses the value of `OTEL_BASIC_AUTH_USERNAME`.

#### `OTEL_METRICS_BASIC_AUTH_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_metrics_basic_auth_password "Direct link to otel_metrics_basic_auth_password")

- Type: `str`
- Default: Value of `OTEL_BASIC_AUTH_PASSWORD`
- Description: Sets the password for basic authentication specifically for the OTLP metrics endpoint. If not specified, it uses the value of `OTEL_BASIC_AUTH_PASSWORD`.

#### `OTEL_LOGS_BASIC_AUTH_USERNAME` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_logs_basic_auth_username "Direct link to otel_logs_basic_auth_username")

- Type: `str`
- Default: Value of `OTEL_BASIC_AUTH_USERNAME`
- Description: Sets the username for basic authentication specifically for the OTLP logs endpoint. If not specified, it uses the value of `OTEL_BASIC_AUTH_USERNAME`.

#### `OTEL_LOGS_BASIC_AUTH_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_logs_basic_auth_password "Direct link to otel_logs_basic_auth_password")

- Type: `str`
- Default: Value of `OTEL_BASIC_AUTH_PASSWORD`
- Description: Sets the password for basic authentication specifically for the OTLP logs endpoint. If not specified, it uses the value of `OTEL_BASIC_AUTH_PASSWORD`.

#### `OTEL_OTLP_SPAN_EXPORTER` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_otlp_span_exporter "Direct link to otel_otlp_span_exporter")

- Type: `str`
- Options: `grpc`, `http`
- Default: `grpc`
- Description: Specifies the default protocol for exporting OpenTelemetry traces (gRPC or HTTP). This can be overridden for metrics if `OTEL_METRICS_OTLP_SPAN_EXPORTER` is set, and for logs if `OTEL_LOGS_OTLP_SPAN_EXPORTER` is set.

#### `OTEL_METRICS_OTLP_SPAN_EXPORTER` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_metrics_otlp_span_exporter "Direct link to otel_metrics_otlp_span_exporter")

- Type: `str`
- Options: `grpc`, `http`
- Default: Value of `OTEL_OTLP_SPAN_EXPORTER`
- Description: Specifies the protocol for exporting OpenTelemetry metrics (gRPC or HTTP). If not specified, it uses the value of `OTEL_OTLP_SPAN_EXPORTER`.

#### `OTEL_LOGS_OTLP_SPAN_EXPORTER` [​](https://docs.openwebui.com/reference/env-configuration/\#otel_logs_otlp_span_exporter "Direct link to otel_logs_otlp_span_exporter")

- Type: `str`
- Options: `grpc`, `http`
- Default: Value of `OTEL_OTLP_SPAN_EXPORTER`
- Description: Specifies the protocol for exporting OpenTelemetry logs (gRPC or HTTP). If not specified, it uses the value of `OTEL_OTLP_SPAN_EXPORTER`.

### Database Pool [​](https://docs.openwebui.com/reference/env-configuration/\#database-pool "Direct link to Database Pool")

#### `DATABASE_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#database_url "Direct link to database_url")

- Type: `str`
- Default: `sqlite:///${DATA_DIR}/webui.db`
- Description: Specifies the complete database connection URL, following SQLAlchemy's URL scheme. This variable takes precedence over individual database connection parameters if explicitly set.

info

**For PostgreSQL support, ensure you installed with `pip install open-webui[all]` instead of the basic installation.**
Supports SQLite, Postgres, and encrypted SQLite via SQLCipher.
**Changing the URL does not migrate data between databases.**

Documentation on the URL scheme is available [here](https://docs.sqlalchemy.org/en/20/core/engines.html#database-urls).

If your database password contains special characters, please ensure they are properly URL-encoded. For example, a password like `p@ssword` should be encoded as `p%40ssword`.

For configuration using individual parameters or encrypted SQLite, see the relevant sections below.

Single-user / single-replica on local disk? The default is fine.

The default `sqlite:///${DATA_DIR}/webui.db` is a perfectly good choice for personal use, evaluation, home-lab setups, and small single-replica deployments, **as long as `DATA_DIR` lives on a locally-attached SSD/NVMe**. No migration needed. The rest of this callout is for operators running on network storage or scaling out.

SQLite is only supported on locally-attached SSD/NVMe

Running SQLite on **NFS, CIFS/SMB, Azure Files, GlusterFS, CephFS, or any Kubernetes PersistentVolumeClaim backed by network storage is not supported** (this is SQLite upstream's own position, see [SQLite FAQ #5](https://www.sqlite.org/faq.html#q5)), and under the async backend (0.9.0+) it will produce pool-timeout errors (`QueuePool limit of size N overflow M reached`), multi-minute stalls, WAL deadlocks, and potential database corruption.

**For multi-replica, multi-worker, Kubernetes, Docker Swarm, or any deployment where `DATA_DIR` is on shared/network storage, set `DATABASE_URL` to a PostgreSQL URL:**

```text
DATABASE_URL=postgresql://user:password@host:5432/openwebui
```

See [Performance → Disk I/O Latency](https://docs.openwebui.com/troubleshooting/performance#disk-io-latency-sqlite--storage) for the full mechanism (fsync + async pool saturation) and [Scaling → Step 1](https://docs.openwebui.com/getting-started/advanced-topics/scaling#step-1-switch-to-postgresql) for migration guidance.

Multi-replica / multi-worker deployments REQUIRE PostgreSQL

For multi-replica or high-availability deployments (Kubernetes, Docker Swarm), you **must** use an external database (PostgreSQL) instead of SQLite. SQLite does not support concurrent writes from multiple instances and will result in database corruption or data inconsistency. A shared SQLite file on NFS does not count as "supported"; it will still corrupt or deadlock. See the scaling guide linked above.

#### `ENABLE_DB_MIGRATIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_db_migrations "Direct link to enable_db_migrations")

- Type: `bool`
- Default: `True`
- Description: Controls whether database migrations are automatically run on startup. In multi-pod or multi-worker deployments, set this to `False` on all pods except one to designate a "master" pod responsible for migrations, preventing race conditions or schema corruption.

warning

**Required for Multi-Replica Setups**
For multi-replica or high-availability deployments (Kubernetes, Docker Swarm), you **MUST** use an external database (PostgreSQL) instead of SQLite. SQLite does not support concurrent writes from multiple instances and will result in database corruption or data inconsistency.

#### `DATABASE_TYPE` [​](https://docs.openwebui.com/reference/env-configuration/\#database_type "Direct link to database_type")

- Type: `str`
- Default: `None` (automatically set to `sqlite` if `DATABASE_URL` uses default SQLite path)
- Description: Specifies the database type (e.g., `sqlite`, `postgresql`, `sqlite+sqlcipher`). This is used in conjunction with other individual parameters to construct the `DATABASE_URL` if a complete `DATABASE_URL` is not explicitly defined.
- Persistence: No

#### `DATABASE_USER` [​](https://docs.openwebui.com/reference/env-configuration/\#database_user "Direct link to database_user")

- Type: `str`
- Default: `None`
- Description: Specifies the username for database authentication. This is used to construct the `DATABASE_URL` when a complete `DATABASE_URL` is not explicitly defined.
- Persistence: No

#### `DATABASE_ENABLE_IAM_TOKEN_AUTH` [​](https://docs.openwebui.com/reference/env-configuration/\#database_enable_iam_token_auth "Direct link to database_enable_iam_token_auth")

- Type: `bool`
- Default: `False`
- Description: When enabled, authenticate to an **AWS RDS** database using a short-lived **IAM auth token** (generated via boto3 `generate_db_auth_token`) instead of a static password. The token is refreshed automatically before it expires. **PostgreSQL only**, and the database host and user must be set. Requires `boto3` and AWS credentials/region available to the process (standard AWS SDK resolution).
- Persistence: No

#### `DATABASE_PASSWORD` [​](https://docs.openwebui.com/reference/env-configuration/\#database_password "Direct link to database_password")

- Type: `str`
- Default: `None`
- Description: Specifies the password for database authentication. This is used to construct the `DATABASE_URL` when a complete `DATABASE_URL` is not explicitly defined. If your password contains special characters, please ensure they are properly URL-encoded.
- Persistence: No

#### `DATABASE_HOST` [​](https://docs.openwebui.com/reference/env-configuration/\#database_host "Direct link to database_host")

- Type: `str`
- Default: `None`
- Description: Specifies the hostname or IP address of the database server. This is used to construct the `DATABASE_URL` when a complete `DATABASE_URL` is not explicitly defined.
- Persistence: No

#### `DATABASE_PORT` [​](https://docs.openwebui.com/reference/env-configuration/\#database_port "Direct link to database_port")

- Type: `int`
- Default: `None`
- Description: Specifies the port number of the database server. This is used to construct the `DATABASE_URL` when a complete `DATABASE_URL` is not explicitly defined.
- Persistence: No

#### `DATABASE_NAME` [​](https://docs.openwebui.com/reference/env-configuration/\#database_name "Direct link to database_name")

- Type: `str`
- Default: `None`
- Description: Specifies the name of the database to connect to. This is used to construct the `DATABASE_URL` when a complete `DATABASE_URL` is not explicitly defined.
- Persistence: No

info

When `DATABASE_URL` is not explicitly set, Open WebUI will attempt to construct it using a combination of `DATABASE_TYPE`, `DATABASE_USER`, `DATABASE_PASSWORD`, `DATABASE_HOST`, `DATABASE_PORT`, and `DATABASE_NAME`. For this automatic construction to occur, **all** of these individual parameters must be provided. If any are missing, the default `DATABASE_URL` (SQLite file) or any explicitly set `DATABASE_URL` will be used instead.

#### `DATABASE_USER_ACTIVE_STATUS_UPDATE_INTERVAL` [​](https://docs.openwebui.com/reference/env-configuration/\#database_user_active_status_update_interval "Direct link to database_user_active_status_update_interval")

- Type: `float`
- Default: `None`
- Description: Minimum interval, in seconds, between writes of a user's `last_active_at` timestamp to the database (this timestamp drives online/"active" presence, evaluated over a ~3-minute window). The write is throttled **per user**: within the interval, repeat activity does not hit the database.

Set this on every deployment, mandatory at scale

**With the default (`None`, or an invalid value which becomes `0.0`), throttling is disabled and the write is unthrottled: essentially every authenticated request issues its own `UPDATE users SET last_active_at = ...` plus a `COMMIT`.** On a busy instance this is a continuous flood of tiny write transactions that amplifies database load and consumes connection-pool capacity for no functional benefit. Presence only needs ~minute granularity.

Setting a positive interval collapses thousands of these writes into at most one per user per interval. This is **free performance for any setup** and is **required** for large/production deployments; leaving it unset is a common, avoidable database bottleneck.

- **Recommended:** a few hundred seconds, e.g. `300` to `500`. Presence accuracy stays within the interval, which is well inside the 3-minute active window.
- Applies regardless of database backend, and applies on weak hardware too (it only _reduces_ writes, there is no downside to setting it on a Raspberry Pi).
- Read once at startup; not a `ConfigVar` and not changeable from the Admin UI.

#### `DATABASE_ENABLE_SESSION_SHARING` [​](https://docs.openwebui.com/reference/env-configuration/\#database_enable_session_sharing "Direct link to database_enable_session_sharing")

- Type: `bool`
- Default: `False`
- Description: Controls database session sharing behavior. When enabled (`True`), `get_db_context` reuses existing database sessions, which can improve performance and scalability in high-concurrency environments. When disabled (`False`), new sessions are always created.

Recommendations by Database Type

- **SQLite:** Keep this setting **disabled** (default `False`). Enabling session sharing on SQLite with limited hardware resources may cause performance issues.
- **PostgreSQL:** Consider **enabling** this setting (`True`) for improved performance, especially in multi-user or high-concurrency deployments.

This setting is very deployment-specific. Users are encouraged to experiment based on their hardware specs and database choice to find the optimal configuration.

warning

Enabling this on low-spec hardware (e.g., Raspberry Pi, containers with limited CPU allocation) may cause significant slowdowns or timeouts. If you experience slow admin page loads or API timeouts after upgrading, ensure this setting is disabled.

### Encrypted SQLite with SQLCipher [​](https://docs.openwebui.com/reference/env-configuration/\#encrypted-sqlite-with-sqlcipher "Direct link to Encrypted SQLite with SQLCipher")

For enhanced security, Open WebUI supports at-rest encryption for its primary SQLite database using SQLCipher. This is recommended for deployments handling sensitive data where using a larger database like PostgreSQL is not needed.

Additional Dependencies Required

SQLCipher encryption requires additional dependencies that are **not included by default**. Before using this feature, you must install:

- The **SQLCipher system library** (e.g., `libsqlcipher-dev` on Debian/Ubuntu, `sqlcipher` on macOS via Homebrew)
- The **`sqlcipher3-wheels`** Python package (`pip install sqlcipher3-wheels`)

For Docker users, this means building a custom image with these dependencies included.

To enable encryption, you must configure two environment variables:

1. Set `DATABASE_TYPE="sqlite+sqlcipher"`.
2. Set `DATABASE_PASSWORD="your-secure-password"`.

When these are set and a full `DATABASE_URL` is **not** explicitly defined, Open WebUI will automatically create and use an encrypted database file at `./data/webui.db`.

danger

- The **`DATABASE_PASSWORD`** environment variable is **required** when using `sqlite+sqlcipher`.
- The **`DATABASE_TYPE`** variable tells Open WebUI which connection logic to use. Setting it to `sqlite+sqlcipher` activates the encryption feature.

Ensure the database password is kept secure, as it is needed to decrypt and access all application data.

Migrating Existing Data to SQLCipher

**Open WebUI does not support automatic migration from an unencrypted SQLite database to an encrypted SQLCipher database.** If you enable SQLCipher on an existing installation, the application will fail to read your existing unencrypted data.

To use SQLCipher with existing data, you must either start fresh (with users exporting/re-importing chats), manually migrate the database using external SQLite/SQLCipher tools, use filesystem-level encryption (LUKS/BitLocker) instead, or switch to PostgreSQL.

#### `DATABASE_SCHEMA` [​](https://docs.openwebui.com/reference/env-configuration/\#database_schema "Direct link to database_schema")

- Type: `str`
- Default: `None`
- Description: Specifies the database schema to connect to.

#### `DATABASE_POOL_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#database_pool_size "Direct link to database_pool_size")

- Type: `int`
- Default: `None`
- Description: Specifies the pooling strategy and size of the database pool. By default SQLAlchemy will automatically chose the proper pooling strategy for the selected database connection. A value of `0` disables pooling. A value larger `0` will set the pooling strategy to `QueuePool` and the pool size accordingly.

SQLite: unset does not mean "small". It falls back to 512

The documented default (`None`) only means "not set by you". On **SQLite**, current releases (0.9.x, async DB backend) substitute a large internal pool (currently **512** connections) when this is unset, not SQLAlchemy's small default. Each SQLite connection carries its own page cache (`DATABASE_SQLITE_PRAGMA_CACHE_SIZE`, ~64 MB by default) and mmap window (`DATABASE_SQLITE_PRAGMA_MMAP_SIZE`, ~256 MB by default), so peak memory scales with the number of simultaneously active connections. On a memory-constrained container this can OOM-kill the process during connection-heavy workflows (for example editing model or knowledge-base permissions and reloading a long model list). On small / low-spec deployments set this explicitly to a small value (e.g. `DATABASE_POOL_SIZE=8`) and lower the two PRAGMAs below. See [Performance → SQLite Memory Footprint on Constrained Containers](https://docs.openwebui.com/troubleshooting/performance#4-sqlite-memory-footprint-on-constrained-containers).

High-Concurrency Deployments

For deployments with many concurrent users, consider increasing both `DATABASE_POOL_SIZE` and `DATABASE_POOL_MAX_OVERFLOW`. A good starting point is `DATABASE_POOL_SIZE=15` and `DATABASE_POOL_MAX_OVERFLOW=20`.

**Important:** The combined total (`DATABASE_POOL_SIZE` \+ `DATABASE_POOL_MAX_OVERFLOW`) should remain well below your database server's `max_connections` limit. PostgreSQL defaults to 100 max connections, so keeping the combined total under 50-80 per Open WebUI instance is recommended to leave room for other clients and maintenance connections.

Pool Size Multiplies with Concurrency

**Each Open WebUI process maintains its own independent connection pool.** This applies whether you're running multiple Uvicorn workers (`UVICORN_WORKERS > 1`), multiple Kubernetes pods, Docker Swarm replicas, or any other multi-instance deployment.

The actual maximum number of database connections is:

```text
Total connections = (DATABASE_POOL_SIZE + DATABASE_POOL_MAX_OVERFLOW) × Number of processes/instances
```

For example, with `DATABASE_POOL_SIZE=15`, `DATABASE_POOL_MAX_OVERFLOW=20`, and 4 instances (whether workers, pods, or replicas), you could open up to **140 connections** (35 × 4).

When calculating pool settings, always account for this multiplier to avoid exhausting your database's `max_connections` limit. This is a fundamental limitation: connection pools cannot be shared across separate processes or containers.

SQLite on NFS / network storage, increasing the pool does not help

If you are seeing `QueuePool limit of size N overflow M reached, connection timed out` errors on SQLite and the database file lives on NFS, CephFS, Azure Files, an SMB mount, or any network-backed Kubernetes PVC, **increasing this value will not fix it**. The root cause is slow `fsync` on the network filesystem, which keeps each connection checked out far longer than on local disk; more pool slots just means more concurrent slow `fsync`s against the same slow storage. The async backend saturates any size pool you give it.

The only real fixes are:

1. Migrate to PostgreSQL (`DATABASE_URL=postgresql+asyncpg://...`), strongly recommended.
2. Move `webui.db` to a locally-attached SSD/NVMe.
3. Temporary workaround: `DATABASE_POOL_SIZE=1` \+ `DATABASE_SQLITE_PRAGMA_BUSY_TIMEOUT=30000`, serializes DB access, not a supported long-term config.

See [Performance → Disk I/O Latency](https://docs.openwebui.com/troubleshooting/performance#disk-io-latency-sqlite--storage) for the mechanism, and [Scaling → Step 1](https://docs.openwebui.com/getting-started/advanced-topics/scaling#step-1-switch-to-postgresql) for migration guidance.

#### `DATABASE_POOL_MAX_OVERFLOW` [​](https://docs.openwebui.com/reference/env-configuration/\#database_pool_max_overflow "Direct link to database_pool_max_overflow")

- Type: `int`
- Default: `0`
- Description: Specifies the database pool max overflow. This allows additional connections beyond `DATABASE_POOL_SIZE` during traffic spikes.

info

More information about this setting can be found [here](https://docs.sqlalchemy.org/en/20/core/pooling.html#sqlalchemy.pool.QueuePool.params.max_overflow).

#### `DATABASE_POOL_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#database_pool_timeout "Direct link to database_pool_timeout")

- Type: `int`
- Default: `30`
- Description: Specifies the database pool timeout in seconds to get a connection.

info

More information about this setting can be found [here](https://docs.sqlalchemy.org/en/20/core/pooling.html#sqlalchemy.pool.QueuePool.params.timeout).

#### `DATABASE_POOL_RECYCLE` [​](https://docs.openwebui.com/reference/env-configuration/\#database_pool_recycle "Direct link to database_pool_recycle")

- Type: `int`
- Default: `3600`
- Description: Specifies the database pool recycle time in seconds.

info

More information about this setting can be found [here](https://docs.sqlalchemy.org/en/20/core/pooling.html#setting-pool-recycle).

#### `DATABASE_ENABLE_SQLITE_WAL` [​](https://docs.openwebui.com/reference/env-configuration/\#database_enable_sqlite_wal "Direct link to database_enable_sqlite_wal")

- Type: `bool`
- Default: `False`
- Description: Enables or disables SQLite WAL (Write-Ahead Logging) mode. When enabled, SQLite transactions can be managed more efficiently, allowing multiple readers and one writer concurrently, which can improve database performance, especially under high concurrency. **This setting only applies to SQLite databases.**

#### `DATABASE_SQLITE_PRAGMA_SYNCHRONOUS` [​](https://docs.openwebui.com/reference/env-configuration/\#database_sqlite_pragma_synchronous "Direct link to database_sqlite_pragma_synchronous")

- Type: `str`
- Default: `NORMAL`
- Description: Sets the SQLite `PRAGMA synchronous` value. `NORMAL` (1) is safe with WAL mode and avoids an fsync per transaction, improving write throughput. Valid values: `OFF` (0), `NORMAL` (1), `FULL` (2), `EXTRA` (3). Set to an empty string to skip this PRAGMA entirely. **This setting only applies to SQLite databases.**

#### `DATABASE_SQLITE_PRAGMA_BUSY_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#database_sqlite_pragma_busy_timeout "Direct link to database_sqlite_pragma_busy_timeout")

- Type: `str`
- Default: `5000`
- Description: Sets the SQLite `PRAGMA busy_timeout` value in milliseconds. Controls how long a connection waits for a write lock before raising `SQLITE_BUSY`. Higher values reduce lock contention errors under concurrent writes. Set to an empty string to skip this PRAGMA entirely. **This setting only applies to SQLite databases.**

#### `DATABASE_SQLITE_PRAGMA_CACHE_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#database_sqlite_pragma_cache_size "Direct link to database_sqlite_pragma_cache_size")

- Type: `str`
- Default: `-65536`
- Description: Sets the SQLite `PRAGMA cache_size` value. Negative values specify the cache size in KiB: the default `-65536` allocates approximately 64 MB of page cache. Larger caches reduce disk I/O for read-heavy workloads. Set to an empty string to skip this PRAGMA entirely. **This setting only applies to SQLite databases.**

This cache is per connection, not global

SQLite's page cache is allocated **per connection**, so the real worst case is `cache_size` times the number of simultaneously active pooled connections, not a single 64 MB allocation. With the default SQLite pool fallback (`DATABASE_POOL_SIZE` unset, see above) that multiplier can be large enough to OOM a memory-constrained container. On small / low-spec deployments lower this (e.g. `DATABASE_SQLITE_PRAGMA_CACHE_SIZE=-2000` for ~2 MB per connection) and cap `DATABASE_POOL_SIZE`. See [Performance → SQLite Memory Footprint on Constrained Containers](https://docs.openwebui.com/troubleshooting/performance#4-sqlite-memory-footprint-on-constrained-containers).

#### `DATABASE_SQLITE_PRAGMA_TEMP_STORE` [​](https://docs.openwebui.com/reference/env-configuration/\#database_sqlite_pragma_temp_store "Direct link to database_sqlite_pragma_temp_store")

- Type: `str`
- Default: `MEMORY`
- Description: Sets the SQLite `PRAGMA temp_store` value. `MEMORY` (2) keeps temporary tables and indices in RAM, which improves performance for queries using temporary storage. Valid values: `DEFAULT` (0), `FILE` (1), `MEMORY` (2). Set to an empty string to skip this PRAGMA entirely. **This setting only applies to SQLite databases.**

#### `DATABASE_SQLITE_PRAGMA_MMAP_SIZE` [​](https://docs.openwebui.com/reference/env-configuration/\#database_sqlite_pragma_mmap_size "Direct link to database_sqlite_pragma_mmap_size")

- Type: `str`
- Default: `268435456`
- Description: Sets the SQLite `PRAGMA mmap_size` value in bytes. The default `268435456` enables approximately 256 MB of memory-mapped I/O, which can significantly improve read performance by avoiding syscall overhead. Set to `0` to disable mmap, or to an empty string to skip this PRAGMA entirely. **This setting only applies to SQLite databases.**

Also per connection

Like the page cache above, the mmap window is established **per connection**. It is mostly virtual / file-backed rather than committed anonymous RAM, but it inflates the process `total-vm` substantially and the resident portion still counts toward a cgroup memory limit. On memory-constrained containers set `DATABASE_SQLITE_PRAGMA_MMAP_SIZE=0` and cap `DATABASE_POOL_SIZE`. See [Performance → SQLite Memory Footprint on Constrained Containers](https://docs.openwebui.com/troubleshooting/performance#4-sqlite-memory-footprint-on-constrained-containers).

#### `DATABASE_SQLITE_PRAGMA_JOURNAL_SIZE_LIMIT` [​](https://docs.openwebui.com/reference/env-configuration/\#database_sqlite_pragma_journal_size_limit "Direct link to database_sqlite_pragma_journal_size_limit")

- Type: `str`
- Default: `67108864`
- Description: Sets the SQLite `PRAGMA journal_size_limit` value in bytes. Caps the WAL file size after checkpoint. Without this, the WAL file can grow unbounded during write bursts. The default `67108864` caps it at approximately 64 MB. Set to `-1` for no limit (SQLite default), or to an empty string to skip this PRAGMA entirely. **This setting only applies to SQLite databases.**

### Redis [​](https://docs.openwebui.com/reference/env-configuration/\#redis "Direct link to Redis")

#### `REDIS_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#redis_url "Direct link to redis_url")

- Type: `str`
- Description: Specifies the URL of the Redis instance or cluster host for storing application state.
- Examples:
  - `redis://localhost:6379/0`
  - `rediss://:password@localhost:6379/0` _(with password and TLS)_
  - `rediss://redis-cluster.redis.svc.cluster.local:6379/0?ssl_cert_reqs=required&ssl_certfile=/tls/redis/tls.crt&ssl_keyfile=/tls/redis/tls.key&ssl_ca_certs=/tls/redis/ca.crt` _(with mTLS)_

warning

**Required for Multi-Worker and Multi-Node Deployments**

When deploying Open WebUI with `UVICORN_WORKERS > 1` or in a multi-node/worker cluster with a load balancer (e.g. helm/kubectl/kubernetes/k8s, you **must** set the `REDIS_URL` value. Without it, the following issues will occur:

- Session management will fail across workers
- Application state will be inconsistent between instances
- Websocket connections will not function properly in distributed setups
- Users may experience intermittent authentication failures

Redis serves as the central state store that allows multiple Open WebUI instances to coordinate and share critical application data.

info

**Single Instance Deployments**

If you're running Open WebUI as a single instance with `UVICORN_WORKERS=1` (the default), Redis is **not required** for basic functionality. However, without Redis, signing out and password changes do **not** invalidate existing JWT tokens; they remain valid until they expire (default: 4 weeks). For production deployments, either configure Redis or shorten [`JWT_EXPIRES_IN`](https://docs.openwebui.com/reference/env-configuration/#jwt_expires_in). See [Token Revocation](https://docs.openwebui.com/getting-started/advanced-topics/hardening#token-revocation) for details.

danger

**Critical Redis Server Configuration: Prevent Connection Exhaustion**

Open WebUI uses Redis for token validation, WebSocket management, and session storage. Each user action can create Redis connections. If your Redis server is misconfigured, connections will accumulate over time until the limit is reached, causing **500 Internal Server Errors** and preventing all users from logging in.

**You must configure these settings in your `redis.conf` (not Open WebUI environment variables):**

| Setting | Bad Default | Recommended | Why |
| --- | --- | --- | --- |
| `maxclients` | 1000 (some distros) | `10000` or higher | Low limits cause "max number of clients reached" errors |
| `timeout` | 0 (never close) | `1800` (30 minutes) | Without timeout, idle connections accumulate forever |

**Example `redis.conf` settings:**

```conf
maxclients 10000
timeout 1800
```

For high-concurrency websocket deployments, also review Redis Pub/Sub output buffer limits. Open WebUI uses Socket.IO over Redis Pub/Sub when `WEBSOCKET_MANAGER=redis` is enabled, and streaming responses can produce large websocket events. If Redis disconnects Pub/Sub clients under large streaming payloads, you may see `Cannot publish to redis... giving up`, Redis timeout errors, or stalled live updates. Check:

```
redis-cli INFO stats | grep client_output_buffer_limit_disconnections
redis-cli SLOWLOG GET 50
redis-cli CONFIG GET client-output-buffer-limit
```

If `client_output_buffer_limit_disconnections` increases and the slow log shows large `PUBLISH socketio ...` entries, raise the Pub/Sub buffer limit in `redis.conf`. Example:

```conf
client-output-buffer-limit normal 0 0 0 replica 268435456 67108864 60 pubsub 1073741824 268435456 180
```

This leaves normal clients unchanged and allows Pub/Sub clients to buffer up to 1 GB hard / 256 MB soft for 180 seconds. Tune these values to your available Redis memory and expected websocket payload size.

**Symptoms of this misconfiguration:**

- Works fine for days/weeks, then suddenly all logins fail with 500 errors
- `redis.exceptions.ConnectionError: max number of clients reached` in logs
- Problem appears to "fix itself" temporarily, then returns

**Why this happens:**
With `timeout 0`, every Redis connection stays open indefinitely. Over days or weeks, connections from token checks, WebSocket events, and session validations accumulate. Once `maxclients` is reached, no new connections can be made, and authentication fails completely.

**To check your current connection count:**

```
redis-cli INFO clients | grep connected_clients
```

**To verify your settings:**

```
redis-cli CONFIG GET maxclients
redis-cli CONFIG GET timeout
```

#### `REDIS_SENTINEL_HOSTS` [​](https://docs.openwebui.com/reference/env-configuration/\#redis_sentinel_hosts "Direct link to redis_sentinel_hosts")

- Type: `str`
- Description: Comma-separated list of Redis Sentinels for app state. If specified, the "hostname" in `REDIS_URL` will be interpreted as the Sentinel service name.

#### `REDIS_SENTINEL_PORT` [​](https://docs.openwebui.com/reference/env-configuration/\#redis_sentinel_port "Direct link to redis_sentinel_port")

- Type: `int`
- Default: `26379`
- Description: Sentinel port for app state Redis.

#### `REDIS_CLUSTER` [​](https://docs.openwebui.com/reference/env-configuration/\#redis_cluster "Direct link to redis_cluster")

- Type: `bool`
- Default: `False`
- Description: Connect to a Redis Cluster instead of a single instance or using Redis Sentinels. If `True`, `REDIS_URL` must also be defined. This mode is compatible with AWS Elasticache Serverless and other Redis Cluster implementations.

info

This option has no effect if `REDIS_SENTINEL_HOSTS` is defined.

OpenTelemetry Support

Redis Cluster mode is fully compatible with OpenTelemetry instrumentation. When `ENABLE_OTEL` is enabled, Redis operations are properly traced regardless of whether you're using a single Redis instance or Redis Cluster mode.

#### `REDIS_KEY_PREFIX` [​](https://docs.openwebui.com/reference/env-configuration/\#redis_key_prefix "Direct link to redis_key_prefix")

- Type: `str`
- Default: `open-webui`
- Description: Customizes the Redis key prefix used for storing configuration values. This allows multiple Open WebUI instances to share the same Redis instance without key conflicts. When operating in Redis cluster mode, the prefix is formatted as `{prefix}:` (e.g., `{open-webui}:config:*`) to enable multi-key operations on configuration keys within the same hash slot.

#### `REDIS_SOCKET_CONNECT_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#redis_socket_connect_timeout "Direct link to redis_socket_connect_timeout")

- Type: `float` (seconds) or empty string for None
- Default: None (no timeout, uses redis-py library default)
- Description: Sets the socket connection timeout in seconds for all Redis client connections, including Sentinel, Cluster, and plain URL modes. This timeout applies to the initial TCP connection establishment. When set, it prevents indefinite blocking when attempting to connect to unreachable Redis nodes.

danger

**Critical for Redis Sentinel Deployments**

Without a socket connection timeout, Redis Sentinel failover can cause the application to hang indefinitely when a master node goes offline. The application may become completely unresponsive and even fail to restart.

For Sentinel deployments, it is **strongly recommended** to set this value (e.g., `REDIS_SOCKET_CONNECT_TIMEOUT=5`).

warning

**Interaction with WEBSOCKET\_REDIS\_OPTIONS**

If you explicitly set `WEBSOCKET_REDIS_OPTIONS`, this variable will **not** apply to the AsyncRedisManager used for websocket communication. In that case, you must include `socket_connect_timeout` directly within `WEBSOCKET_REDIS_OPTIONS`:

```
WEBSOCKET_REDIS_OPTIONS='{"socket_connect_timeout": 5}'
```

If `WEBSOCKET_REDIS_OPTIONS` is not set, `REDIS_SOCKET_CONNECT_TIMEOUT` will be applied to websocket connections automatically.

#### `REDIS_SOCKET_KEEPALIVE` [​](https://docs.openwebui.com/reference/env-configuration/\#redis_socket_keepalive "Direct link to redis_socket_keepalive")

- Type: `bool`
- Default: `False`
- Description: Enables TCP `SO_KEEPALIVE` on all Redis client sockets (plain, cluster, and sentinel connections, both sync and async). When enabled, the operating system kernel sends TCP keepalive probes on idle connections, detecting half-closed sockets (e.g., after a silent firewall/load balancer reset or a NIC flap) before the next Redis command lands on them.

When to enable

Enable this setting in environments where:

- A firewall or load balancer sits between the application and Redis and may silently drop idle connections
- Network instability can cause connections to become half-open without notification
- You want an additional layer of dead-connection detection alongside `REDIS_HEALTH_CHECK_INTERVAL`

`REDIS_SOCKET_KEEPALIVE` operates at the TCP level (kernel-driven probes), while `REDIS_HEALTH_CHECK_INTERVAL` operates at the application level (redis-py PING commands). They are complementary and can be used together for maximum reliability.

#### `REDIS_SENTINEL_MAX_RETRY_COUNT` [​](https://docs.openwebui.com/reference/env-configuration/\#redis_sentinel_max_retry_count "Direct link to redis_sentinel_max_retry_count")

- Type: `int`
- Default: `2`
- Description: Sets the maximum number of retries for Redis operations when using Sentinel fail-over. This is a critical high-availability setting that allows the application time for master election and promotion. If your Sentinel `down-after-milliseconds` is high, you should tune this value accordingly to ensure the service survives the failover window without dropping connections.

#### `REDIS_RECONNECT_DELAY` [​](https://docs.openwebui.com/reference/env-configuration/\#redis_reconnect_delay "Direct link to redis_reconnect_delay")

- Type: `float` (milliseconds)
- Default: None
- Description: Optional reconnect delay in milliseconds for Redis Sentinel retry logic, applied consistently across both synchronous and asynchronous Redis operations. This improves stability during Sentinel failover by preventing tight retry loops. When unset or invalid, retry behavior remains unchanged.

#### `REDIS_HEALTH_CHECK_INTERVAL` [​](https://docs.openwebui.com/reference/env-configuration/\#redis_health_check_interval "Direct link to redis_health_check_interval")

- Type: `int` (seconds)
- Default: None (disabled)
- Description: How often (in seconds) redis-py should PING an idle pooled connection before reusing it. When set to a positive integer, redis-py will PING any pooled connection that has been idle longer than this interval before handing it back to a caller. This detects stale/dead connections before a real command lands on them, preventing `ConnectionError: Connection reset by peer` errors. Set to `0` or leave empty to disable.

Recommended for production

Set `REDIS_HEALTH_CHECK_INTERVAL` to a value **shorter** than both:

- Your Redis server's `timeout` setting (e.g., `timeout 1800`)
- Any firewall or load balancer idle timeout on the path to Redis

A typical value is `60` (seconds). This keeps actively-used pooled connections warm (the PING resets the server's idle timer) while still allowing the Redis server to reap truly orphaned connections via its `timeout` setting.

How it works

When enabled, redis-py performs a lightweight `PING` on checkout for any connection that has been idle longer than the configured interval. This serves two purposes:

1. **Detects dead connections**: stale sockets are identified and replaced before your application code runs a command on them
2. **Keeps active connections alive**: the PING resets the Redis server's per-connection idle timer, preventing the server from reaping connections that are still in the pool

Without this setting, if your Redis server has a `timeout` configured (recommended to prevent connection exhaustion), the first request that grabs a reaped socket from the pool will fail with a `ConnectionError`.

#### `WEBSOCKET_REDIS_LOCK_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_redis_lock_timeout "Direct link to websocket_redis_lock_timeout")

- Type: `int`
- Default: `60`
- Description: Sets the timeout in seconds for Redis locks used by the websocket manager.

#### `ENABLE_WEBSOCKET_SUPPORT` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_websocket_support "Direct link to enable_websocket_support")

- Type: `bool`
- Default: `True`
- Description: Enables websocket support in Open WebUI.

warning

**Required for Multi-Worker and Multi-Node Deployments**

When deploying Open WebUI with `UVICORN_WORKERS > 1` or in a multi-node/worker cluster with a load balancer (e.g. helm/kubectl/kubernetes/k8s, you **must** set this variable. Without it, the following issues will occur:

- Session management will fail across workers
- Application state will be inconsistent between instances
- Websocket connections will not function properly in distributed setups
- Users may experience intermittent authentication failures

#### `WEBSOCKET_MANAGER` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_manager "Direct link to websocket_manager")

- Type: `str`
- Default: `"" (empty string)`
- Description: Specifies the websocket manager to use. Allowed values include: `redis`

warning

**Required for Multi-Worker and Multi-Node Deployments**

When deploying Open WebUI with `UVICORN_WORKERS > 1` or in a multi-node/worker cluster with a load balancer (e.g. helm/kubectl/kubernetes/k8s, you **must** set this variable. Without it, the following issues will occur:

- Session management will fail across workers
- Application state will be inconsistent between instances
- Websocket connections will not function properly in distributed setups
- Users may experience intermittent authentication failures

#### `WEBSOCKET_REDIS_URL` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_redis_url "Direct link to websocket_redis_url")

- Type: `str`
- Default: `${REDIS_URL}`
- Description: Specifies the URL of the Redis instance or cluster host for websocket communication. It is distinct from `REDIS_URL` and in practice, it is recommended to set both.

warning

**Required for Multi-Worker and Multi-Node Deployments**

When deploying Open WebUI with `UVICORN_WORKERS > 1` or in a multi-node/worker cluster with a load balancer (e.g. helm/kubectl/kubernetes/k8s, you **must** set this variable. Without it, the following issues will occur:

- Session management will fail across workers
- Application state will be inconsistent between instances
- Websocket connections will not function properly in distributed setups
- Users may experience intermittent authentication failures

#### `WEBSOCKET_SENTINEL_HOSTS` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_sentinel_hosts "Direct link to websocket_sentinel_hosts")

- Type: `str`
- Description: Comma-separated list of Redis Sentinels for websocket. If specified, the "hostname" in `WEBSOCKET_REDIS_URL` will be interpreted as the Sentinel service name.

#### `WEBSOCKET_SENTINEL_PORT` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_sentinel_port "Direct link to websocket_sentinel_port")

- Type: `int`
- Default: `26379`
- Description: Sentinel port for websocket Redis.

#### `WEBSOCKET_REDIS_CLUSTER` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_redis_cluster "Direct link to websocket_redis_cluster")

- Type: `bool`
- Default: `${REDIS_CLUSTER}`
- Description: Specifies that websocket should communicate with a Redis Cluster instead of a single instance or using Redis Sentinels. If `True`, `WEBSOCKET_REDIS_URL` and/or `REDIS_URL` must also be defined.

info

This option has no effect if `WEBSOCKET_SENTINEL_HOSTS` is defined.

#### `WEBSOCKET_REDIS_OPTIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_redis_options "Direct link to websocket_redis_options")

- Type: `str`
- Default: `{}` (empty, which allows `REDIS_SOCKET_CONNECT_TIMEOUT` to apply if set)
- Description: A string representation of a dictionary containing additional Redis connection options for the websocket Redis client (AsyncRedisManager). This allows you to specify advanced connection parameters such as SSL settings, timeouts, or other Redis client configurations that are not covered by the standard `WEBSOCKET_REDIS_URL`. The string should be formatted as valid JSON. For example: `{"retry_on_timeout": true, "socket_connect_timeout": 5, "socket_timeout": 5, "max_connections": 8}`. All JSON encodable options listed [here](https://redis.readthedocs.io/en/stable/connections.html) can be used.

warning

**AWS SSM and Docker compose cannot ingest raw JSON, as such you need to escape any double quotes like the following:**`{\"retry_on_timeout\": true, \"socket_connect_timeout\": 5, \"socket_timeout\": 5, \"max_connections\": 8}`

info

**Precedence with REDIS\_SOCKET\_CONNECT\_TIMEOUT**

When this variable is left empty (default), `REDIS_SOCKET_CONNECT_TIMEOUT` is automatically applied to websocket connections if set. However, if you explicitly set `WEBSOCKET_REDIS_OPTIONS` to any value, `REDIS_SOCKET_CONNECT_TIMEOUT` will **not** be injected. You must include `socket_connect_timeout` manually within this JSON if needed.

#### `WEBSOCKET_SERVER_LOGGING` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_server_logging "Direct link to websocket_server_logging")

- Type: `bool`
- Default: `false`
- Description: When `true`, enables the Socket.IO server logger (passed as `logger=True` to the `AsyncServer`). This writes detailed Socket.IO protocol logs to the standard application log, covering client connects and disconnects, namespace and room joins, and every event packet the server sends or receives. It applies whether or not websocket Redis is configured. Use it to debug real-time problems such as clients that fail to connect, events that never arrive, or sessions that drop. It does not, on its own, control the lower-level transport logs. For those, see `WEBSOCKET_SERVER_ENGINEIO_LOGGING`, which defaults to this value, so enabling this flag also enables transport logging unless you explicitly set `WEBSOCKET_SERVER_ENGINEIO_LOGGING=false`.

warning

**This is very verbose at scale, since it logs an entry for every websocket event. Enable it only while you are actively debugging, then turn it off again.**

#### `WEBSOCKET_SERVER_ENGINEIO_LOGGING` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_server_engineio_logging "Direct link to websocket_server_engineio_logging")

- Type: `bool`
- Default: Falls back to `WEBSOCKET_SERVER_LOGGING` if not set, otherwise `false`
- Description: When `true`, enables the Engine.IO server logger (passed as `engineio_logger=True` to the `AsyncServer`). Engine.IO is the transport layer underneath Socket.IO, so this logs the raw transport activity: the polling and websocket connections, transport upgrades, and the periodic ping and pong heartbeats. If it is not set explicitly, it inherits the value of `WEBSOCKET_SERVER_LOGGING`.

warning

**This is even more verbose than `WEBSOCKET_SERVER_LOGGING`, since it logs at the packet and heartbeat level. Enable it only when you are debugging the transport itself, for example dropped connections or failed upgrades.**

#### `WEBSOCKET_SERVER_PING_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_server_ping_timeout "Direct link to websocket_server_ping_timeout")

- Type: `int`
- Default: `20`
- Description: The number of seconds the Socket.IO/Engine.IO server waits for a client pong before considering the websocket connection dead. Increase this for slow networks, browser tabs that may pause briefly, or deployments that send large websocket events.

#### `WEBSOCKET_SERVER_PING_INTERVAL` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_server_ping_interval "Direct link to websocket_server_ping_interval")

- Type: `int`
- Default: `25`
- Description: The interval in seconds at which the Socket.IO/Engine.IO server sends heartbeat pings to connected websocket clients.

#### `WEBSOCKET_EVENT_CALLER_TIMEOUT` [​](https://docs.openwebui.com/reference/env-configuration/\#websocket_event_caller_timeout "Direct link to websocket_event_caller_timeout")

- Type: `int`
- Default: `300`
- Description: Sets the timeout in seconds for the `sio.call()` used in `event_call` events. This controls how long the server waits for a user to respond to interactive prompts, forms, or dropdowns generated by tools and actions using `event_call` (e.g., `execute()` type events). Increase this value if users need more time to fill out forms or make decisions presented by event calls.

#### `ENABLE_STAR_SESSIONS_MIDDLEWARE` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_star_sessions_middleware "Direct link to enable_star_sessions_middleware")

- Type: `bool`
- Default: `False`
- Description: Enables Redis-based session storage for OAuth authentication flows using the StarSessions middleware. When enabled, OAuth session state is stored in Redis instead of browser cookies, which can help resolve CSRF errors in multi-replica deployments where session data needs to be shared across pods. Experimental feature that enables Redis-based session storage for OAuth flows using StarSessions middleware, helping resolve CSRF errors in multi-replica deployments.
- Persistence: This is an experimental environment variable.

warning

**Experimental Feature: Known Limitations**

This feature is currently experimental and has known compatibility issues:

- **Redis Sentinel and Redis Cluster configurations are not yet supported** and will cause authentication failures if this setting is enabled
- Only basic Redis setups (single instance or standard Redis URL) are currently compatible
- This feature was introduced to address CSRF "mismatching\_state" errors in multi-pod deployments, but it is disabled by default due to ongoing compatibility work

**Only enable this setting if:**

- You are experiencing persistent CSRF errors during OAuth login in a multi-replica deployment
- You are using a basic Redis setup (not Sentinel or Cluster)
- You have confirmed that `WEBUI_SECRET_KEY` is set to the same value across all replicas
- You understand this is an experimental feature that may change or be removed in future releases

For most deployments, the default browser cookie-based session management is sufficient and more stable.

### Uvicorn Settings [​](https://docs.openwebui.com/reference/env-configuration/\#uvicorn-settings "Direct link to Uvicorn Settings")

#### `UVICORN_WORKERS` [​](https://docs.openwebui.com/reference/env-configuration/\#uvicorn_workers "Direct link to uvicorn_workers")

- Type: `int`
- Default: `1`
- Description: Controls the number of worker processes that Uvicorn spawns to handle requests. Each worker runs its own instance of the application in a separate process.

info

When deploying in orchestrated environments like Kubernetes or using Helm charts, it's recommended to keep UVICORN\_WORKERS set to 1. Container orchestration platforms already provide their own scaling mechanisms through pod replication, and using multiple workers inside containers can lead to resource allocation issues and complicate horizontal scaling strategies.

If you use UVICORN\_WORKERS, you also need to ensure that related environment variables for scalable multi-worker setups are set accordingly.

ChromaDB Not Compatible with Multiple Workers

The default vector database (ChromaDB) uses a local SQLite-backed `PersistentClient`. SQLite connections are **not fork-safe**: when uvicorn forks multiple workers, each process inherits the same SQLite connection, and concurrent writes will crash workers instantly (`Child process died`).

If you set `UVICORN_WORKERS > 1`, you **must** either switch to a client-server vector database (PGVector, Milvus, Qdrant) via [`VECTOR_DB`](https://docs.openwebui.com/reference/env-configuration#vector_db), or run ChromaDB as a separate server and set [`CHROMA_HTTP_HOST`](https://docs.openwebui.com/reference/env-configuration#chroma_http_host).

Database Migrations with Multiple Workers / Multi-Pod Deployments

When `UVICORN_WORKERS > 1` or when running multiple replicas, starting the application can trigger concurrent database migrations from multiple processes, potentially causing database schema corruption or inconsistent states.

**Recommendation:**
To handle migrations safely in multi-process/multi-pod environments, you can:

1. **Designate a Master (Recommended):** Set `ENABLE_DB_MIGRATIONS=False` on all but one instance/worker. The instance with `ENABLE_DB_MIGRATIONS=True` (default) will handle the migration, while others will wait or skip it.
2. **Scale Down:** Temporarily scale down to a single instance/worker to let migrations finish before scaling back up.

**For Kubernetes, Helm, and Orchestrated Setups:**
It is recommended to use the `ENABLE_DB_MIGRATIONS` variable to designate a specific pod for migrations, or use an init container/job to handle migrations before scaling up the main application pods. This ensures schema updates are applied exactly once.

### Cache Settings [​](https://docs.openwebui.com/reference/env-configuration/\#cache-settings "Direct link to Cache Settings")

#### `CACHE_CONTROL` [​](https://docs.openwebui.com/reference/env-configuration/\#cache_control "Direct link to cache_control")

- Type: `str`
- Default: Not set (no Cache-Control header added)
- Description: Sets the Cache-Control header for all HTTP responses. Supports standard directives like `public`, `private`, `no-cache`, `no-store`, `must-revalidate`, `max-age=seconds`, etc. If an invalid value is provided, defaults to `"no-store, max-age=0"` (no caching).
- Examples:
  - `"private, max-age=86400"`: Cache privately for 24 hours
  - `"public, max-age=3600, must-revalidate"`: Cache publicly for 1 hour, then revalidate
  - `"no-cache, no-store, must-revalidate"`: Never cache

### Proxy Settings [​](https://docs.openwebui.com/reference/env-configuration/\#proxy-settings "Direct link to Proxy Settings")

Open WebUI supports using proxies for HTTP and HTTPS retrievals. To specify proxy settings,
Open WebUI uses the following environment variables:

#### `http_proxy` [​](https://docs.openwebui.com/reference/env-configuration/\#http_proxy "Direct link to http_proxy")

- Type: `str`
- Description: Sets the URL for the HTTP proxy.

#### `https_proxy` [​](https://docs.openwebui.com/reference/env-configuration/\#https_proxy "Direct link to https_proxy")

- Type: `str`
- Description: Sets the URL for the HTTPS proxy.

#### `no_proxy` [​](https://docs.openwebui.com/reference/env-configuration/\#no_proxy "Direct link to no_proxy")

- Type: `str`
- Description: Lists domain extensions (or IP addresses) for which the proxy should not be used,
separated by commas. For example, setting no\_proxy to '.mit.edu' ensures that the proxy is
bypassed when accessing documents from MIT.

### Install Required Python Packages [​](https://docs.openwebui.com/reference/env-configuration/\#install-required-python-packages "Direct link to Install Required Python Packages")

Open WebUI provides environment variables to customize the pip installation process. Below are the environment variables used by Open WebUI for adjusting package installation behavior:

#### `ENABLE_PIP_INSTALL_FRONTMATTER_REQUIREMENTS` [​](https://docs.openwebui.com/reference/env-configuration/\#enable_pip_install_frontmatter_requirements "Direct link to enable_pip_install_frontmatter_requirements")

- Type: `bool`
- Default: `True`
- Description: Controls whether Open WebUI automatically runs `pip install` for Python packages declared in function and tool `requirements` frontmatter. When enabled, dependencies are installed at runtime, both on startup (for all active functions and admin tools) and when saving a function or tool with new requirements.

Security Hardening for Production

**Strongly recommended: set `ENABLE_PIP_INSTALL_FRONTMATTER_REQUIREMENTS=False` in production.** Runtime pip installs allow any admin-uploaded function or tool to install arbitrary Python packages into the running process. Disabling this:

- **Prevents arbitrary package installation** from user-uploaded code
- **Eliminates race conditions** that crash workers when `UVICORN_WORKERS > 1` or multiple replicas attempt concurrent pip installs
- **Ensures reproducible deployments**: all dependencies are baked into the container image

Pre-install required packages in your Dockerfile instead:

```
FROM ghcr.io/open-webui/open-webui:main

RUN pip install --no-cache-dir python-docx requests beautifulsoup4
```

When disabled, functions and tools that import missing packages will fail with a `ModuleNotFoundError` at load time, clearly indicating which packages need to be pre-installed.

#### `PIP_OPTIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#pip_options "Direct link to pip_options")

- Type: `str`
- Description: Specifies additional command-line options that pip should use when installing packages. For example, you can include flags such as `--upgrade`, `--user`, or `--no-cache-dir` to control the installation process.

#### `PIP_PACKAGE_INDEX_OPTIONS` [​](https://docs.openwebui.com/reference/env-configuration/\#pip_package_index_options "Direct link to pip_package_index_options")

- Type: `str`
- Description: Defines custom package index behavior for pip. This can include specifying additional or alternate index URLs (e.g., `--extra-index-url`), authentication credentials, or other parameters to manage how packages are retrieved from different locations.

This content is for informational purposes only and does not constitute a warranty, guarantee, or contractual commitment. Open WebUI is provided "as is." See your [license](https://docs.openwebui.com/license) for applicable terms.

- [Overview](https://docs.openwebui.com/reference/env-configuration/#overview)
  - [Important Note on `ConfigVar` Environment Variables](https://docs.openwebui.com/reference/env-configuration/#important-note-on-configvar-environment-variables)
  - [Troubleshooting Ignored Environment Variables 🛠️](https://docs.openwebui.com/reference/env-configuration/#troubleshooting-ignored-environment-variables-%EF%B8%8F)
- [App/Backend](https://docs.openwebui.com/reference/env-configuration/#appbackend)
  - [General](https://docs.openwebui.com/reference/env-configuration/#general)
  - [AIOHTTP Client](https://docs.openwebui.com/reference/env-configuration/#aiohttp-client)
  - [Directories](https://docs.openwebui.com/reference/env-configuration/#directories)
  - [Logging](https://docs.openwebui.com/reference/env-configuration/#logging)
  - [Ollama](https://docs.openwebui.com/reference/env-configuration/#ollama)
  - [OpenAI](https://docs.openwebui.com/reference/env-configuration/#openai)
  - [Tasks](https://docs.openwebui.com/reference/env-configuration/#tasks)
  - [Code Execution](https://docs.openwebui.com/reference/env-configuration/#code-execution)
  - [Code Interpreter](https://docs.openwebui.com/reference/env-configuration/#code-interpreter)
  - [Direct Connections (OpenAPI/MCPO Tool Servers)](https://docs.openwebui.com/reference/env-configuration/#direct-connections-openapimcpo-tool-servers)
  - [Terminal Server](https://docs.openwebui.com/reference/env-configuration/#terminal-server)
  - [Autocomplete](https://docs.openwebui.com/reference/env-configuration/#autocomplete)
  - [Evaluation Arena Model](https://docs.openwebui.com/reference/env-configuration/#evaluation-arena-model)
  - [Tags Generation](https://docs.openwebui.com/reference/env-configuration/#tags-generation)
  - [API Key Endpoint Restrictions](https://docs.openwebui.com/reference/env-configuration/#api-key-endpoint-restrictions)
  - [Model Caching](https://docs.openwebui.com/reference/env-configuration/#model-caching)
  - [Memory](https://docs.openwebui.com/reference/env-configuration/#memory)
- [Security Variables](https://docs.openwebui.com/reference/env-configuration/#security-variables)
- [Vector Database](https://docs.openwebui.com/reference/env-configuration/#vector-database)
  - [ChromaDB](https://docs.openwebui.com/reference/env-configuration/#chromadb)
  - [Elasticsearch](https://docs.openwebui.com/reference/env-configuration/#elasticsearch)
  - [Milvus](https://docs.openwebui.com/reference/env-configuration/#milvus)
  - [MariaDB Vector](https://docs.openwebui.com/reference/env-configuration/#mariadb-vector)
  - [OpenSearch](https://docs.openwebui.com/reference/env-configuration/#opensearch)
  - [PGVector](https://docs.openwebui.com/reference/env-configuration/#pgvector)
  - [Qdrant](https://docs.openwebui.com/reference/env-configuration/#qdrant)
  - [Pinecone](https://docs.openwebui.com/reference/env-configuration/#pinecone)
  - [Weaviate](https://docs.openwebui.com/reference/env-configuration/#weaviate)
  - [Oracle 23ai Vector Search (oracle23ai)](https://docs.openwebui.com/reference/env-configuration/#oracle-23ai-vector-search-oracle23ai)
  - [S3 Vector Bucket](https://docs.openwebui.com/reference/env-configuration/#s3-vector-bucket)
  - [Valkey](https://docs.openwebui.com/reference/env-configuration/#valkey)
- [RAG Content Extraction Engine](https://docs.openwebui.com/reference/env-configuration/#rag-content-extraction-engine)
- [Retrieval Augmented Generation (RAG)](https://docs.openwebui.com/reference/env-configuration/#retrieval-augmented-generation-rag)
  - [Core Configuration](https://docs.openwebui.com/reference/env-configuration/#core-configuration)
  - [Document Processing](https://docs.openwebui.com/reference/env-configuration/#document-processing)
  - [Embedding Engine Configuration](https://docs.openwebui.com/reference/env-configuration/#embedding-engine-configuration)
  - [Reranking](https://docs.openwebui.com/reference/env-configuration/#reranking)
  - [Query Generation](https://docs.openwebui.com/reference/env-configuration/#query-generation)
  - [Document Intelligence (Azure)](https://docs.openwebui.com/reference/env-configuration/#document-intelligence-azure)
  - [Advanced Settings](https://docs.openwebui.com/reference/env-configuration/#advanced-settings)
  - [Google Drive](https://docs.openwebui.com/reference/env-configuration/#google-drive)
  - [OneDrive](https://docs.openwebui.com/reference/env-configuration/#onedrive)
- [Web Search](https://docs.openwebui.com/reference/env-configuration/#web-search)
  - [Web Loader Configuration](https://docs.openwebui.com/reference/env-configuration/#web-loader-configuration)
  - [YouTube Loader](https://docs.openwebui.com/reference/env-configuration/#youtube-loader)
- [Audio](https://docs.openwebui.com/reference/env-configuration/#audio)
  - [Whisper Speech-to-Text (Local)](https://docs.openwebui.com/reference/env-configuration/#whisper-speech-to-text-local)
  - [Speech-to-Text (OpenAI)](https://docs.openwebui.com/reference/env-configuration/#speech-to-text-openai)
  - [Speech-to-Text (Azure)](https://docs.openwebui.com/reference/env-configuration/#speech-to-text-azure)
  - [Speech-to-Text (Deepgram)](https://docs.openwebui.com/reference/env-configuration/#speech-to-text-deepgram)
  - [Speech-to-Text (Mistral)](https://docs.openwebui.com/reference/env-configuration/#speech-to-text-mistral)
  - [Speech-to-Text (General)](https://docs.openwebui.com/reference/env-configuration/#speech-to-text-general)
  - [Text-to-Speech](https://docs.openwebui.com/reference/env-configuration/#text-to-speech)
  - [Azure Text-to-Speech](https://docs.openwebui.com/reference/env-configuration/#azure-text-to-speech)
  - [Voice Mode](https://docs.openwebui.com/reference/env-configuration/#voice-mode)
  - [OpenAI Text-to-Speech](https://docs.openwebui.com/reference/env-configuration/#openai-text-to-speech)
  - [Mistral Text-to-Speech](https://docs.openwebui.com/reference/env-configuration/#mistral-text-to-speech)
  - [Elevenlabs Text-to-Speech](https://docs.openwebui.com/reference/env-configuration/#elevenlabs-text-to-speech)
- [Image Generation](https://docs.openwebui.com/reference/env-configuration/#image-generation)
  - [General Settings](https://docs.openwebui.com/reference/env-configuration/#general-settings)
  - [Image Creation](https://docs.openwebui.com/reference/env-configuration/#image-creation)
  - [Image Editing](https://docs.openwebui.com/reference/env-configuration/#image-editing)
  - [OpenAI DALL-E](https://docs.openwebui.com/reference/env-configuration/#openai-dall-e)
  - [Gemini](https://docs.openwebui.com/reference/env-configuration/#gemini)
  - [ComfyUI](https://docs.openwebui.com/reference/env-configuration/#comfyui)
  - [AUTOMATIC1111](https://docs.openwebui.com/reference/env-configuration/#automatic1111)
- [OAuth](https://docs.openwebui.com/reference/env-configuration/#oauth)
  - [Google](https://docs.openwebui.com/reference/env-configuration/#google)
  - [Microsoft](https://docs.openwebui.com/reference/env-configuration/#microsoft)
  - [GitHub](https://docs.openwebui.com/reference/env-configuration/#github)
  - [Feishu](https://docs.openwebui.com/reference/env-configuration/#feishu)
  - [OpenID (OIDC)](https://docs.openwebui.com/reference/env-configuration/#openid-oidc)
- [LDAP](https://docs.openwebui.com/reference/env-configuration/#ldap)
- [SCIM](https://docs.openwebui.com/reference/env-configuration/#scim)
- [User Permissions](https://docs.openwebui.com/reference/env-configuration/#user-permissions)
  - [Chat Permissions](https://docs.openwebui.com/reference/env-configuration/#chat-permissions)
  - [Feature Permissions](https://docs.openwebui.com/reference/env-configuration/#feature-permissions)
  - [Workspace Permissions](https://docs.openwebui.com/reference/env-configuration/#workspace-permissions)
  - [Sharing (Private)](https://docs.openwebui.com/reference/env-configuration/#sharing-private)
  - [Sharing (Public)](https://docs.openwebui.com/reference/env-configuration/#sharing-public)
  - [Access Grants](https://docs.openwebui.com/reference/env-configuration/#access-grants)
  - [Import / Export](https://docs.openwebui.com/reference/env-configuration/#import--export)
  - [Settings Permissions](https://docs.openwebui.com/reference/env-configuration/#settings-permissions)
- [Misc Environment Variables](https://docs.openwebui.com/reference/env-configuration/#misc-environment-variables)
  - [Cloud Storage](https://docs.openwebui.com/reference/env-configuration/#cloud-storage)
  - [OpenTelemetry Configuration](https://docs.openwebui.com/reference/env-configuration/#opentelemetry-configuration)
  - [Database Pool](https://docs.openwebui.com/reference/env-configuration/#database-pool)
  - [Encrypted SQLite with SQLCipher](https://docs.openwebui.com/reference/env-configuration/#encrypted-sqlite-with-sqlcipher)
  - [Redis](https://docs.openwebui.com/reference/env-configuration/#redis)
  - [Uvicorn Settings](https://docs.openwebui.com/reference/env-configuration/#uvicorn-settings)
  - [Cache Settings](https://docs.openwebui.com/reference/env-configuration/#cache-settings)
  - [Proxy Settings](https://docs.openwebui.com/reference/env-configuration/#proxy-settings)
  - [Install Required Python Packages](https://docs.openwebui.com/reference/env-configuration/#install-required-python-packages)