refusal rate
Subscribe

Open WebUI Ollama setup that works: the Docker one-liners, the right OLLAMA_BASE_URL per OS, fixes for the network problem error, and locking down auth.

[ fig. 01 — how-to ]48×5
[ fig. 01 — how-to ]16×5

Short answer

To set up Open WebUI with Ollama, run Ollama on the host, then start the Open WebUI Docker image with port 3000 mapped to 8080 and host.docker.internal pointing at the host gateway. Open http://localhost:3000 and create the first account, which becomes admin. Almost every failure is networking: inside the container, localhost is the container, and on Linux Ollama must listen on 0.0.0.0.

Latest Open WebUI checked
v0.12.5, Oct 29, 2026
Latest Ollama checked
v0.40.13, Oct 28, 2026
Default ports
UI 3000→8080, Ollama 11434
Python for pip install
3.11 or 3.12 (not 3.13)

Key takeaways

  1. The Open WebUI backend makes the call to Ollama, not your browser, so the Ollama URL has to be reachable from inside the container.
  2. On Linux, host.docker.internal needs --add-host=host.docker.internal:host-gateway, and Ollama must bind 0.0.0.0 instead of its default 127.0.0.1.
  3. A URL saved in Admin Settings > Connections overrides OLLAMA_BASE_URL on later restarts, which explains many 'I changed the env var and nothing happened' reports.
  4. The first account is admin, sign-up then turns off, and new users default to pending. WEBUI_AUTH=False is single-user only and can't be switched back later.
  5. Open WebUI also takes OpenAI-compatible backends such as llama-server, so one UI can front Ollama and llama.cpp at once.

What is Open WebUI and do you need it?

Open WebUI is a self-hosted, ChatGPT-style web interface that talks to Ollama’s API and to any OpenAI-compatible API; an Open WebUI Ollama setup is worth it if you want a browser UI, multiple users, document chat or saved history on top of a local model. Ollama on its own gives you a CLI, a desktop app and an HTTP API on port 11434. Open WebUI adds the parts a team or a long-running workstation wants: accounts and roles, a model picker across several backends, knowledge bases for retrieval, and admin controls. The repository sits at about 157,000 GitHub stars, and the latest release as of this writing is v0.12.5 (October 29, 2026) (releases).

The open webui ollama pairing is popular because it’s quick. One Hacker News user said it “only took me ~20 minutes” to get both running, while admitting they didn’t fully understand what was happening underneath (HN, Nov 2024). That gap, working without understanding the network path, is exactly where the support threads come from. So this guide spends most of its time on the network path.

If you only want to chat with one model on one machine, Ollama’s own app or LM Studio may be enough. Open WebUI earns its keep once there’s a second user, a second backend, or a folder of docs to query.

How do you install Open WebUI with Ollama?

Run Ollama natively on the host and Open WebUI in Docker; that is the default the README documents and the one with the fewest moving parts. Pull a model first so there’s something to pick:

bash
ollama pull qwen3

Then pick the command that matches where Ollama lives.

Ollama on the same machine (the README’s default):

bash
docker run -d -p 3000:8080 \
  --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data \
  --name open-webui --restart always \
  ghcr.io/open-webui/open-webui:main

Ollama on a different server: the same command, plus -e OLLAMA_BASE_URL=http://<server-ip>:11434.

Ollama bundled in the same container (one image, two volumes):

bash
docker run -d -p 3000:8080 --gpus=all \
  -v ollama:/root/.ollama \
  -v open-webui:/app/backend/data \
  --name open-webui --restart always \
  ghcr.io/open-webui/open-webui:ollama

Drop --gpus=all for CPU only. GPU passthrough itself (the NVIDIA container toolkit, the :cuda tag) belongs to running Ollama in Docker, so it isn’t repeated here.

Without Docker: pip install open-webui, then open-webui serve, and the UI is on http://localhost:8080. The quick start says Python 3.11 and 3.12 are supported and 3.13 is not yet. It also documents a uv one-liner, Docker Compose, a Helm chart and a desktop app.

Image tags worth knowing, from the same page:

TagWhat it isWhen to use it
:mainStandard build, bundles speech-to-text and embedding models (about 1.62 GB)Default
:slimAbout 197 MB, no bundled ML stack; RAG and voice need external servicesSmall servers that use Ollama for embeddings
:cudaNVIDIA buildOpen WebUI’s own embedding and speech on GPU
:ollamaOpen WebUI plus Ollama in one containerOne-box installs
:vX.Y.ZPinned releaseAnything you don’t want changing under you

Open http://localhost:3000 and create the first account. Keep the open-webui volume and the same WEBUI_SECRET_KEY across updates; the docs say a changed key logs everyone out.

Why can’t Open WebUI connect to Ollama?

