Open WebUI production setup with Docker Compose

Docker Compose can serve a small team well when the data volume, secret key, pinned image and backups are set correctly. This page covers when to stop at Compose and what the production setup needs.

On this page

When Docker Compose is the right production setup for Open WebUI

A team wants one shared Open WebUI instance running on infrastructure it controls, serving a known group of users. Docker Compose is one of the official install methods for Open WebUI, alongside Kubernetes with Helm and a pip install, and it fits a single-host team deployment well. One host runs the application container, a persistent data volume and, if you choose it, a PostgreSQL container, all defined in one file that your team can review, version and redeploy. This page covers the settings that make that setup safe to run for a team: a pinned image tag, a persistent data volume with a stable secret key, PostgreSQL instead of SQLite when the workload calls for it, and a backup routine you have actually tested.

The point where Compose stops being enough is multiple replicas. The scaling guide requires PostgreSQL instead of SQLite for multi-instance deployments, and for multiple replicas it also requires Redis as a shared state store for sessions, websocket connections and application state, plus shared file storage so uploads and knowledge stay reachable from every replica. It also warns that the default ChromaDB will crash in multi-process setups, so an external vector database is needed when you run several workers or replicas. If your plan involves more than one application container behind a load balancer, you are past the scope of this single-host pattern and should plan for those components before you deploy.

Before you commit, confirm three things. First, whether your team can accept a single host as the availability boundary, including the maintenance window for host patching and image upgrades. Second, whether your storage meets the scaling guide's condition for SQLite, which is acceptable for single-replica, small-team use only when the database file sits on locally attached SSD or NVMe storage rather than network storage. Third, who owns restores: a backup you have never restored is not yet a backup. Check the current release notes on the Open WebUI releases on GitHub page before choosing a tag, because upgrade behavior and licensing differ between releases.

Configuration choices in a Compose production stack

This table compares the three configuration choices that shape a Compose deployment: the database, the image tag and the vector store. Read each row against your team size and replica plan, because the scaling guide's requirements change once you run more than one instance.

ChoiceOptionWhen it fits a small teamWhen it does not fit
DatabaseSQLite on locally attached SSD or NVMeSingle replica, evaluation or a small team, with the database file on local SSD or NVMe storageAny multi-instance setup, or a database file on network storage
DatabasePostgreSQLMultiple replicas or workers, or when you want the database outside the container hostRarely a poor fit, but it adds a service to back up, patch and monitor
Image tagPinned release tag (for example, a specific v0.12.x version)Teams that test upgrades, read release notes and roll forward on their own scheduleTeams that never schedule upgrades and let security fixes lag behind
Image tagFloating tag such as latestThrowaway evaluation environments where changes can break without consequenceShared production use, because a pull can change behavior between restarts
Vector storeDefault local ChromaDBSingle-process evaluation with light retrieval useSeveral workers or replicas, since the scaling guide warns the default ChromaDB will crash in multi-process setups
Vector storeExternal vector databaseMulti-process or multi-replica deployments, or when retrieval data must be backed up separatelySingle-user setups where the added service adds more operational work than it saves

How to build the Compose stack step by step

