Open WebUI with Docker Swarm

Open WebUI on Docker Swarm works well for a single replica on a small cluster, but scaling replicas needs PostgreSQL, Redis, shared storage and an external vector database first. This page covers the stack, the GPU choice and the checks.

On this page

How Open WebUI on Docker Swarm fits a team that already runs Swarm

Swarm can run Open WebUI, ChromaDB and Ollama as one stack, but the scaling requirements in the Open WebUI docs decide what that stack must contain. A single replica with a local SQLite file can run on one node. Once you add replicas, the stack needs PostgreSQL, Redis for shared state, shared file storage and an external vector database, because the default ChromaDB is documented as unsafe in multi-process setups. Plan the stack around that list before you write the first stack file.

Open WebUI is the user-facing application. It handles sign-in, chat history, administration and the connections to model servers. ChromaDB is the vector database that stores embeddings for document retrieval. In HTTP mode it runs as its own service, which lets every Open WebUI replica share one index instead of each process holding its own copy. Ollama is the model runtime. It loads models, serves them over its REST API on port 11434 and can use GPUs when the node has them. Each service has different state, different storage needs and different resource profiles, so each should be placed and sized on its own terms.

The Open WebUI docs list Docker and Docker Compose as official install methods and do not include a Swarm-specific guide, so your team will translate the Compose pattern into a stack file and own that translation. The Ollama docs state that the local API on 127.0.0.1:11434 needs no authentication. Do not publish that port on an overlay network or the host interface. Keep Ollama on an internal network reachable only from the Open WebUI service, and confirm the placement with your own network tests before you go live.

Open WebUI talks to Ollama and ChromaDB only over the internal overlay network

The diagram starts at the public edge, where users reach a reverse proxy that routes to Open WebUI replicas. Those replicas call Ollama and ChromaDB across the internal overlay network, and every replica shares PostgreSQL, Redis and file storage. Check that the Ollama node is the only place inference runs, that no service other than the proxy publishes a port, and that the single-replica path skips Redis and the shared file store only if you accept the trade-offs described in this section.

Request and data paths for the Open WebUI stack, with trust boundaries marked.

Which configuration options fit a single replica and which fit scaled replicas

This table compares the main configuration choices for an Open WebUI Swarm stack and marks which ones suit a single replica and which ones a multi-replica service. Read each row for the fit, then the trade-off that decides whether the choice holds once you add replicas.

OptionBest fitTrade-offWhen to choose it
SQLite on local SSD or NVMeEvaluation, small team, single replicaConcurrent writes from multiple processes are not handled well, so it does not suit several replicasOnly when the database file sits on locally attached SSD or NVMe, not network storage, and the stack runs one replica
PostgreSQLMulti-replicaAnother service to deploy, back up and size, and the stack must point every replica at itRequired by the scaling guide for multi-instance deployments, so plan it before adding a second replica
ChromaDB bundled (default)Single replica, evaluationThe scaling guide warns the default ChromaDB will crash in multi-process setupsOnly for a single worker and replica with light retrieval use
ChromaDB in HTTP modeMulti-replicaRuns as its own service that every replica must reach, adding network and sizing workRequired when running several workers or replicas, per the scaling guide's external vector database requirement
Another vector database from the features docsMulti-replica, larger knowledge basesRequires a separate deployment, credentials and operational ownership, and must be confirmed against the current docsWhen your team already runs a supported store such as PGVector, Qdrant, Milvus or Elasticsearch and wants to reuse it
Redis absentSingle replicaSigning out does not revoke tokens, which stay valid until they expire, by default after 4 weeksAcceptable only for one replica where that token behavior is reviewed and accepted
Redis presentMulti-replicaAnother stateful service to run, and shared session state must be reachable from every replicaRequired for multiple replicas to share sessions, websocket connections and application state
Ollama on CPU in the stackEvaluation, small teamSlower inference and less model headroom, with concurrency limited by OLLAMA_NUM_PARALLEL (default 1) per modelUseful for testing the stack before committing to accelerator hardware
Ollama on GPUSmall team to multi-replica consumersNeeds GPU-capable Swarm nodes and placement constraints, and driver setup must be confirmed for your Docker versionWhen inference throughput matters and the GPU node can be pinned in the stack
Ollama as a Swarm service versus a dedicated hostSingle replica to shared inferenceA Swarm service shares the cluster's scheduling and restart behavior, while a dedicated host isolates model memory and GPU useSwarm service for a small, contained stack; dedicated host when several applications share one model server

