Why Open WebUI with Redis or Valkey matters before you add a second replica
Once you move from one Open WebUI container to several replicas, Redis becomes a required shared state store, not an optional performance addition. Open WebUI's scaling guide requires Redis to hold sessions, WebSocket connections and application state so that any replica can serve any user. Without it, replicas do not share that state, and the setup breaks in ways that look like random login problems. The same guide pairs Redis with PostgreSQL in place of SQLite, a shared file storage backend for uploads and knowledge, and an external vector database, because the default ChromaDB crashes in multi-process setups. Treat Redis as one item on that checklist, not a standalone change.
Sign-out is the behavior that matters most for security. Without Redis, signing out does not revoke the token, which stays valid until it expires. By default that lifetime is 4 weeks, so a token copied from a laptop or a stolen session remains usable for that whole window even after the user has logged out. Before you add a second replica, confirm with your identity and security teams how long that exposure is acceptable and whether your offboarding process depends on sign-out taking effect immediately. Redis is what makes revocation work across replicas, so this is a decision to record, not a detail to defer.
A single replica can run without Redis, and many evaluation and small-team installs do. The scaling guide accepts SQLite for single-replica deployments only when the database file sits on locally attached SSD or NVMe storage rather than network storage. Plan the move to multiple replicas as a single change that includes Redis, PostgreSQL, shared storage and an external vector store, and check each requirement against the current Open WebUI scaling documentation for the release you deploy, since configuration details change between versions. Ask your team to confirm, in a test environment, that a sign-out on one replica ends the session on the others before you send traffic to them.
Choosing Redis or Valkey as the shared store
Redis is the engine that many platform teams already run and monitor, which is why it is the usual starting point. In Open WebUI, it holds the shared state that lets several replicas serve the same signed-in user, including sessions, WebSocket coordination and application state. Your team may already have backup, failover and alerting runbooks for it, which lowers the onboarding effort.
- Shared session state: Sessions and WebSocket connections move into Redis so that any replica can answer a request from any user.
- Token revocation: Without Redis, signing out does not revoke tokens, which stay valid until they expire, by default after 4 weeks.
- Existing operational skills: Monitoring, patching and restore procedures your team already uses for Redis carry over.
- License review: Redis license terms have changed across major releases, so confirm the license of the exact build and any managed service terms with your legal team.
- Managed offerings: Cloud and hosting providers may sell Redis-compatible services, so confirm which engine and version they run before you connect Open WebUI.
Before you standardize on Redis, confirm the supported version in the Open WebUI scaling documentation and check that your hosting platform offers it.
Valkey is a BSD-licensed alternative that aims to be a drop-in replacement for Redis. In practice, a drop-in means that existing Redis clients and commands should work without application changes, so Open WebUI's connection settings can usually point at a Valkey host with no code change. It does not guarantee identical behavior in every edge case or every future release, so the connection path still needs testing.
- Client compatibility: Standard Redis clients should connect, but test session handling, WebSocket reconnects and sign-out in your own environment.
- License terms: BSD licensing is permissive and is often preferred by teams that redistribute software or want fewer license conditions. Have legal confirm the terms that apply to your use.
- Governance: A community-led project sets its own release priorities and maintainers. Ask how security fixes are published and how long each release line is supported.
- Feature drift: The two engines can diverge over time, so a future Open WebUI release could depend on a command that only one engine implements.
- Packaging availability: Confirm that your Kubernetes charts, Linux packages or managed service offer the Valkey version you need, with patch releases on a schedule you can meet.
Before choosing Valkey, confirm the supported engine and version with the Open WebUI documentation and record the test results for your first upgrade.
The choice is less about features than about which engine your standards team can approve, support and patch. Both options fill the same role in the architecture, so the decision should rest on licensing, support path and operations, followed by a test in an environment that matches production. The Open WebUI scaling guide is the starting point for the requirements that the store must meet.
- Approved software list: Check each candidate, and the exact version you plan to run, against your organization's approved software process.
- Support path: Ask who provides patches and incident support, and whether a commercial vendor or a community project stands behind the engine you choose.
- One engine per environment: Run the same engine in development, test and production so that test results reflect production behavior.
- Key prefixes on shared instances: If several applications share one Redis or Valkey instance, give Open WebUI keys their own prefix and document it, so that keys from other systems cannot collide with them.
- Retesting after change: Retest token revocation, WebSocket reconnects and login after each engine change or Open WebUI upgrade.
Record the engine, version, license review and owner in your decision log before you deploy.
Redis and Valkey configuration options and when each fits
This table compares the main hosting, engine, key separation, persistence, memory and security choices for Redis or Valkey in a scaled Open WebUI deployment. Read each row as a decision: the fit column says when the option makes sense, and the trade-off column names what you take on. Sign-out token revocation depends on Redis, so any setting that loses or evicts its data affects security as well as performance.
| Decision | When it fits | Trade-off |
|---|---|---|
| Single shared instance | One or a few replicas in one environment, run by a team that already operates Redis-compatible servers | One instance is a single point of failure unless you add failover, and every replica depends on it |
| Managed Redis-compatible service | Teams that want the provider to handle patching and backups inside an approved cloud account and region | Confirm the service's network access, TLS options and data hosting location before you rely on it |
| Valkey engine | You want a BSD-licensed server that is a drop-in replacement for Redis in your Open WebUI setup | Confirm the Valkey version you deploy is supported with your Open WebUI release and your own support contract |
| Redis engine | Your organization already runs, licenses and supports Redis across its platforms | Check the license terms of the Redis version you choose and confirm it matches your Open WebUI release |
| Separate instance per environment | Production, staging and test deployments that must never share sessions or revocation state | Adds one more server to run, patch and monitor for each environment |
| Shared instance with key prefix separation | Several Open WebUI deployments or other applications share one server to reduce operations work | Each deployment needs its own prefix set correctly, or two deployments can read each other's keys. Confirm the setting in your version's docs |
| Persistence (snapshots or append-only log) | Restarts should keep sessions and revocation state so users and revoked tokens behave the same after a restart | Persistence adds disk writes and storage to manage. Without it, confirm what a restart loses, especially revoked-token state |
| Memory cap and eviction policy | Any shared instance, where a memory limit protects other workloads and sets how Redis behaves when it is full | An eviction policy can drop keys Open WebUI still needs, and a no-eviction policy makes writes fail when memory is full. Test the choice under load |
| TLS and authentication | Redis traffic crosses a network segment, or the instance is shared across teams or clusters | Adds configuration on both server and client. Confirm which TLS and password settings your Open WebUI version accepts |
Using key prefixes when several applications share one Redis
Sharing one Redis between Open WebUI and other services is only safe when each application's keys sit under a prefix that no other application writes to or deletes from. Open WebUI keeps session, WebSocket coordination and token revocation state in Redis, along with shared cache entries. Without separation, another application that uses similar key names can overwrite a value Open WebUI depends on, and an administrator running a broad delete or pattern-based cleanup for one service can remove another service's data. The failures are often quiet: users see unexpected sign-outs or WebSocket drops that look like application faults. A prefix turns the shared Redis into a set of namespaces that each team can reason about, so record the prefix as part of the deployment inventory with the other shared dependencies.
Plan prefixes by environment first, then by application. A common approach gives every service a prefix that encodes both the environment and the application, so a staging restore or test cleanup cannot touch production keys. Assign one owner for the naming scheme, document it, and require a new prefix before any application connects to the shared instance. Logical database numbers alone do not give each application ownership of its keys, so use them as a supplement to prefixes, not a replacement. Confirm in the scaling documentation the exact configuration key that sets the Redis key prefix and whether it covers every key type Open WebUI writes, including WebSocket coordination. The current docs should be checked again before each upgrade.
Verify the prefix after configuration rather than assuming the setting applied. In staging, sign in, open a WebSocket session and then list keys with SCAN and a MATCH pattern for the expected prefix. Use SCAN instead of KEYS because KEYS blocks Redis while it runs, which is a risk on a busy shared instance. Any key Open WebUI creates outside the configured prefix means the setting did not take effect for that key type, so stop and resolve it before production. Repeat the check after upgrades, since key layouts can change between releases. Changing a prefix on a live system orphans existing keys, so plan a cutover window, expect users to sign in again, and keep the scan output as evidence of the configuration you tested.
How replicas, PostgreSQL, Redis and shared storage fit together
Traffic enters at the load balancer and fans out to several Open WebUI replicas, which share one PostgreSQL database, one Redis or Valkey instance for sessions, WebSocket coordination and application state, and shared file storage for uploads and knowledge. The client's infrastructure forms the trust boundary around all of it. When you review the diagram, check that every replica points at the same Redis, database and storage, and that no replica relies on local disk for state that another replica needs.
Shared state paths for Open WebUI replicas inside the client's trust boundary.
How to set up Redis or Valkey for a multi-replica Open WebUI
This sequence takes a multi-replica Open WebUI from a shared database to a shared Redis or Valkey state store, and ends with checks that prove sessions and WebSocket connections behave consistently across replicas.
Confirm PostgreSQL is in place
Before any replica starts, confirm that every replica will use PostgreSQL instead of SQLite. The scaling guide requires PostgreSQL for multi-instance deployments because SQLite does not handle concurrent writes from multiple processes well. Your platform team should confirm the database is reachable from every replica's network segment, backed up, and that its connection limits have been reviewed for the planned replica count. Done means a test replica connects to PostgreSQL and completes a sign-in without writing to a local SQLite file.
Provision Redis or Valkey inside your network
Deploy a Redis-compatible instance inside the network you control, reachable only from the Open WebUI replicas and admin hosts. Valkey is a BSD-licensed drop-in alternative to Redis, so the Open WebUI configuration is the same for either engine. Ask your platform team to confirm the version your organization supports, the persistence and memory settings, and whether the service runs as a single node or a managed highly available setup. Done means a client on a replica subnet can ping the instance and a client outside the allowed subnets cannot.
Configure key prefixes and authentication
Enable authentication on the Redis or Valkey instance and store its password in your secrets manager, not in a compose file or plain values file. If several Open WebUI environments share one instance, give each deployment its own key prefix so keys from staging and production cannot collide or be flushed together. Record the prefix, the instance address and the credential owner in your runbook. Done means a manual connection with the credential succeeds, an unauthenticated connection is refused, and the prefix you chose is documented for the environment.
Point all replicas at the same instance
Set the same Redis or Valkey connection settings, the same PostgreSQL connection, the same shared secret and the same file storage configuration on every replica. A replica with a different secret or Redis target will produce login loops and inconsistent sessions that look like application bugs. Roll replicas one at a time and watch startup logs for successful Redis and database connections. Done means each replica reports a healthy start against the same backends and a sign-in on one replica is accepted by the others.
Verify sign-out revokes tokens across replicas
Sign in through the load balancer so the session lands on replica A, then sign out. Send the old token to replica B and confirm it is rejected. Without Redis, sign-out does not revoke tokens, which stay valid until expiry, by default after 4 weeks, so this test is the proof that shared state works. Repeat with the replicas in reverse order. Done means the revoked token fails on every replica in both directions, and you have recorded the test date and the configuration version.
Verify WebSocket sessions reconnect after a replica restart
Open a chat that streams a response, then restart the replica that holds the WebSocket connection. Confirm the browser reconnects to a surviving replica without requiring a fresh sign-in, and that a new prompt completes. Check the logs on both replicas for Redis errors during the reconnect. Done means the client recovers within the behavior your team accepts, and any error that appears is captured with the replica name and timestamp for follow-up.
Record the configuration and schedule retests
Store the final connection settings, prefix scheme, credential rotation owner and test results in your change record. Add the sign-out and reconnect checks to every upgrade and every change to replica count, Redis topology or secrets. Because Open WebUI releases change frequently, confirm each upgrade still uses the same Redis-related settings before rolling replicas. Done means the change record names an owner for the Redis instance and the repeatable tests are scheduled.
Securing the shared Redis instance
Redis in Open WebUI holds session and connection state that every replica depends on, so a compromised or exposed instance can affect every user at once. The six controls below cover who can reach the instance, how it proves identity, what it keeps on disk, what it writes to logs and how it gets patched. Confirm the specific settings with your security team before go-live.
Restrict network reachability
Place the Redis endpoint on a private subnet or internal service network that only the Open WebUI replicas and approved administration hosts can reach. Do not publish the Redis port on a public load balancer or a node port. Review security group, network policy or firewall rules after every infrastructure change, since a single permissive rule exposes session state to the whole network segment.
Require authentication on every connection
Enable a password or ACL-based user for the shared instance and store the credential in your secrets manager, then pass it to the replicas through their environment configuration. An unauthenticated instance lets any workload on the network read or delete session keys. Ask your team which ACL user Open WebUI connects as and confirm it has only the commands and key prefixes it needs.
Encrypt traffic in transit
Use TLS for connections between Open WebUI and Redis or Valkey when the traffic crosses a host, node or zone boundary you do not fully control. Session identifiers and WebSocket coordination data travel over these links, so plaintext transport exposes them to anyone who can observe the segment. Confirm with your team whether the client build and your Redis-compatible engine support the TLS options you plan to use, and test certificate rotation.
Plan persistence for session state
Decide whether the instance writes snapshots or an append-only log to disk. Persisted files contain session-related keys, so backups must be encrypted and access-controlled like other credential stores. Also decide what happens after a restore: revoked tokens could return if an older snapshot is loaded, which affects the sign-out guarantee that Redis provides. Ask your team to document the restore procedure and the retention period for backups.
Keep tokens out of logs
Review the log level and any command logging on the Redis server and on the Open WebUI side. Session keys and token values appear in debug output or slow-query captures if they are not filtered, and log platforms often retain them longer than the tokens remain valid. Set log retention and access rules for these sources, and test with a known test session that the token value does not appear in logs.
Patch the engine on a schedule
Track security advisories for the Redis or Valkey release you run and apply minor and security updates through a tested change window. Maintain an inventory of the exact engine version on every shared instance, including managed services, so you can answer a vulnerability question quickly. Confirm the upgrade path with the vendor or distribution you use before you change versions in production.
Questions buyers ask about Redis and Valkey for Open WebUI
Can Valkey replace Redis in an Open WebUI deployment?
Valkey is positioned as a BSD-licensed drop-in replacement for Redis, so an Open WebUI deployment can usually point at a Valkey server through the same Redis connection settings. Licensing is the main reason teams choose it, and your legal or procurement team should review the license terms of whichever Redis distribution you would otherwise run. Compatibility is still a test item, not an assumption. Confirm which Valkey version you plan to use against the Open WebUI release you are deploying, then verify login, sign-out, websocket sessions and multi-replica behavior in a staging environment before production.
Does a single Open WebUI replica need Redis?
A single replica can run without Redis, but the scaling guide makes Redis a requirement once you run multiple replicas. In multi-replica setups, Redis holds shared state for sessions, websocket connections and application state. Without Redis, signing out does not revoke tokens. They stay valid until they expire, which is four weeks by default. If your security policy requires sign-out to end access immediately, a single replica still has a reason to use Redis. Review the scaling guide and decide based on your sign-out requirement and whether you expect to add replicas later.
How much effort does a Redis or Valkey setup take?
Effort depends on what already exists and how the service must behave, so no duration applies until the environment is reviewed. The main drivers are whether you have an existing Redis or Valkey service to reuse or must build one, the topology you need (a single instance, or Sentinel or Cluster for failover), network paths from every replica, TLS and authentication settings, monitoring and backup of the Redis service, and the testing needed to prove sign-out revocation and websocket behavior across replicas. Ask any provider to break its quote into these items so you can see which parts are one-time setup and which recur as operating work.
Can our team set up Redis for Open WebUI on its own?
Many teams can, especially if they already run Redis or Valkey and operate Docker, Kubernetes or similar platforms. The parts most often underestimated are not the connection settings but the verification: confirming that tokens are revoked on sign-out across replicas, that websocket connections survive a replica restart, and that the Redis service stays available under normal load. Check whether your team has someone who has operated Redis in production, has time to test multi-replica behavior, and can own the service after handover. If any of those are missing, a scoped engagement can cover the gap while your team keeps ownership.
What does the work need from our team?
The work needs a few concrete inputs from your side before it starts:
- Network access from every Open WebUI replica to the Redis or Valkey endpoint, including any firewall or security group rules your change process requires.
- A named Redis owner who can approve configuration, access and maintenance windows.
- Test accounts with different roles, so sign-in, sign-out, group permissions and multi-user sessions can be checked end to end.
- Access to how secrets are stored and injected into your deployment, and to the PostgreSQL and shared file storage the replicas already use.
Agree these inputs in writing as part of the scope, along with who signs off on the test results.
How is failover handled for Redis or Valkey?
Failover depends on the Redis topology you choose. A single Redis or Valkey instance is a single point of failure for shared state, so an outage can disrupt sessions and websocket coordination across replicas. Sentinel and Cluster add failover, but they also need client settings, including socket timeouts and separate WebSocket Redis settings, so that a failover does not leave the application hanging. These details are covered in the sibling topic on Open WebUI Redis Sentinel and cluster failover. Before choosing a topology, ask what happens to active sessions during failover and test that behavior in staging.
How DeployOpen scopes Redis and Valkey work for Open WebUI
DeployOpen scopes Redis or Valkey work for Open WebUI as a fixed-scope engagement, with the scope, deliverables and timeline agreed in writing before any change is made. The first step is a review of the current topology: how many Open WebUI replicas run, where PostgreSQL, the vector store and file storage live, whether a Redis instance already exists, and which sign-out and WebSocket behavior users rely on today. That review produces the decisions the rest of the work depends on, including whether the client standardizes on Redis or Valkey and which key prefix each Open WebUI environment will use when several applications share one server.
Implementation happens in infrastructure the client controls, whether that is their cloud account, data center or private network. DeployOpen configures the Redis-compatible connection settings, applies the agreed prefixes, and checks that the server's access controls, persistence settings and network paths match the client's security baseline. Testing then focuses on the behavior that Redis changes most visibly: confirming that signing out revokes tokens on every replica rather than leaving them valid until expiry, and confirming that WebSocket connections are coordinated correctly when a user's requests land on different replicas. Each test result is recorded so the client's own team can repeat it later.
Ongoing support is offered as a separate retainer, not bundled into the fixed scope. A retainer can cover version upgrades of the Open WebUI release line, periodic re-testing of sign-out and WebSocket behavior after changes, and review of Redis capacity as user counts grow. Clients should ask for the written scope to name the Redis or Valkey version, the hosting model, who holds the server credentials, and what happens to the configuration if the team later moves to Redis Sentinel or Redis Cluster.

