{"slug": "open-webui-ignores-your-environment-variables-enable-persistent-config", "title": "Open WebUI Ignores Your Environment Variables: ENABLE_PERSISTENT_CONFIG", "summary": "A homelab operator found that Open WebUI (v0.10.2) silently ignores environment variables like ENABLE_LOGIN_FORM once a corresponding row exists in the app's database config table, because persistent config defaults to true. Setting ENABLE_PERSISTENT_CONFIG=false made the Git-managed Kubernetes manifest authoritative again, resolving a signin loop that produced over 1,000 POST /api/v1/auths/signin requests, two-thirds aborted by the browser. The operator documented the fix and its trade-off: removing the local login form means an Authelia outage takes Open WebUI down with it, since Traefik forwardAuth fails closed.", "body_md": "*Originally published at [woitzik.dev](https://woitzik.dev/blog/open-webui-enable-persistent-config-env-ignored/)*\n\nI set `ENABLE_LOGIN_FORM=false` on my Open WebUI deployment, ArgoCD synced it, the pod restarted with the new environment, and the login form was still there. The environment variable was correct and completely ignored. Open WebUI stores most of its UI settings in its database, and by default the database value wins over the environment once a row exists. Setting `ENABLE_PERSISTENT_CONFIG=false` turned that around and made the manifest in Git authoritative again. Two PRs, fourteen minutes apart.\n\n[View the complete homelab infrastructure source on GitHub](https://github.com/dwoitzik/homelab-infrastructure)\n\nOpen WebUI (v0.10.2 in my cluster) is the chat frontend for the Ollama instance on my AI node. It does not handle logins itself. Authentication is delegated to Authelia through a Traefik forwardAuth middleware, and Open WebUI trusts the email header Authelia sets:\n\n```\n        - name: WEBUI_AUTH\n          value: \"true\"\n        - name: WEBUI_AUTH_TRUSTED_EMAIL_HEADER\n          value: \"Remote-Email\"\n        - name: WEBUI_AUTH_TRUSTED_NAME_HEADER\n          value: \"Remote-Name\"\n```\n\nThe same pattern covers most apps behind my [Authelia setup](https://dev.to/blog/authelia-oidc-kubernetes-25-services/). The problem was that `ENABLE_LOGIN_FORM` defaults to true, so the frontend still rendered its own signin form and competed with header auth for the same session. The Traefik access log showed what that looked like from the outside:\n\n```\n1018x POST /api/v1/auths/signin\n 669x 499  (client aborted the request after the backend answered)\n 349x 200\n  73x 302  (forwardAuth correctly rejecting an unauthenticated request)\n```\n\nOver a thousand signin POSTs, two thirds of them aborted by the browser. The app's own `/api/config` endpoint confirmed the contradiction: `auth=true` and `auth_trusted_header=true`, while `enable_login_form=true`. Header auth was on and the local form was on at the same time.\n\nThe obvious fix was one environment variable in `kubernetes/apps/open-webui/open-webui.yml`:\n\n```\n        # Auth is delegated to the Authelia forwardAuth middleware via the\n        # trusted-email header below; the local login form competes with it\n        # for the same session and traps the browser in a signin loop.\n        - name: ENABLE_LOGIN_FORM\n          value: \"false\"\n```\n\nI wrote the blast radius into the PR before merging. With the form gone, an Authelia outage takes Open WebUI down with it instead of degrading to a usable local login. Traefik forwardAuth fails closed (401/403), so removing the form does not open the app up. That trade was fine for me.\n\nThe PR merged, ArgoCD rolled the pod, and the signin form was still enabled while the pod environment said false.\n\nOpen WebUI has two layers of configuration. The environment is read once at import time, and those values become defaults. Then there is a `config` table in the app's database, and for most settings that table is what the app actually serves. The switch between the two is `ENABLE_PERSISTENT_CONFIG`, which defaults to true.\n\nThese are the relevant lines in the v0.10.2 source. In `backend/open_webui/config.py`, the login form flag is a plain environment read:\n\n```\nENABLE_LOGIN_FORM = os.getenv('ENABLE_LOGIN_FORM', 'True').lower() == 'true'\n```\n\nFurther down it goes into the defaults dictionary under a database key:\n\n```\n    'ui.enable_login_form': ENABLE_LOGIN_FORM,\n```\n\nAt the end of the file the persistence switch is read and handed to the config model:\n\n```\nENABLE_PERSISTENT_CONFIG = os.getenv('ENABLE_PERSISTENT_CONFIG', 'True').lower() == 'true'\n\nConfig.configure(\n    defaults=DEFAULT_CONFIG,\n    enable_persistent=ENABLE_PERSISTENT_CONFIG,\n    enable_oauth_persistent=ENABLE_OAUTH_PERSISTENT_CONFIG,\n)\n```\n\nIn `backend/open_webui/models/config.py`, `seed_defaults` only inserts keys that do not exist yet. Its own docstring says it: \"Existing DB values take precedence over defaults.\" Reads go to the database whenever persistence is on, and fall back to the default only if there is no row:\n\n``` php\n    @staticmethod\n    async def get(key: str, default: Any = None) -> Any:\n        \"\"\"Get a config value by key. Returns default if not set.\"\"\"\n        if not Config.persistent_enabled_for(key):\n            return Config.default_value(key, default)\n        async with get_async_db() as db:\n            row = await db.get(Config, key)\n            return row.value if row else Config.default_value(key, default)\n```\n\nAnd `main.py` builds the `/api/config` response from that lookup:\n\n```\n            'enable_login_form': config.get('ui.enable_login_form'),\n```\n\nSo the sequence on my instance was: at some earlier start, with the env var unset, the default `True` was seeded into the database as `ui.enable_login_form = 'true'`. From then on that row existed. My new env var changed the default, the default is only used for missing rows, and the row was not missing. The database won, the pod environment said false, and the form stayed.\n\nNothing in the logs mentions this. From the outside, the variable looks like it is being ignored.\n\nThere were two ways out. I could flip the flag once in the Admin Panel (or delete the row), which writes the database and fixes this one setting. Or I could turn persistence off so every `ui.*` flag comes from the environment.\n\nI picked the second one, because the first only moves the problem. This instance is managed through ArgoCD, and the whole point of that is that the manifest in Git describes the running app. With persistent config on, any Admin Panel click becomes configuration that exists only in a database file on a PVC, invisible to Git, and it survives a PVC restore. That is config drift by design. I've already written about [merged changes that never took effect](https://dev.to/blog/gitops-merged-not-applied-argocd-drift/) while everything looked synced. This was the same failure inside a single app.\n\n```\n        # Without this, ENABLE_PERSISTENT_CONFIG defaults to true and every\n        # ui.* flag is read from the DB, which silently overrides the env\n        # vars set here. Git has to be the source of truth for this app.\n        - name: ENABLE_PERSISTENT_CONFIG\n          value: \"false\"\n```\n\nWith persistence off, `persistent_enabled_for()` returns false for every key, so `get()` returns the environment-derived default and never looks at the table.\n\nThere is one behaviour change, and you should know it before flipping the switch: settings toggled in the Admin Panel no longer persist across restarts. In v0.10.2, `upsert()` with persistence off writes the new value into the in-memory defaults only:\n\n```\n            if Config.persistent_enabled_for(key):\n                persistent_updates[key] = value\n            else:\n                Config.DEFAULTS[key] = value\n```\n\nSo the Admin Panel still works for the life of the pod, and the next restart throws the change away. For a GitOps-managed instance that is the behaviour I want. For an instance you configure by clicking, it would be a nasty surprise.\n\nBefore merging I checked which settings that could hurt. Every flag the manifest sets is unaffected by definition. The only one I had last changed through the UI was `ui.enable_signup`, and its database value (` false`) matched what the manifest sets, so nothing I relied on was living only in the database.\n\nRollback for both PRs is a plain revert.\n\n`/api/config` with your pod environment.`features` block shows what the frontend actually gets. If `enable_login_form` or `enable_signup` disagree with your env vars, the database is winning.`ui.*` (or similar) key is only a first-boot default`ENABLE_PERSISTENT_CONFIG` is true. Changing it later does nothing for keys that already have a row.`ENABLE_PERSISTENT_CONFIG=false` and accept that the Admin Panel becomes temporary. If you manage the app by hand, leave it on and stop expecting env changes to take effect.`ENABLE_OAUTH_PERSISTENT_CONFIG`, and it defaults to false, so `oauth.*` keys already come from the environment. Don't assume both switches share a default.\nThe general lesson is the one this homelab keeps teaching me. The value in Git, the value in the pod spec and the value the app serves are three different things, and only the last one counts. I check it with a request to the running app, not by reading the manifest.", "url": "https://wpnews.pro/news/open-webui-ignores-your-environment-variables-enable-persistent-config", "canonical_source": "https://dev.to/dwoitzik/open-webui-ignores-your-environment-variables-enablepersistentconfig-16k3", "published_at": "2026-11-19 19:37:47+00:00", "updated_at": "2026-11-19 19:43:58.614077+00:00", "lang": "en", "topics": ["ai-tools", "large-language-models", "mlops", "developer-tools"], "entities": ["Open WebUI", "Authelia", "Traefik", "ArgoCD", "Ollama", "Kubernetes"], "also_reported_by": [], "takeaway": "In Open WebUI v0.10.2, environment variables only seed defaults, so set ENABLE_PERSISTENT_CONFIG=false to make Git-managed env settings override existing database config rows.", "recommendation": {"advice": "When an Open WebUI env var appears ignored after a deploy, set ENABLE_PERSISTENT_CONFIG=false so your manifest overrides the database config table.", "playbook": "production-ops", "playbook_url": "https://wpnews.pro/playbooks/production-ops"}, "alternates": {"html": "https://wpnews.pro/news/open-webui-ignores-your-environment-variables-enable-persistent-config", "markdown": "https://wpnews.pro/news/open-webui-ignores-your-environment-variables-enable-persistent-config.md", "text": "https://wpnews.pro/news/open-webui-ignores-your-environment-variables-enable-persistent-config.txt", "jsonld": "https://wpnews.pro/news/open-webui-ignores-your-environment-variables-enable-persistent-config.jsonld"}}