This sequence turns a single Compose file into a team deployment that keeps its users, chats and settings across restarts, upgrades and restores. Each step ends with a check you can run before moving on.

  1. Choose and pin the image tag

    Open the project's GitHub releases page and pick the release your team will standardize on, then write that exact tag into the image line of the Compose file instead of using a floating tag such as latest. Record the tag, the date you chose it and who approved it in your change log. Check that the file reads one fixed version string and that docker compose config resolves without errors. Read the release notes for any license or migration notes before you pull, because releases after v0.6.5 fall under the Open WebUI License.

  2. Define the persistent data volume

    Mount a named Docker volume or a bind mount to the container's data path so the application database, uploads and settings live outside the container filesystem. Use the same volume name in every environment so restores are predictable. Confirm the mount with docker volume inspect or the host path listing, and make sure the host directory is on local storage that your backup tooling can read. The check is simple: create a test file through the running application, which you will verify again in a later step.

  3. Set a stable secret key before first start

    Generate a long random value, store it in your secrets manager or an environment file with restricted permissions, and pass it to the container as the secret key variable before the first start. Changing this key later can invalidate sessions and encrypted values, so the same key must be carried into every replacement container and every restore. Confirm the variable appears inside the container with a masked check, not by printing the value into logs, and keep a record of where the key is held and who can read it.

  4. Add PostgreSQL with its own volume

    Add a PostgreSQL service with a separate named volume, a pinned major version and credentials taken from your secrets store, then point the Open WebUI database connection string at it. The application needs PostgreSQL instead of SQLite as soon as more than one instance is planned, and the scaling guide also treats SQLite as a single-replica option for local SSD or NVMe storage only. Start the database first and confirm it accepts connections before the application starts, and check that the application logs show it connected to PostgreSQL rather than a local file.

  5. Put a reverse proxy in front

    Place a reverse proxy on the Compose network to terminate TLS, forward the application port and pass WebSocket upgrade headers. Expose only the proxy's HTTPS port to users and keep the application and database ports off the host interface. Your proxy choice and certificate source are set by your environment, so confirm them with your security team before you configure them. The check is that the public hostname loads over HTTPS with a valid certificate, and that a streamed chat response arrives progressively rather than all at once.

  6. Verify login and data persistence

    Sign in with an administrator account, create a test user and a short conversation, then upload a small file. Recreate the application container with docker compose up -d --force-recreate without touching the volumes, sign in again and confirm the account, conversation and file are still present. Also confirm that the secret key did not change between the two starts. Record the result and the commands you used, because this is the baseline for every later upgrade test.

  7. Run a backup and restore test

    Back up the application volume and the PostgreSQL data together, using a consistent method such as a database dump taken while the application is idle plus a copy of the data volume. Restore both into a separate project or host with the same secret key and confirm that the test user, conversation and uploaded file are visible after sign-in. Note how long the restore took and who ran it. The step is complete only when the restored copy works, because an untested backup is not a recovery plan.

How the Compose services and data volumes connect

The diagram starts with the browser, which reaches Open WebUI only through the reverse proxy on the team network. Open WebUI reads and writes state in PostgreSQL and in the persistent data volume, which hold the database and uploads, so those are the two places to back up. Model provider calls leave the team network through the outbound path, and that crossing is the trust boundary to review: prompts and retrieved content go to whichever provider the configuration points at, so confirm each endpoint and its data terms before enabling it.

Stateful components sit inside the team network, and model calls cross out of it.

Protecting the data volume and secret key

The data volume holds the state that makes an Open WebUI instance yours. By default that is the SQLite database file webui.db, which stores users, groups, chats, settings and API keys, along with uploaded files and any local vector store data. All of it lives in the data directory mounted into the container, typically /app/backend/data in the official image, though you should confirm the path for the tag you pin. Put that directory on a host path or named volume that survives docker compose down, image updates and host rebuilds. Treat docker compose down -v as a destructive command, because the -v flag removes named volumes and their contents.

The secret key, set as WEBUI_SECRET_KEY, is what the instance uses to sign session tokens. Set it once, store it, and reuse the same value on every restart and redeploy. If the variable is unset or changes between starts, tokens issued under the old value stop validating, so users are signed out and may lose work in progress. Before any rotation, confirm in the Open WebUI documentation whether the key also protects values encrypted in the database. If it does, changing it can make those stored values unreadable, so plan rotation as a maintenance task with a tested backup and a restore path. Multi-replica setups keep session state in Redis, which is covered in the Open WebUI scaling guide.

Keep the key out of the Compose file, because a docker-compose.yml committed to version control exposes it to everyone with repository access. Place the value in a .env file beside the Compose file, reference it as ${WEBUI_SECRET_KEY}, add .env to .gitignore, and restrict it with chmod 600 so only the deployment account can read it. Generate the key with a cryptographically secure random generator, and record it in your team's secrets manager so a rebuilt host can recover it. On the host, limit access to the data directory to the service account and administrators. Anyone who holds both the database and the key can mint tokens the instance accepts, so backups must be encrypted and handled with the same restrictions as the live volume.

Security and operations to plan for a Compose deployment

A Compose stack is quick to start and easy to leave running unattended. The six items below cover the decisions that keep a team deployment safe after the first login: what version runs, how long sessions last, who holds admin rights, how data is recovered, how the host is maintained and where the port is reachable.

Pinned image updates and release review

Pin the Open WebUI image to a specific tag in the docker-compose.yml file rather than a floating tag, so a restart never pulls a new release unannounced. Read the release notes for each version before changing the tag, including any license or configuration changes, and test the new tag against a copy of your data first. Record which tag runs in production and who approved the change.