Running Ollama on CPU or GPU nodes in a Swarm stack

On CPU-only nodes, Ollama runs as a normal service container with no accelerator devices attached. This is the simpler placement: the stack's Ollama service is constrained to nodes that have no GPU, and inference uses the host CPU through Ollama's llama.cpp backend. Response times are typically longer than on a GPU, so the node sizing and model choice need to be tested against the users you expect, not assumed from a small evaluation.

  • Model storage: Models live in ~/.ollama/models on macOS, /usr/share/ollama/.ollama/models on Linux and the .ollama\models folder on Windows. Set OLLAMA_MODELS to a directory on a volume you manage, and mount that volume into the container so models survive redeploys.
  • Parallel requests: OLLAMA_NUM_PARALLEL defaults to 1 request per model. Raise it only after load tests show the node has memory and CPU headroom for the extra concurrent work.
  • Loaded models: OLLAMA_MAX_LOADED_MODELS defaults to 3 on CPU. Each loaded model holds memory, so fewer loaded models may be needed on smaller nodes.
  • Queue depth: OLLAMA_MAX_QUEUE defaults to 512 queued requests. A deep queue hides overload from users, so set it with timeouts in mind.
  • Network exposure: Ollama binds to 127.0.0.1 port 11434 by default. Inside a stack, set OLLAMA_HOST so only Open WebUI on the overlay network can reach it, and keep the port off public interfaces.

Confirm the node memory, the model sizes you plan to run and the exact default values for your Ollama release with the Ollama FAQ before you set limits.

How to deploy the stack in the right order

This sequence brings up Ollama, ChromaDB and Open WebUI on an internal Swarm overlay network, with data that survives redeploys. Each step ends with a check, so you can stop and fix a failing service before you add the next one.

  1. Prepare Swarm nodes and placement labels

    Label each Swarm node by hardware: one label for nodes with NVIDIA GPUs and another for CPU-only nodes, so Ollama is scheduled where its models will run. For GPU nodes, confirm with your Docker Engine and NVIDIA container runtime documentation how GPUs are advertised to Swarm as generic resources, because the stack file depends on that setup. Run docker node inspect on each node to confirm the labels and resources appear. This step is done when every node you plan to use shows its expected labels and resources.

  2. Create secrets and the persistent data location

    Create the Open WebUI secret key and any database password with docker secret create, and reference them in the stack file as secrets. Choose a persistent location for Open WebUI data and Ollama models, either named volumes pinned to specific nodes or a directory on local disk, and record which node holds each one. If you run a single Open WebUI replica with SQLite, keep the database file on locally attached SSD or NVMe storage, because network storage is not suitable for it. This step is done when docker secret ls lists the secrets and each storage path exists on the node that will run its service.

  3. Deploy Ollama and pull approved models

    Deploy the Ollama service on the internal overlay network, set OLLAMA_MODELS to the persistent path, and set OLLAMA_HOST so the server listens inside the container. Ollama binds to 127.0.0.1 port 11434 by default, so the bind address must change for other services to reach it. Do not add a ports entry for 11434, because the local API requires no authentication and should stay reachable only from the internal network. Pull the models you have approved with docker exec into the Ollama container. This step is done when ollama list shows the expected models and a test request from a second container on the overlay returns a response.

  4. Deploy ChromaDB in HTTP mode internally

    Run ChromaDB as its own service in HTTP server mode on the same internal overlay network, with a named volume for its data and no published port. Confirm the image tag, listening port and data path in the ChromaDB documentation for the version you pin, because this guide does not set those details. Open WebUI will reach ChromaDB by service name, so use the name you plan to configure later. The scaling guide warns that the default ChromaDB crashes in multi-process setups, which is one reason to run it as a separate service. This step is done when a second container on the overlay gets a response from ChromaDB and the service is unreachable from outside the network.

  5. Deploy Open WebUI pinned to a release tag

    Set the Open WebUI image to an explicit release tag such as v0.12.3, which the project published on October 16, 2026. Pinning matters because the project releases often, so an unpinned tag can change behavior between redeploys. Point Open WebUI at Ollama and ChromaDB by their service names on the overlay, and attach the secret key and data volume. Confirm the tag exists on the project's releases page before deploying. This step is done when docker service ps shows the Open WebUI task running and the logs contain no database or vector store connection errors.

  6. Verify health, a model answer and data persistence

    Check the Open WebUI health endpoint from a container on the overlay, using the path listed in the documentation for your pinned release. Sign in, select a model served by Ollama and send a test prompt to confirm the answer appears in the interface. Then redeploy the stack with docker stack deploy using the same volumes, and confirm that the test account, chat history and settings still exist. This step is done when the health check passes, the model answers and the data survives the redeploy.

  7. Hold replica scaling until shared services exist

    Keep the stack at one Open WebUI replica until PostgreSQL, Redis, shared file storage and an external vector database are in place. The scaling guide requires PostgreSQL instead of SQLite for multi-instance deployments and needs Redis for shared sessions and websocket state. Without Redis, signing out does not revoke tokens, which stay valid until they expire, by default after 4 weeks. Review the scaling guide before changing the replica count. This step is done when you have a written list of those services and a test plan for each replica count.

