Open WebUI security hardening

Open WebUI security hardening covers sign-up, session and token revocation, API key scope, per-resource permissions, network exposure and tool or function risk. This page sets out the decisions, build order and checks.

On this page

Why Open WebUI security hardening is more than a password setting

A self-hosted Open WebUI sits between your users and your model providers, and it may hold uploaded documents, provider API keys, user accounts, API keys and tools that reach into other systems. Securing that setup is not a single switch. This topic covers the controls a regulated team needs to review and set: disabling open sign-up, revoking sessions, scoping API keys, applying per-resource permissions, limiting network exposure, and deciding which tools and functions users may run. Defaults get a working instance running, but they are not a hardening baseline, and each of these areas needs an explicit decision and a documented check.

Session handling is the first place where a default can surprise a security team. Without Redis, signing out of Open WebUI does not revoke tokens. They stay valid until they expire, which the scaling guide places at 4 weeks by default. A user who signs out on a lost laptop still has a working token for that period. The scaling guide ties Redis to multi-replica deployments as a shared state store for sessions, so the same dependency that makes replicas work also makes revocation work. Confirm with your own configuration whether Redis is in place, and test sign-out by replaying an old token against the API before you accept the design.

Tools, functions and API keys widen the attack surface beyond the login page. Tools and functions can call external systems and run code on behalf of a user, so who may create or import them is a policy decision, not a convenience setting. API keys carry the permissions of the account that issued them, so their scope and lifetime need the same review as user accounts. Per-resource permissions on models, knowledge and tools decide what each group can reach. Identity setup, high availability and retrieval design are covered in the sibling topics on SSO and identity integration, high availability, and RAG and vector database setup, so this page focuses on the controls that remain after those choices are made.

Which Open WebUI settings and components carry the risk

Most Open WebUI exposure comes from a small set of settings: who can create an account, how sessions are stored, which API keys exist, what each group can reach, what tools and functions can execute, and where traffic enters the network. Review these six areas in order before go-live, and record the value you find in each one so you can compare it after every upgrade.

Sign-up and user approval

Open sign-up decides who can create an account on your instance without an administrator adding them. Confirm that open sign-up is disabled, that new accounts wait for administrator approval, and that users arrive through your identity provider or an invitation process you control. Check the setting after each upgrade, since a changed default can reopen registration without any visible warning. Also confirm who holds the administrator role, because that role can change every other setting on this list.

Features docs

Session and token storage

Sessions and tokens determine how long a stolen credential stays useful. Without Redis, signing out does not revoke tokens, which remain valid until they expire, by default after 4 weeks. For more than one replica, Redis also holds shared session and websocket state, so a single-replica install with SQLite has a different revocation profile than a multi-replica install. Confirm where sessions are stored, test that sign-out actually invalidates a token, and set a token lifetime your security team accepts.

Scaling guide

Database and file storage

The database holds users, chats, settings, API key records and uploaded knowledge, so access to it is access to the whole instance. The scaling guide requires PostgreSQL for multi-instance deployments, and SQLite remains acceptable only on locally attached SSD or NVMe storage for single-replica or small installs. Restrict network access to the database, use separate credentials for the application, and confirm that backups are encrypted and restricted to the same people who administer the instance.

API keys and their scope

API keys let scripts and integrations call Open WebUI without a browser session, so each key is a standing credential. Confirm which users may create keys, whether keys can be restricted in scope, and how an administrator lists and revokes them. Treat a key found in a repository or chat log as compromised. Keep a register of which integration uses which key, and rotate keys when the owning person or system changes.

Groups and per-resource permissions

Role-based access control uses groups, and per-resource permissions decide which models, knowledge bases and tools each group can read or use. Defaults can grant broader access than a team expects, so compare the permissions a new user receives against your written access model. Test with a non-admin account in each group, and confirm that knowledge bases containing sensitive documents are not shared with a broad group by accident. Document who approves changes to group membership.

Tools, functions and the network entry point

Tools and functions run code or call external services on behalf of users, so enabling them widens what a prompt can cause. Allow only reviewed tools for each group, and confirm which functions can reach internal networks or credentials. Separately, the network entry point decides who can reach the login page and API at all. Place Open WebUI behind a controlled reverse proxy or load balancer, limit exposure to the networks that need it, and verify that the admin interface is not published to the internet.

Decisions to make before hardening Open WebUI