Latest release in sources
v0.12.3
Open WebUI releases

Token lifetime and the Redis gap

Without Redis, signing out does not revoke tokens. They stay valid until they expire, which is 4 weeks by default. A single-container Compose stack without Redis therefore has a session revocation gap that matters after an offboarding or a suspected compromise. Decide whether that window is acceptable, and if not, plan a Redis service or a shorter token lifetime and test that a sign-out actually ends access.

Scaling Open WebUI docs

Admin access and SSO before rollout

Create the first administrator account only once and keep its credentials in a password manager with a named owner. Before opening the instance to the wider team, connect SSO through OIDC or LDAP, decide which group receives admin rights, and disable password sign-up where SSO covers everyone. Confirm that MFA and SCIM provisioning behave as your identity provider expects, because removing a user in the directory should remove access in Open WebUI.

Open WebUI features

Backup encryption and restore testing

A backup of the data volume contains chats, uploads, user records and the secret key, so it needs the same protection as production data. Encrypt backups at rest, restrict who can read them, and store copies outside the host. For PostgreSQL, back up the database and the volume together, since they must match. A backup counts only after a restore into a separate stack has been tested and a user can sign in and see prior conversations.

Database and volume to match
2 sources

Host patching and log retention

The Docker host runs its own operating system, container runtime and packages, and these need a patch cadence separate from the Open WebUI image. Define who applies host updates, how they are scheduled around active use, and how a failed reboot is recovered. Set a log retention period in the container logging driver or the central log platform, and confirm that logs do not capture prompts or secrets you are not permitted to keep.

Network exposure of the published port

Compose files often publish the container port on all host interfaces, which exposes Open WebUI directly to the network the host sits on. Bind the port to a specific interface or to localhost, and place a reverse proxy with TLS in front of it. Confirm with a port scan from outside the intended network that nothing else is reachable, and that the Ollama or other model ports are not published by accident.

Questions teams ask before running Open WebUI on Compose

What drives the cost and effort of a Docker Compose setup for Open WebUI?

The main cost is the time of the people who design, build, test and hand over the stack, not the software, which is free to run. Effort rises with the number of users, whether you need PostgreSQL and a separate vector store, how many identity providers you connect, the reverse proxy and certificate work, and how much evidence your security or compliance team wants. Ask any partner for a written scope that lists each of these items separately, so you can see which parts are one-time work and which recur. Infrastructure costs for hosts, storage and model providers are billed by your cloud or vendors, not by the implementer.

How long does the initial Open WebUI Compose build usually take?

Duration depends on the decisions made before the build starts, more than on the Compose file itself. Plan time for host sizing, DNS, certificate issuance, identity integration, database and storage choices, a restore test and user acceptance. Single-user evaluations move quickly, while a team deployment with SSO, PostgreSQL and backups takes longer because each dependency needs approval and testing. Ask for a timeline tied to named milestones in the written scope, and confirm which of your internal approvals fall on the critical path.

What must our team provide before a Compose deployment starts?

Most delays come from missing inputs rather than from the build itself. Confirm that you can provide:

  • A Linux host or VM with enough CPU, memory and locally attached SSD or NVMe storage for the data directory
  • A DNS name and firewall rules for the users who will reach the service
  • A certificate source, such as a public CA or an internal CA, and the chain your clients trust
  • An identity provider, group structure and an owner who can approve the OIDC or LDAP settings
  • Named owners for the model providers and API keys, and for backup storage

If you route traffic through a corporate proxy or intercepting network, add that to the list early.

Can one internal administrator set up Open WebUI on Compose alone?

A capable Docker administrator can run a single-user or evaluation stack alone, using the official Docker Compose install method. A team deployment is harder for one person because it touches networking, certificates, identity, database administration and backups at the same time, and a single owner rarely covers all of them. Decide who owns the host, who owns identity, and who can perform a restore before the build starts. If one person must do everything, ask for a written handover covering the Compose file, the secret key, the backup schedule and the restore procedure.

What recurring work follows a production Compose deployment?

The work after launch is mostly routine but it must have an owner. Plan for regular upgrades to a pinned image tag after reading the release notes, backups of the database and the data volume on a schedule, and restore tests on a copy of the environment so you know backups work. Add log review, certificate renewal, monitoring of disk space and periodic review of user access and API keys. Ask any partner whether these are one-time handover items or a retainer, and what the retainer covers.