Security controls for an internal Swarm stack

A Swarm stack that combines Open WebUI, ChromaDB and Ollama puts model access, stored prompts and credentials on the same network. The cards below cover the controls that keep the internal services internal, keep cloud calls off unless you approve them, and limit who can change the stack.

Keep internal services off published ports

Attach Ollama and ChromaDB only to the internal overlay network and publish no ports for them. The local Ollama API at port 11434 does not require authentication, so anyone who can reach that port can run models on your hardware. Only Open WebUI should accept traffic from outside the cluster. Confirm with docker service inspect that the Ollama and ChromaDB services show no published ports and that the overlay network is marked internal where your design allows it.

Disable Ollama cloud features

Set OLLAMA_NO_CLOUD=1 on the Ollama service, or the equivalent setting in the server configuration file, if your policy does not allow cloud inference. Without this setting, direct cloud calls to ollama.com can use an API key you have configured. Confirm that every Ollama task in the stack carries the variable, because a single unset replica can route a request outside your environment.

Ollama FAQ

Store secrets in Swarm secrets

Keep the Open WebUI secret key and database credentials out of the stack file and environment variables by creating them as Swarm secrets with docker secret create and mounting them into the service. Environment variables appear in service inspection output and in many logs. Confirm that the secret key is stable across replicas, because changing it invalidates existing sessions, and that rotation has a documented procedure.

Restrict who can deploy stack updates

Stack updates run through the Docker API on manager nodes, so a user who can run docker stack deploy on a manager can change images, mounts and network rules. Limit manager access to named administrators, use the Docker access control options your platform supports, and record who deployed each version. Confirm that image tags are pinned, so a deploy cannot pull a different Open WebUI build without a review.

Control access to model and data directories

Model files and the Open WebUI data volume sit on each node's local disk. Set ownership and permissions so only the service user can read or write the OLLAMA_MODELS directory and the Open WebUI data path, and keep backups of those paths under the same rules. Confirm that the directories are not world-readable and that no other container on the node mounts them.

Route user traffic through a TLS proxy

Place a reverse proxy with TLS termination in front of Open WebUI so that user sessions, passwords and uploads are never sent in clear text on the network. The proxy should be the only service that publishes a port. Confirm that the certificate chain is valid for the public name, that WebSocket upgrades pass through, and that Open WebUI is not reachable directly on its published port from outside the cluster.

What changes before you scale Open WebUI replicas

Running more than one Open WebUI replica in Swarm changes the data layer before it changes anything else. The Open WebUI scaling guide requires PostgreSQL instead of SQLite for multi-instance deployments, because SQLite does not handle concurrent writes from multiple processes well. A single replica can keep SQLite on locally attached SSD or NVMe storage, but that option does not carry over to a Swarm service with several tasks. Plan the PostgreSQL database as a service you back up and restore on its own schedule, and set the connection details in the stack file as secrets rather than plain environment values.

Replicas also need Redis as a shared state store for sessions, websocket connections and application state, along with shared file storage so uploads and knowledge stay reachable from every task. The default ChromaDB will crash in multi-process setups, so the vector store must be an external database such as PGVector, Qdrant or Milvus, which the scaling guide and the features documentation both describe. Confirm which vector database you will run and test a knowledge upload from one replica against a query served by another before you widen the service. Redis has a second, security-relevant role: without it, signing out does not revoke tokens, which stay valid until they expire, by default after 4 weeks. Treat that window as a risk to plan for when users leave or devices are lost.