Because the Ollama connection is made by Open WebUI’s backend inside the container, and from there localhost means the container, not your machine. The troubleshooting page puts it plainly: use an address the backend can reach, such as a Compose service name, host.docker.internal or an internal IP. The tell-tale log line is Connect call failed ('127.0.0.1', ...), and in the UI it shows up as “Ollama: Network Problem” when you verify the connection.

[ fig. 01 — Which Ollama URL works from inside the Open WebUI container. After the Open WebUI troubleshooting docs and the Ollama FAQ ]
Open WebUI's backend, not the browser, calls Ollama. From inside the container, localhost loops back to the container, host.docker.internal goes through the Docker bridge gateway and reaches Ollama on Linux only if Ollama listens on 0.0.0.0 and the firewall allows port 11434, and host networking reaches 127.0.0.1:11434 directly.

Three facts explain most cases:

  • Ollama binds 127.0.0.1:11434 by default (Ollama FAQ), so it ignores anything arriving on the Docker bridge.
  • On Docker Desktop (macOS, Windows) host.docker.internal resolves out of the box. On Linux it doesn’t exist until you add --add-host=host.docker.internal:host-gateway.
  • The open webui ollama api base url is set once by OLLAMA_BASE_URL, then stored in the database. A URL saved later in Admin Settings > Connections wins over the env var on every restart (env docs).
SymptomLikely causeFix
Connect call failed ('127.0.0.1', 11434)Base URL is localhost inside the containerUse http://host.docker.internal:11434
Name or service not known for host.docker.internalLinux without the host-gateway mappingAdd --add-host=host.docker.internal:host-gateway
Name resolves, connection refused or times outOllama bound to 127.0.0.1, or a host firewallSet OLLAMA_HOST=0.0.0.0:11434, allow 11434 from the Docker subnet
Still failing, you want it fixed nowBridge networking in the way--network=host with OLLAMA_BASE_URL=http://127.0.0.1:11434; UI moves to port 8080
Env var change ignoredSaved URL in the database overrides itEdit it in Admin Settings > Connections, or start once with RESET_CONFIG_ON_START=true
Model list takes ~10 s to loadA dead URL in the connection listRemove it; set AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST=3
Podman on macOSDifferent host aliashttp://host.containers.internal:11434

To bind Ollama to all interfaces, set the variable where the service actually reads it, per the Ollama FAQ: launchctl setenv OLLAMA_HOST "0.0.0.0:11434" for the macOS app, a systemctl edit ollama.service override with Environment="OLLAMA_HOST=0.0.0.0:11434" on Linux, and your user environment variables on Windows. An export in your shell does nothing to a systemd service. Then test from inside the container: docker exec open-webui curl -s http://host.docker.internal:11434 should print “Ollama is running”.

Remember the cost: 0.0.0.0 exposes Ollama’s unauthenticated API to every network the host is on. Firewall 11434 to the Docker subnet or your LAN; is Ollama safe covers that exposure in detail.

Windows. The simplest path is the native Ollama installer plus Docker Desktop, where host.docker.internal works without the extra flag. If you instead run Open WebUI with pip inside WSL2, note that WSL’s default NAT mode can’t reach Windows services on localhost; Microsoft’s docs say mirrored mode (networkingMode=mirrored in .wslconfig, Windows 11 22H2+) allows connecting to Windows servers via 127.0.0.1 (Microsoft Learn).

How do you secure it for more than one user?

Create the admin account first, keep sign-up off, and approve new users by hand; those are mostly the defaults. Per the quick start, the first account created becomes the administrator and sign-up turns itself off once the admin exists. You can re-enable it under Admin Settings > Authentication. The env reference adds the switches for open webui ollama authentication:

  • DEFAULT_USER_ROLE defaults to pending, so self-registered users can’t chat until an admin activates them. The other options are user and admin.
  • ENABLE_SIGNUP controls account creation. Setting WEBUI_ADMIN_EMAIL and WEBUI_ADMIN_PASSWORD provisions the admin headlessly and closes sign-up after it.
  • WEBUI_SECRET_KEY signs sessions. Set it explicitly and keep it stable.
  • WEBUI_AUTH=False removes login entirely for a single-user box. The docs say switching between single-user and multi-account mode afterward isn’t supported, so decide up front.

Two more points from the docs. Tools and Functions execute arbitrary Python on the server, so restrict Workspace access to trusted admins. And deleting a model in the Ollama connection dialog removes it from the Ollama server for every user of that connection. If you put Open WebUI on the internet, put TLS in front, and never publish Ollama’s port 11434 alongside it.

Which features are useful for coding work?