This table compares the main hardening choices for a self-hosted Open WebUI, with the conditions under which each option fits and the operational cost it carries. Read each row as a decision to settle with your security, identity and platform owners before go-live. The main takeaway is that the tighter option on each row usually adds administrative work and user friction, so the choice should follow your user count, risk tolerance and staffing.

DecisionOptionWhen it fitsOperational cost
Sign-up modeOpen sign-upEvaluation or a small pilot where anyone on a trusted network may joinAccounts appear without review, so you inherit cleanup, role drift and unclear ownership of data
Sign-up modeInvite-only or SSO-only sign-upProduction use tied to a corporate identity provider or a known user listAdmins or the identity team must provision users and groups, which adds onboarding lead time
Session revocationAccept default token lifetimeLow-risk internal use where a 4-week token window is acceptable to your policySigning out does not revoke tokens, so a stolen or departed user's session stays valid until expiry
Session revocationRedis-backed revocationMulti-replica deployments or any setting where immediate sign-out mattersAdds Redis to operate, secure and monitor, plus its own backup and availability planning
API keysBroad keys shared across users or toolsQuick testing by a single administratorOne leaked key exposes every resource it reaches, and rotation breaks many integrations at once
API keysNarrow keys issued per user or per integrationAny shared or automated use, including scripts and coding agentsMore keys to inventory, rotate and retire, and more coordination with the teams that own each integration
Model accessGroup-based access to modelsTeams with clearly different needs, such as a fixed set of approved models per departmentRequires maintaining group membership and reviewing it when people change roles
Model accessPer-model access for individual usersSmall teams or a few sensitive models with named usersGrows hard to audit as users and models increase, so reviews take longer
Tools and functionsTools enabled for all usersLow-risk, read-only tools in a sandboxed environment that you have testedAny user can invoke tools that reach internal systems, which widens the blast radius of prompt injection
Tools and functionsAdmin-curated tools assigned by groupTools that touch data, credentials or internal APIsAdds an approval step for each new tool and some user friction when they ask for one

How to harden Open WebUI in sequence

This sequence moves a fresh Open WebUI instance from open access to a controlled deployment, where each control is set and verified before the next one depends on it. The order matters because sign-up, transport and session handling decide what every later permission step can actually protect.

  1. Close open sign-up and set approval mode

    Before any users are invited, turn off open sign-up so that anyone who reaches the login page cannot create an account. Choose how new accounts are admitted, such as manual approval by an administrator, and confirm that the default role assigned to new users is the lowest one you need. Check it by opening the sign-in page in a private browser window and confirming that no self-registration option appears and that a test sign-up is refused or held for approval.

  2. Place the instance behind TLS and one entry point

    Serve Open WebUI only through a reverse proxy or load balancer that terminates TLS, and do not publish the application container port directly to the network. Restrict inbound access to the proxy, and confirm which addresses can reach the admin interface. Check it by running a plain HTTP request and a direct connection to the application port from outside the allowed network, and confirm both fail while the HTTPS address loads the login page.

  3. Move to PostgreSQL and Redis for multiple instances

    If you run more than one replica, the scaling guide requires PostgreSQL instead of SQLite, plus Redis as a shared state store for sessions and websocket connections, and shared file storage for uploads and knowledge. Even a single instance benefits from this move if you need token revocation to behave predictably. Check it by confirming the instance reports its database and Redis connections in the logs, and that a session created on one replica is recognized by another.

  4. Enable token revocation through Redis

    Without Redis, signing out does not revoke tokens, and they remain valid until they expire, which by default is four weeks. With Redis in place, confirm that sign-out actually invalidates the session token. Check it by copying a token from a signed-in session, signing out, and replaying the token against an API call, which should now be rejected. Record the result as evidence for your reviewers.

  5. Restrict API key creation and scope

    Decide which roles may create API keys, and turn creation off for everyone else. Keep keys short-lived where the platform allows it, assign each key to a named owner, and avoid using administrator keys for automation. Check it by signing in as a standard user, confirming the API key option is absent or refused, and then creating a key as an authorized user and confirming the owner and scope are recorded against it.

  6. Define groups and per-resource permissions

    Create groups that match real job functions, then grant each model, knowledge collection and tool only to the groups that need it. Default new resources to private rather than shared with all users. Confirm the exact permission options in the version you run, since the features documentation describes role-based access with groups and per-resource permissions. Check it by signing in as a test user in each group and confirming they see only the models and knowledge collections granted to that group.

  7. Restrict tools and functions to reviewed code

    Tools and functions run code inside the platform, so allow only the ones your security team has reviewed and restrict who can install or edit them to a small administrator group. Pin the versions you approved and keep unreviewed community code out of production. Check it by attempting to add an unreviewed function as a standard user and as an administrator, and confirming the first is refused and the second is recorded in your change log with a reviewer's sign-off.

  8. Lock admin roles and review the result

    Limit the administrator role to a small named list, require authenticator-app MFA for every administrator account, and remove any default or shared admin accounts. Then review the whole configuration against this sequence and keep the signed record. Check it by listing all administrator accounts, confirming each has MFA enrolled, and confirming no shared or default admin account remains active.