Replicas do not fix a slow Ollama node. Each Open WebUI task forwards requests to the model server, so adding tasks in front of a saturated Ollama host only queues more work behind the same GPU or CPU. Ollama's concurrency settings set the ceiling: OLLAMA_NUM_PARALLEL controls how many requests a model serves at once (default 1), OLLAMA_MAX_LOADED_MODELS controls how many models stay in memory, and OLLAMA_MAX_QUEUE controls how many requests wait (default 512). Measure latency under a realistic number of concurrent chats on the Ollama node first, then decide whether to add model capacity, change these values or scale Open WebUI.

Limits to confirm in your Swarm and GPU environment

The supplied research does not give Swarm-specific GPU scheduling, node sizing or vector store throughput figures, so none of the numbers below should be assumed. Each card names a limit that shapes the stack, and the checks that tell you whether your own nodes, storage and users fit the plan.

Swarm version and GPU reservation

Confirm that your Swarm version and Docker Engine release let the stack reserve GPUs on the worker nodes that will run Ollama. Check that the NVIDIA container runtime is registered on each GPU node and that a test service sees the device before you deploy the full stack. If a GPU reservation cannot be placed, Ollama may fall back to CPU or stay pending, so test scheduling with a small workload first.

Pinned Open WebUI release and upgrade notes

Pin one Open WebUI image tag in the stack file and read the release notes for every version between your pin and the target before you change it. Releases appear on the project's GitHub page, and the most recent published release is v0.12.3. Test database migrations on a copy of your data, because a rolling update across replicas can expose a change in schema or behavior that a single-node test never shows.

Open WebUI releases

Branding clause above 50 users

The Open WebUI License forbids altering or removing branding in deployments above 50 users in any rolling 30-day period, unless you hold an enterprise license or written contributor permission. Count active users across the whole stack, not per replica, and decide before rollout whether the deployment will cross that threshold. Ask your legal or procurement team to read the license text against your expected user count.

Open WebUI License docs

SQLite storage performance

SQLite is acceptable for a single replica only when the database file sits on locally attached SSD or NVMe storage, not network storage. On a Swarm node, check where the named volume or bind mount actually lives, because a volume backed by a shared network file system breaks this condition. Measure write latency on that disk under expected chat and upload load. For more than one replica, plan PostgreSQL instead.

Vector database behavior under load

The default ChromaDB is not suitable for multi-process setups, so the stack must run ChromaDB in HTTP mode as a separate service before you add workers or replicas. Test ingestion of your largest knowledge base and concurrent retrieval from several users, and watch memory, disk and query latency on the Chroma service. Confirm how the chosen version handles restarts and whether its data volume survives a node move.

Ollama model size against node memory

Model files and the memory they need when loaded determine which Swarm node can host each model, and Ollama settings such as OLLAMA_NUM_PARALLEL and OLLAMA_MAX_LOADED_MODELS change how much memory stays in use at once. Check the size of every model you plan to serve against the memory and GPU VRAM on each node, and confirm that the model store path is on persistent storage. Set placement constraints so a large model never lands on a node that cannot load it.

Ollama FAQ

Questions teams ask before running Open WebUI on Swarm

What drives the effort of running Open WebUI on Docker Swarm?

The effort follows the shape of the stack: how many nodes you have, whether any of them carry GPUs and which models they must serve, which database and vector store you choose, how identity is integrated, and how much storage you need for uploads and knowledge bases. Replica scaling adds the most testing work, because a multi-replica setup needs PostgreSQL instead of SQLite, Redis for shared sessions and state, shared file storage, and an external vector database, since the default ChromaDB will crash in multi-process setups. Each of these choices adds configuration and a test case, so a single-node stack with local storage is far smaller than a multi-node, GPU-backed stack with identity integration and scaled replicas.

Can our own team deploy Open WebUI on Swarm without outside help?

Yes, if your team already runs Docker Swarm in production and has read the Open WebUI scaling guide closely. Most of the work is configuration, secrets handling, volume and network setup, and testing, not custom development. The harder parts are the ones that only show up under load or after a failover: session behavior when a replica is removed, token revocation without Redis, and whether uploads stay reachable from every replica. Teams without that experience usually benefit from a written test plan before they scale beyond one replica, and that plan is the part most often worth buying from a partner.