When should an Open WebUI deployment move from Compose to Kubernetes or another platform?

Move when you need multiple replicas, rolling updates across hosts, or platform controls your organization already runs elsewhere. The scaling guide requires PostgreSQL instead of SQLite for multi-instance deployments, and multiple replicas also need Redis and shared file storage, and an external vector database because the default ChromaDB will crash in multi-process setups. Without Redis, signing out does not revoke tokens, which stay valid until they expire, by default after 4 weeks. If you are planning those changes, the Kubernetes or managed cloud paths may fit better than stretching a single Compose host.

When does the Open WebUI License apply to our deployment?

The Open WebUI License applies to code from v0.6.6 onward, which was released on April 19, 2025. Code through v0.6.5 remains under BSD-3-Clause. The license forbids altering or removing Open WebUI branding in deployments that exceed 50 users in any rolling 30-day period, unless you hold an enterprise license or written contributor permission. Confirm your peak user count against that threshold with your legal team, and check the current license text before you change branding. Enterprise pricing is not published and is quoted after contacting enterprise sales with an expected seat count.

Backups that can be restored

A backup of an Open WebUI Compose stack is only useful if it captures everything the application needs to come back with its users, chats, uploads and settings intact. Back up three things together and at the same point in time: the PostgreSQL database, the persistent data volume that holds uploads and other files, and the secret key. Backing up the database without the matching volume leaves chat metadata pointing at files that no longer exist. Backing up the volume without the database leaves files with no records that reference them. The secret key is the item teams most often forget. Store it in a secrets manager or an encrypted vault that is separate from the backup archives, and record which key version matches which backup, because a restored instance started with a different key may be unable to read data that was encrypted or signed with the original.

Schedule the database dump and the volume copy from the same job, so the two snapshots are as close in time as your tooling allows. Use pg_dump for logical dumps of the PostgreSQL database, and archive the data volume with a tool that preserves ownership and permissions. Keep a retention policy that covers both daily recent copies and older weekly or monthly points, and decide how long backups must be kept based on your own recovery and records requirements. Copy every backup set offsite to storage in a different failure domain, and encrypt it before it leaves the host. Confirm with your security team where that offsite storage lives, who can read it and whether it falls under the same data residency rules as the chat data itself.

A backup is not proven until it restores. Run a restore test on a separate host at a set interval, starting from the offsite copy alone, using only the secret key from your vault. Bring up the same pinned image tag, restore the database and the volume, start the stack and sign in as an administrator. Then check that a known conversation, an uploaded file and a user account are present and that a chat response still works. Record how long the restore took, because that figure is the realistic basis for your recovery time expectations. Confirm with your own team how often the test should run and who signs off on the result.

How DeployOpen scopes and delivers a Compose production setup

DeployOpen plans, builds, hardens and documents Open WebUI production setup with Docker Compose inside your own infrastructure, so the setup can be reviewed by your security and compliance teams. We start from a written scope, deliver against it, and hand over the files, runbooks and evidence your team needs to operate the stack.

How we scope

  • Written scope names the hosts, image tags, persistent volumes, secret handling and backup targets covered by the engagement.
  • We confirm user count, model providers and whether PostgreSQL, Redis and external vector storage are needed for your planned replicas.
  • Engagements are fixed-scope, so deliverables and timelines are agreed in writing before any build work starts.

How we build

  • We write the Compose file with pinned image tags, a persistent data volume and a managed secret key for your environment.
  • We configure PostgreSQL instead of SQLite where your team size or replica plan requires it, and test the database connection.
  • We set up scheduled backups of the data volume and database, then run a timed restore test before handover.

How we hand over

  • You receive the Compose files, environment templates, reverse proxy notes and a documented upgrade procedure for your team.
  • Runbooks cover backups, restores, log locations, health checks and the steps to rotate the secret key safely.
  • We deliver a written record of configuration decisions so your security and compliance reviewers can trace each control.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after the initial handover.
  • Retainers can cover reviewing new Open WebUI releases, testing upgrades in a staging copy and applying them on your schedule.
  • Confirm with DeployOpen during scoping which support hours, response channels and testing cadence the retainer includes.

Sources and further reading

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.