How hardening differs for single-node and multi-replica deployments

A single Open WebUI container with SQLite is the simplest deployment to harden, and the scaling guide accepts SQLite for single-replica deployments, evaluation and small teams when the database file sits on locally attached SSD or NVMe storage rather than network storage. Hardening here centers on the application settings and the host, because one process owns the database and there is no shared state to keep in sync.

  • Storage placement: Confirm the SQLite file is on locally attached SSD or NVMe, not on a network share, and restrict file permissions on the data directory to the service account.
  • Sign-up control: Disable open sign-up so new accounts come only from administrator invitation or your chosen identity method.
  • Session expiry: Without Redis, sign-out does not revoke tokens, so a stolen token stays valid until it expires, by default after 4 weeks. Plan for that window and shorten expiry where your policy requires it.
  • Host exposure: Publish only the required port through a reverse proxy with TLS, and keep the container host patched and off shared administrative networks.
  • Backups: Back up the database and uploaded files together so restores return a consistent state.

Before go-live, confirm in your own environment that a sign-out from one browser actually ends the session you expect and that the token lifetime matches your written policy.

Hardening controls for tools, keys and secrets

Most Open WebUI exposure comes from a few places: provider keys stored in the platform, API keys that outlive their purpose, tools and functions that run code, and admin paths reachable from the wrong network. The cards below cover each one, with the check to run and the vendor documentation to confirm it against before you rely on it.

Provider keys and model credentials

Model provider keys for Ollama-compatible endpoints, OpenAI, Anthropic or other OpenAI-compatible APIs are the highest-value secrets in the deployment. Confirm where Open WebUI stores these values in your version, whether they are visible to non-admin users, and whether they appear in logs or exported configuration. Inject them from your secrets manager or environment at deploy time where the install method allows it, and rotate them on a schedule you can prove. Check that end users can reach approved models without ever seeing the key itself.

Open WebUI features

API key lifetime and scope

API keys let scripts and integrations call Open WebUI without a browser session, so each key is a standing credential. Confirm which users can create keys, whether an administrator can disable that ability for ordinary accounts, and what access a key inherits from its owner. Assign keys to named service accounts, record an owner and purpose for each one, and revoke keys when the integration is retired. Review the list of active keys on a regular cadence rather than only at go-live.

Community tools and functions

Tools and functions extend Open WebUI with Python code that runs on the server, so a community script carries the same reach as the application itself. Treat installation as a code review decision: read the source, pin the version, and restrict who can add or edit them to a small administrator group. Confirm with the vendor documentation which roles can import tools and whether any execution is sandboxed in your release. Keep a written list of approved tools and remove anything no team still uses.

Least-privilege administrator roles

Open WebUI's role-based access control uses groups and per-resource permissions, so administrator rights should not be the default way to manage models, knowledge or users. Split duties so that model configuration, user provisioning and tool approval sit with different people where your team is large enough to do so. Confirm which permissions each built-in role grants in your version, and review group membership against your identity provider so departures are removed from Open WebUI as well. Keep the number of accounts with full administrative rights small and named.

Logging of sensitive actions

Changes to users, roles, provider connections, tools and API keys are the events an incident responder will ask about first. Confirm which of these actions Open WebUI records itself, which go only to the container log, and how long each log is kept. Forward container and reverse proxy logs to a central system outside the application host, and set alerts for new administrators, new tools and new key creation. Test that a sample change appears in the log before you depend on it.

Admin paths and network exposure

Place Open WebUI behind a reverse proxy or load balancer that terminates TLS, and decide which networks can reach the application at all. Restrict administrative and API paths to internal address ranges or a VPN where your design allows, and do not publish the database, Redis or vector store ports. Confirm the exact paths and any direct-access ports your install method exposes, and test them from outside the network after each change. Use your own network scanning results as evidence rather than assuming the proxy rules are complete.

How to test that sign-out, sign-up and permissions fail safely