What do we need to provide before the work starts?

Plan to provide access to the Swarm manager and worker nodes, or a change process that lets the implementer work on them, along with the hardware details of any GPU nodes, including GPU model, driver version, memory and how many devices each node has. You will also need to name the storage you will use for the database, Redis data, files and vector store, and confirm whether those are locally attached or network-backed, since that changes what SQLite can safely do. Identity details are needed if you plan to use OIDC, LDAP or SCIM, and a test plan should list the user counts, concurrency and failure cases you expect to verify before go-live.

What recurring work should we expect after the stack is live?

Expect recurring work in four areas: Open WebUI upgrades, model updates in Ollama, backups of the database and file storage, and monitoring of nodes, services and queues. Each Open WebUI release needs a check against your pinned image tag and your scaling configuration before you roll it forward. Models change over time, so you will need a process for pulling, testing and removing them. Backups should cover PostgreSQL, the Open WebUI data directory and any vector store, and you should test restores on a schedule. Ask any implementer to define who owns each of these tasks after handover and what the upgrade procedure looks like.

Does the Open WebUI License affect a Swarm deployment?

It can. Since v0.6.6, Open WebUI code is distributed under the Open WebUI License, which includes a branding protection clause. The license forbids altering or removing Open WebUI branding in deployments that exceed 50 users in any rolling 30-day period, unless the operator holds an enterprise license or written contributor permission. Code through v0.6.5 remains BSD-3-Clause. Before you scale, count your active users against that threshold, decide whether you will keep the branding, and check the current terms with the project or your legal team, because the license controls what you can change in the interface.

Which parts of the cost are one-time and which recur?

One-time costs include the design of the stack, the initial build, the GPU node setup, the identity integration and the first round of testing, including replica failover checks. Recurring costs include the infrastructure itself, the GPU capacity you keep running, storage growth, upgrades, model maintenance, backups and monitoring. If you choose an Enterprise License for branding or dedicated support, that is a separate commercial decision and its price is quoted by the project after you contact enterprise sales with an expected seat count. When you ask for a quote from any partner, ask for the one-time build and the recurring operations separately, with the testing scope named.

Should we add replicas before we have tested the single-node stack?

No. Get the single-node stack working with pinned image tags, persistent volumes, a stable secret key and a tested backup before you add replicas. Scaling multiplies every shared-state dependency at once, so a stack that is unstable on one node will be harder to debug on three. Once single-node behavior is verified, move the database to PostgreSQL, add Redis, move files to shared storage, replace the default vector store, and then retest sign-in, sign-out, streaming responses and uploads on every replica before you increase the count.

How DeployOpen scopes and delivers an Open WebUI Swarm stack

DeployOpen plans, builds, documents and supports self-hosted open-source platforms inside the client's own infrastructure, and Open WebUI on Docker Swarm follows the same method. Engagements are fixed-scope, so the stack, the GPU decision, the replica plan and the handover items are agreed in writing before any work starts.

How we scope

  • Confirm which Swarm manager and worker nodes exist, their operating system and whether any node has a supported GPU.
  • Record whether Ollama runs on CPU or GPU, which models are needed and where model files will be stored.
  • Agree the replica count, and whether PostgreSQL, Redis and shared file storage are in scope before any scaling work begins.

How we build

  • Write the stack file with pinned image tags, secrets managed through Swarm secrets, and separate GPU and CPU variants where needed.
  • Connect Open WebUI to ChromaDB in HTTP mode and to Ollama, then test model listing, chat streaming and document upload end to end.
  • Test failover of a single node, restart behavior and persistence of volumes before the stack is accepted as ready.

How we hand over

  • Deliver the stack file, environment reference, network diagram and a list of published ports and internal service addresses.
  • Document the upgrade procedure for Open WebUI, ChromaDB and Ollama, including the release notes each change depends on.
  • Walk your operations team through backups of volumes, log locations and the checks needed before adding a second replica.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after the handover, with the scope agreed in writing.
  • Review each new Open WebUI and Ollama release against the stack before your team applies it to production.
  • Ask us to confirm the scaling prerequisites, such as PostgreSQL, Redis and shared storage, before any replica count is raised.

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.