Open WebUI is up, the page loads, and then nothing works: no models in the list, a red “Network Problem” toast, chats that end in an error, or a strange Unexpected token '<' message.
Almost every one of these comes down to one of a handful of networking mistakes, and each has a quick test that tells you which one you are looking at.
The most common cause by far is localhost. Inside a Docker container, localhost means the container itself, not your PC, so a URL that works in your browser can fail from Open WebUI.
The second most common cause is Ollama listening only on 127.0.0.1. After those two, it is usually a URL typed in the wrong format or a reverse proxy that breaks WebSockets.
This guide walks through every connection error in the order you are most likely to hit them, with the exact command to confirm each one and the fix. It follows the official Open WebUI troubleshooting documentation as of December 2026.
- Docker + Ollama on the host: use
http://host.docker.internal:11434, notlocalhost. On Linux add--add-host=host.docker.internal:host-gateway. - Test it:
docker exec open-webui curl -s http://host.docker.internal:11434/api/version - Ollama on another machine: set
OLLAMA_HOST=0.0.0.0and restart Ollama. - “Network Problem”: Ollama URL is
http://host:11434with nothing after the port. OpenAI-style URLs end in/v1. Unexpected token '<': a proxy or subpath returned HTML. Serve Open WebUI at the root of its own hostname.- Behind HTTPS: set
WEBUI_URL,CORS_ALLOW_ORIGINand pass WebSocket upgrade headers.
Quick Diagnosis Table
Find your symptom, then jump to the section.
| Symptom | Most likely cause | Section |
|---|---|---|
No Ollama models, logs show Connection error |
localhost inside Docker, or Ollama bound to 127.0.0.1 |
localhost trap |
Ollama: Network Problem or OpenAI: Network Problem |
URL format wrong | Network Problem |
Model list differs from ollama list |
Two Ollama installs or a different volume | Models missing |
| Verify passes, chat errors | Model fails to load in Ollama | Chat fails |
Unexpected token '<', "<!DOCTYPE " |
Proxy or subpath returning HTML | DOCTYPE error |
| “Open WebUI backend required” | Port mapping, tunnel or stale cache | Backend required |
Empty {} replies, garbled markdown, WebSocket errors |
Reverse proxy, CORS or buffering | HTTPS and WebSocket |
| Model picker spins for ages | An unreachable endpoint in Connections | Slow model list |
The localhost Trap in Docker
Open WebUI talks to Ollama, OpenAI-compatible APIs, tool servers and terminals from its backend, not from your browser. That changes what localhost means.
| Where the request starts | What localhost means |
|---|---|
| Open WebUI backend (in Docker) | The Open WebUI container itself |
| Open WebUI backend (pip install) | The machine running Open WebUI |
| Your browser | Your own PC |
So if Ollama runs on your PC and Open WebUI runs in Docker, http://localhost:11434 points at an empty port inside the container. Use an address the container can actually reach:
http://host.docker.internal:11434to reach the host machine.- A Docker service name such as
http://ollama:11434when both run in the same Compose file. - A LAN IP such as
http://192.168.1.50:11434for another machine.
Test from inside the container before changing anything else:
docker exec open-webui curl --fail --show-error --silent --max-time 5 http://host.docker.internal:11434/api/version
A version JSON means the container can reach Ollama. If the hostname does not resolve on Linux Docker Engine, recreate the container with --add-host=host.docker.internal:host-gateway, or add an extra_hosts entry in Compose:
services:
open-webui:
image: ghcr.io/open-webui/open-webui:main
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- OLLAMA_BASE_URL=http://host.docker.internal:11434
For a full Ollama plus Open WebUI setup with Compose, see our Open WebUI with Ollama setup guide and Ollama in Docker guide.
Option: host networking
You can also start Open WebUI with --network=host so it shares the host’s network and 127.0.0.1 works:
docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main
Three catches:
- Docker ignores
-pin host mode, so Open WebUI is athttp://localhost:8080. Add-e PORT=3000to move it. - On Docker Desktop, host networking needs version 4.34 or newer and Settings > Resources > Network > Enable host networking. Without it your browser cannot connect at all.
- Other machines reach Open WebUI on that host port directly, so check your firewall.
Fix Ollama Connection Errors
Ollama listens on 127.0.0.1:11434 by default. That is fine when Open WebUI runs as a pip install on the same machine, or uses host.docker.internal on Docker Desktop. It fails when Open WebUI runs on another machine, or in some Linux Docker setups.
- Check what Ollama listens on. On Linux run
ss -tlnp | grep 11434. On Windows runnetstat -an | findstr 11434. - Read the result.
127.0.0.1:11434means loopback only.0.0.0.0:11434,*:11434or[::]:11434means all interfaces. - Set
OLLAMA_HOST=0.0.0.0using the method for your system below. - Restart Ollama and run the check again.
- Re-test from Open WebUI with Admin Panel > Settings > Connections > Verify Connection.
| System | How to set OLLAMA_HOST |
|---|---|
| Linux (systemd) | systemctl edit ollama.service, add Environment="OLLAMA_HOST=0.0.0.0:11434" under [Service], then systemctl daemon-reload and systemctl restart ollama |
| Windows | Quit Ollama from the taskbar, add OLLAMA_HOST to your user environment variables, start Ollama again |
| macOS app | launchctl setenv OLLAMA_HOST "0.0.0.0:11434", then restart the app |
A missing [Service] line, a skipped daemon-reload or a skipped restart are the usual reasons the address stays at 127.0.0.1. Our Ollama environment variables guide covers every variable, and the Ollama remote access guide covers LAN and secure remote setups.
Security note: Ollama’s local API has no authentication. With OLLAMA_HOST=0.0.0.0, any device that can reach port 11434 can use your models. Your users’ browsers never need that port, because Open WebUI calls Ollama from its backend. Block 11434 at the firewall for everything except the Open WebUI host.
Fix “Network Problem” on Verify Connection
Verify Connection shows Ollama: Network Problem or OpenAI: Network Problem and no models appear. Open WebUI does not check the URL format. It removes one trailing slash and adds a fixed path: /api/version for Ollama and /models for OpenAI-compatible connections. One extra path segment breaks it.
| You entered | What gets requested | Enter instead |
|---|---|---|
192.168.1.5:11434 |
Nothing, no http:// |
http://192.168.1.5:11434 |
http://192.168.1.5 |
Port 80 | http://192.168.1.5:11434 |
http://localhost:11434/api |
/api/api/version |
http://localhost:11434 |
https://api.openai.com/v1/chat/completions |
.../chat/completions/models |
https://api.openai.com/v1 |
https://api.openai.com |
https://api.openai.com/models |
https://api.openai.com/v1 |
The rule: an Ollama URL is http://host:port with nothing after the port. An OpenAI-compatible URL is the base that comes before /models and /chat/completions, which for most providers ends in /v1. The same rule applies to llama.cpp, LM Studio and vLLM servers.
If the format is right and it still fails, the network is the problem: go back to the localhost trap and run the docker exec ... curl test with your URL.
Models Missing or Different From ollama list
Open WebUI lists only the models returned by the Ollama URLs in Admin Panel > Settings > Connections. When the list differs from ollama list in your terminal, you are usually looking at two different Ollama servers or two different model stores:
- Two Ollama installs. A native install plus an Ollama container, or one in WSL and one on Windows. Each has its own models. Run
ollama listinside the one the URL points to, for exampledocker exec ollama ollama list. - A renamed or missing Docker volume. Models live in the volume at
/root/.ollama. Compose prefixes volume names with the project name, somyproject_ollamaandollamaare different volumes. - The bundled
:ollamaimage without-v ollama:/root/.ollama. Models vanish when the container is recreated.
Check the mount with:
docker inspect --type container --format '{{json .Mounts}}' ollama
Find the entry whose Destination is /root/.ollama and compare its Name with your old setup. To spot a stale second server, open Settings > About: Ollama Version shows the lowest version across all enabled Ollama connections. If you moved models to another disk, see how to move Ollama models to another drive.
Verify Works but Chat Fails
Verify Connection says Server connection verified, models appear, but every chat ends in an error. Neither check actually runs a model: verify only calls /api/version and the model list comes from /api/tags. Only the chat call asks Ollama to load the model.
- Run the model directly on the Ollama machine:
ollama run <model>, ordocker exec -it ollama ollama run <model>. If it fails there too, the problem is Ollama, not the connection. - Read Ollama’s log.
journalctl -u ollamaon Linux with systemd,docker logs <container>for Docker. Our Ollama logs guide lists every location. - Memory errors mean the model does not fit. Try a smaller variant or a shorter context length, and check
ollama psfor GPU or CPU placement.
does not support tools
If every chat fails with registry.ollama.ai/library/<model> does not support tools, Open WebUI is sending its built-in tools and the model cannot accept them.
Fix it one of three ways: set Function Calling to Legacy in the model’s Advanced Params, turn off the model’s Builtin Tools capability, or use a model that supports tool calling.
Fix Unexpected token ‘<‘ and “Backend Required”
Unexpected token '<', "<!DOCTYPE "... is not valid JSON
The browser asked an API path for JSON and got an HTML page. This error never comes from the model. Two things cause it:
- Open WebUI under a subpath. Open WebUI answers unknown paths with its own web page and status 200. A proxy that adds or strips a prefix such as
/chatsends API calls to paths that do not exist. Serving Open WebUI under a subpath is not supported. - Something in front of Open WebUI answered, such as a sign-in gateway or a proxy error page for a request that was too large or too slow.
Open DevTools > Network, click the failing request and read the response. A page titled Open WebUI means cause 1. Anything else names the proxy that answered. The fix is to serve Open WebUI from the root of its own hostname, such as chat.example.com, and route every path to it unchanged.
“Open WebUI backend required”
On load, the page fetches /api/config. If that fails, you get this message. It does not mean you have a frontend-only build. Check these:
- Port mapping. Each container must map to container port 8080, for example
3001:8080. Test withcurl http://localhost:3001/api/config. JSON back means the backend is reachable. - SSH tunnels must forward to the host port that instance actually publishes, which is easy to mix up with several instances.
- Stale cache. A hard refresh is not enough. Clear site data in DevTools under Application, including any service worker another app left on the same origin.
Reverse Proxy, HTTPS and WebSocket Errors
Empty {} replies, Unexpected token 'd', "data: {"id"..., login loops, CORS errors and WebSocket failures in the console usually mean the reverse proxy setup is incomplete. Set these environment variables:
WEBUI_URL=https://chat.example.com
CORS_ALLOW_ORIGIN="https://chat.example.com;http://localhost:3000"
WEBUI_SESSION_COOKIE_SECURE=true
WEBUI_AUTH_COOKIE_SECURE=true
WEBUI_SESSION_COOKIE_SAME_SITE=lax
WEBUI_AUTH_COOKIE_SAME_SITE=lax
List every way users reach the instance in CORS_ALLOW_ORIGIN, separated by semicolons. A log line like https://yourdomain.com is not an accepted origin tells you which one is missing. WEBUI_URL is a persistent setting, so after the first start change it in Settings > General in the admin panel.
In the proxy itself:
- Pass WebSocket upgrades:
UpgradeandConnectionheaders, andproxy_http_version 1.1;in nginx. - Turn off response buffering for streaming (
proxy_buffering off;in nginx). Buffering causes garbled markdown with visible##and**. - Raise the body size limit. nginx defaults
client_max_body_sizeto1m. A 413 onPOST /api/v1/chats/<id>is why edits and ratings vanish after reload in long chats. - On HAProxy 3.x with HTTP/2, add
option h2-workaround-bogus-websocket-clientsor force HTTP/1.1 to the backend.
Works in one browser but not another? Open WebUI uses a WebSocket at /ws/socket.io with no long-polling fallback. Privacy shields, ad blockers and strict tracking protection can block it. Try a private window or another browser first.
If it works there, allowlist your Open WebUI address and clear its site data. If it fails everywhere, fix the proxy. Running several replicas also needs WEBSOCKET_MANAGER=redis.
Slow Model List and Locked-Out Settings
If the model picker spins, or there is a pause before each send, one of your saved connection URLs is unreachable. Open WebUI queries every enabled endpoint and waits up to 10 seconds for the slowest one.
- Remove or fix dead URLs in Admin Panel > Settings > Connections, or toggle them off.
- Shorten the wait with
AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST=3. - Locked out of Settings? Start once with
RESET_CONFIG_ON_START=trueso the environment variables replace the saved config, then remove the variable. Or setENABLE_PERSISTENT_CONFIG=falseto always use environment variables, knowing UI changes will not survive restarts.
Back up first with our Open WebUI backup guide before touching the database directly.
Other Connection Gotchas
“Model not found” that comes and goes
If a working model randomly reports “Model not found” and logs show ClientConnectorDNSError, name lookups are failing intermittently. This is linked to the optional c-ares resolver. Make sure AIOHTTP_CLIENT_ASYNC_DNS_RESOLVER is not set to true, so lookups go through the operating system.
Two connections with the same model ID
When two OpenAI-compatible connections expose the same model ID, Open WebUI keeps only the first. Set a different Prefix ID under each connection’s Advanced settings, for example local and hosted.
Blank replies when the model uses a tool
Some OpenAI-compatible providers omit the index field on streamed tool calls, so Open WebUI drops the call and the reply comes back empty. Google’s OpenAI compatibility endpoint is the known case.
Fix it by putting a gateway such as LiteLLM or OpenRouter in front, switching that model’s Function Calling to Legacy, turning off its Builtin Tools, or using a pipe function that calls the provider’s native API.
Slow UI or timeouts on low-spec hardware
On a Raspberry Pi or a small container, slow pages and API timeouts can come from database session sharing if you switched it on. Set DATABASE_ENABLE_SESSION_SHARING=false, which is the default.
If the slowness is in model replies rather than the UI, the bottleneck is Ollama itself. Our Ollama slow fix guide and Ollama not using GPU fix help here.
FAQ
Why can’t Open WebUI connect to Ollama in Docker?
Because localhost inside the container is the container. Use http://host.docker.internal:11434 and, on Linux, add --add-host=host.docker.internal:host-gateway.
What is the correct Ollama URL in Open WebUI?
http://host:11434 with nothing after the port. Do not add /api.
What URL do I use for an OpenAI-compatible server?
The base URL before /models, usually ending in /v1, such as http://localhost:8080/v1 for llama.cpp.
Do users’ browsers need access to port 11434?
No. Open WebUI calls Ollama from its backend. Keep port 11434 closed to everything except the Open WebUI host.
Why do I get Unexpected token ‘<‘ in Open WebUI?
An API call got an HTML page back, usually from a subpath setup or a proxy error page. Serve Open WebUI at the root of its own hostname.
How do I find the exact error?
Run docker logs open-webui and look for Connection error: lines, and check the browser’s DevTools Network tab for the failing request.
Can I run Open WebUI under example.com/chat?
No, subpaths are not supported. Use a subdomain such as chat.example.com.