Start by proving that the controls you configured actually refuse the wrong request. Each test below asks one question and records one expected result, so a failure points to a specific setting. Run them against a staging copy built from the same configuration as production, not against a demo instance with default settings. Every test should fail closed: the expected outcome is a rejected request, a missing model in the list, or a blocked tool call, never a silent fallback.

Sign-up first. With sign-up disabled, attempt to create an account from the login page and through any direct registration route your version exposes, using a fresh email address and a known-good password. Then sign out an existing test user, keep the session token from before sign-out, and replay it against a chat or API endpoint. If Redis is in place as the shared session store, the replayed token should be rejected. If it still works, confirm whether Redis is configured for that deployment, because the scaling guide notes that without Redis, sign-out does not revoke tokens and they remain valid until expiry, by default after 4 weeks (Scaling Open WebUI). Also test an API key that belongs to a deactivated user, since it should stop working too.

Next, test permissions with accounts that should have less access. Create a user with no group membership and confirm that a restricted model is absent from the model picker and returns an error when called directly by ID. Repeat with a knowledge item that is restricted to one group, asking a question whose answer exists only in that document. For API keys, use a key that is scoped to chat completions and send it to an admin or settings endpoint; the request should be denied. For tools, have a user whose group is not approved invoke a tool or function and confirm that it does not execute and leaves no output in logs or files. Retest these after every Open WebUI release, checking the Open WebUI releases page for changes to authentication, permissions and tool handling, and record each result so the next run can be compared.

What drives hardening effort and how to keep it down

This table lists the factors that expand or shrink an Open WebUI hardening engagement, how each one adds work, and a practical way to reduce it. Read each row as a lever you control before the scope is agreed, since most of the effort comes from decisions made early about users, groups, tools and environments.

DriverWhy it raises effortHow to keep it down
User countMore accounts mean more sign-up, role and session policy to verify, and more access paths to test against the open sign-up and token revocation settings.Provision users through your identity provider rather than manually, and confirm the expected user count in writing so testing covers the real population.
Groups and per-resource permissionsEach group that can see models, knowledge or tools adds a permission combination to review, and overlapping groups are where unintended access usually appears.Keep the group model small, map each group to one documented purpose, and limit per-resource grants to the few models or knowledge collections that truly need them.
Models and provider connectionsEvery connected model or provider endpoint needs a check of which users can reach it, what keys it uses and what data leaves the environment.Connect only approved providers and publish a short model list, so reviewers test a fixed set rather than every option the interface exposes.
Tools and functions in useTools and functions can run code or call external systems, so each one needs a permission review, a source review and a test of what it can reach.Maintain a short approved list, remove unused tools before testing begins, and require a documented review before any new tool is enabled.
Identity integration stateLocal accounts with password sign-in, MFA set per user and SSO that is only partly configured each need separate testing and sign-in path reviews.Finish SSO and MFA enforcement before hardening starts, so the test covers one authentication path instead of several parallel ones.
Replicas and environmentsMultiple replicas need shared Redis state and token revocation tested across every instance, and each environment (test, staging, production) repeats the checks.Run the hardening review once against a single reviewed environment, then apply the same configuration to other environments with a documented diff.
Compliance evidence needsAssessors may ask for configuration exports, access reviews, logging samples and change records, and each evidence type adds collection and retention work.Agree the evidence list with your assessor before the engagement starts, and confirm which artifacts they will accept so collection is not repeated.
API keys and automationEach API key has its own scope, owner and rotation requirement, and undocumented keys are common in older installs.Inventory existing keys before scoping, restrict each to the scope it needs, and retire keys that have no named owner.

What to monitor, back up and document after hardening

What sign-in and failed-login events should we review after hardening Open WebUI?

Review every successful and failed sign-in, with the account, timestamp, source address, authentication method (password, SSO, or API key) and the outcome. Failed attempts clustered on one account or source, sign-ins from unexpected networks, and accounts that sign in shortly after being created or granted admin rights deserve a same-day look. Confirm with your identity provider which events it forwards to Open WebUI and which stay only in the IdP logs, because a review that covers only one side misses attacks. Keep these records in a central log store with retention set by your policy, and restrict who can read them.

What admin and permission changes should an audit log capture?

Record every change to administrator roles, group membership, per-resource permissions, sign-up and sharing settings, model access, and enabled tools or functions. Each entry needs the actor, the time, the object changed, the previous and new value, and a reference to the approval that authorized it. Auditors usually test whether a change could be traced to a named person and an approval, so a change made by a shared admin account without a ticket is a finding. Confirm which of these events Open WebUI writes to its own logs and which you must capture at the reverse proxy or in the database.