Multiple backends, knowledge bases and model presets matter most for development; the chat UI itself is secondary.

  1. OpenAI-compatible connections. Under Admin Settings > Connections > OpenAI you can add any /v1 endpoint. The llama.cpp guide uses http://host.docker.internal:10000/v1 with a blank key and says to set the provider to llama.cpp so model unloading works. That lets one UI front Ollama and a tuned llama.cpp server at once. Ollama itself also speaks this protocol, covered in the Ollama OpenAI-compatible API guide.
  2. Several Ollama instances. Add more than one base URL and Open WebUI spreads requests at random across instances whose model IDs match; a prefix such as remote/ keeps same-named models apart (Ollama connection docs).
  3. Knowledge and RAG. Upload docs in the Workspace, then reference them in chat with #. The embedding model can be served by Ollama, and changing it forces a re-index of every knowledge base (RAG docs).
  4. Context length. The connection docs warn that toggling num_ctx in Open WebUI pre-fills 2048, which overrides OLLAMA_CONTEXT_LENGTH and can truncate prompts or produce raw tool-call JSON. Set a real value or leave it unset; this bites hardest when pasting code.
  5. Model presets. “Create a model” wraps an existing one with a system prompt and parameters, which is handy for a code-review persona.

What do developers report in practice?

The common thread in community reports: setup is easy, networking and firewalls cause the stalls, and the UI doesn’t make a small model better at code.

  • The firewall, not Ollama. A developer on Ubuntu running llama3.1:8b got “network problem” with both --add-host and --network=host. Ollama was already on 0.0.0.0; UFW was blocking container-to-host traffic, and allowing 11434/tcp fixed it (GitHub community discussion, Jun 2026).
  • Bundled image limits. On a DGX Spark with the NVIDIA playbook’s bundled Open WebUI and Ollama container, a user found local GGUF files stopped answering after the first reply, and port 11434 wasn’t visible to other apps. They moved the GGUF to llama.cpp as a separate connection and added --network=host (NVIDIA forum, Jan 2026).
  • One backend, many front ends. A Hacker News commenter called connecting Ollama to both OpenCode and Open WebUI “relatively trivial” (HN, Apr 2026).
  • Set coding expectations. Another commenter recommends the Docker one-liner but warns “don’t expect much for coding” from what fits on consumer hardware, while finding it good for general questions (HN, Jul 2026).
  • The license. Since v0.6.6 (April 2025) the project uses a custom license that requires keeping the “Open WebUI” branding for deployments over 50 users in 30 days, and the project itself says it isn’t OSI-approved (license page). Commenters called a second license change in one year “a red flag” for anyone relying on the software (HN, May 2025).

What are the alternatives?

If the license, the weight of the image or the feature sprawl puts you off, these are the main open webui ollama alternatives:

ToolLicenseWorks with OllamaBest for
LibreChatMITYes, plus custom OpenAI-compatible endpointsMulti-user teams needing OAuth2, LDAP or email login
AnythingLLMMITYes, for chat and embeddingsDocument-heavy RAG; multi-user only in the Docker version
LM StudioProprietary appNo, it’s its own runtimeA single developer on a desktop
llama-server web UIMIT (llama.cpp)No, it serves GGUF directlyMinimal, no extra service

FAQ

Do I need Docker to run Open WebUI with Ollama?

No. pip install open-webui and open-webui serve work on Python 3.11 or 3.12, and the UI runs on port 8080. Docker is the documented default because updates and the data volume are simpler.

What should OLLAMA_BASE_URL be?

http://host.docker.internal:11434 when Open WebUI runs in Docker and Ollama on the host; http://127.0.0.1:11434 with --network=host or a pip install; http://ollama:11434 when both run as Compose services; the server’s IP for remote Ollama.

Why does Open WebUI say “Ollama: Network Problem”?

The backend can’t reach the base URL. Check, in order: the URL isn’t localhost inside a container, Linux has the host-gateway mapping, Ollama listens on 0.0.0.0, the firewall allows 11434, and no stale URL is saved in Admin Settings > Connections.

Can Open WebUI connect to Ollama on another computer?

Yes. Set OLLAMA_HOST=0.0.0.0:11434 on the Ollama machine, open port 11434 to the Open WebUI host only, and point OLLAMA_BASE_URL (or a new connection) at that machine’s IP.

Is Open WebUI free to use?

Yes, free to self-host. Its license requires keeping the Open WebUI branding unless your deployment has 50 or fewer users in a 30-day window or you hold an enterprise license.

Sources (10)
  1. Open WebUI README, GitHub (installation and troubleshooting sections)
  2. Quick Start, Open WebUI documentation
  3. Connection errors, Open WebUI troubleshooting documentation
  4. Starting with Ollama, Open WebUI documentation
  5. Environment variable configuration, Open WebUI documentation
  6. Starting with llama.cpp, Open WebUI documentation
  7. Retrieval Augmented Generation (RAG), Open WebUI documentation
  8. Open WebUI License, Open WebUI documentation
  9. Ollama FAQ: how to configure the Ollama server and expose it on the network
  10. Accessing network applications with WSL, Microsoft Learn

Keep reading