How should we inventory and rotate Open WebUI API keys?

Keep a register of every API key with its owner, purpose, the scopes or permissions it carries, the creation date, the last-used date and the planned rotation date. Revoke keys that have not been used for a period your policy sets, and rotate keys that belong to service integrations on a fixed schedule. Retire keys when their owner leaves or their integration is removed. Confirm how your Open WebUI version lists and revokes keys, and whether revocation takes effect immediately across all replicas, since that depends on your session and state configuration.

How do we control changes to tools and functions in Open WebUI?

Treat tools and functions as code: each one needs an owner, a reviewed source version, a record of who approved its installation, and a list of the groups allowed to use it. Log every install, update, enable, disable and removal, and compare the running code against the approved version on a schedule. Tools that call external services or read files need the same review as any integration, because they run with the permissions the platform gives them. Restrict who can install them to a small admin group and confirm how your version handles imported code.

What should a backup of the Open WebUI database and Redis state contain?

A complete backup covers the PostgreSQL database that holds users, chats, settings and permissions, the shared file storage used for uploads and knowledge, and the configuration and secrets needed to restore them. Redis holds sessions and shared application state, so back it up if you need sessions to survive a restore, or document that users must sign in again after recovery. Test a restore into a separate environment and record the time it takes. Also back up the external vector database, or document how to rebuild it from the source files. Confirm backup frequency and retention with your recovery objectives, since the scaling guide does not set them for you.

What should we record for each Open WebUI upgrade from a GitHub release?

For every upgrade, record the release version, the release notes reviewed, the change request and approval, the pre-upgrade backup reference, the test results in a staging copy, the database migration applied, the rollback plan and the post-upgrade verification. The project publishes releases on its GitHub releases page, so link each record to the exact tag you deployed. Recent releases have arrived several weeks apart, so track which version each environment runs and how far it trails the latest release. Security fixes in release notes should trigger a faster review than feature releases.

Which documents should we keep to show the hardened Open WebUI configuration is current?

Keep a configuration baseline that lists the deployed version, sign-up setting, identity integration, MFA policy, session and token lifetime, Redis and PostgreSQL settings, network exposure, enabled model providers and tools, and the role and group model. Pair it with the register of API keys, the change log and the backup test records. Review the baseline after every upgrade and at a fixed interval, and store it under version control so changes are visible. Assessors often ask for evidence that the documented configuration matches what runs in production, so include a dated export or screenshot from the live system.

How requests, sessions and tools move through a hardened Open WebUI

The diagram starts at the controlled entry point, where users and API clients reach Open WebUI through a reverse proxy or load balancer. Each request then reaches an Open WebUI replica, which checks the session against Redis, the shared store that lets sign-out revoke tokens across replicas, and reads or writes application state in PostgreSQL. Model calls leave toward provider connections, and tool or function calls form a separate trust boundary. Check that every path into the replicas is authenticated, that Redis is configured for revocation, and that tools and functions run only with the permissions you have approved.

Requests, session checks, data stores, model providers and the tool trust boundary in one hardened setup.

How DeployOpen scopes, hardens and hands over Open WebUI

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside the client's own infrastructure, so Open WebUI runs in your cloud account, data center or air-gapped network. Each hardening engagement starts from a written scope that names the controls to be changed, the evidence to be produced and the retest that closes the work.

How we scope

  • We review your sign-up, identity, token lifetime, API key, permission and network exposure settings before agreeing what changes.
  • We confirm whether your deployment is single-replica or multi-replica, since Redis and token revocation depend on that answer.
  • The written scope lists the tools and functions to be reviewed, the groups in scope and the evidence you will receive.

How we build

  • We disable open sign-up and set identity-based sign-in, then check that new accounts cannot be created outside approved paths.
  • We configure Redis for shared session state where replicas are used, and test that signing out revokes tokens as expected.
  • We restrict API key use, set per-resource permissions by group, and review tools and functions before they reach end users.

How we hand over

  • You receive a configuration record covering sign-up, sessions, API keys, permissions, network exposure and tool settings.
  • Findings are reported with the fix applied, the evidence that the fix works and any residual risk you must accept.
  • We document the operating steps your team needs to repeat after each Open WebUI upgrade, including checks on permissions and tools.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer, which you should price against the release cadence you expect.
  • Ask in your quote how retests are handled after a new Open WebUI release changes default behavior.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.