# Open WebUI Can’t Reach Ollama? Fix the Connection in a Few Steps

> Markdown version of an Informer Tech article. Canonical HTML page: https://www.informertech.com/post/open-webui-not-connecting-to-ollama
> Source: Informer Tech, https://www.informertech.com/

- **Canonical URL:** https://www.informertech.com/post/open-webui-not-connecting-to-ollama
- **Publisher:** Informer Tech (https://www.informertech.com/)
- **Category:** Troubleshooting
- **Author:** Alex Carter
- **Published:** 2026-08-05
- **Description:** Open WebUI can't see Ollama? Fix it with OLLAMA_HOST, the right OLLAMA_BASE_URL for Docker, and the saved URL that quietly overrides your env vars.

---

The page loads fine. The model dropdown sits empty, or you get a server connection error. Ollama is running, you can prove it, and Open WebUI still behaves as though it does not exist.

Nearly every case comes down to one thing: the Open WebUI backend is looking for Ollama at an address it cannot reach. That is a configuration problem, not a bug. Work down the list below and stop when your models appear.

## First, Confirm Ollama Is Actually Running

On the machine running Ollama, run this:

<pre class="ql-syntax" spellcheck="false">curl http://localhost:11434
</pre>
A healthy server replies that Ollama is running. If you get connection refused, the problem is Ollama itself. Start the service and test again before you change anything in Open WebUI.

If curl works but Open WebUI still cannot see it, the address is wrong. Keep going.

## Why Open WebUI Cannot Find Ollama

Two causes account for almost all of these failures.

The first is that Ollama binds to <code>127.0.0.1</code> by default. That address accepts connections from the same machine only, and a Docker container does not count as the same machine even when it runs on that hardware.

The second is subtler. Open WebUI resolves the Ollama URL from its backend, not from your browser. Inside a container, <code>localhost</code> means the container. So <code>http://localhost:11434</code> can work perfectly when you paste it into a browser tab and still fail when Open WebUI uses it. If your logs show something like <code>Connect call failed ('127.0.0.1', 11434)</code>, this is what you are looking at.

## Fix 1: Make Ollama Listen on All Interfaces

Set <code>OLLAMA_HOST=0.0.0.0</code>, then restart Ollama. The restart matters. Ollama reads the variable at startup, so nothing changes until the process comes back up.

Where you set it depends on your platform:

- **Linux with systemd:** run <code>sudo systemctl edit ollama.service</code> and add <code>Environment="OLLAMA_HOST=0.0.0.0"</code> under <code>[Service]</code>. Then run <code>sudo systemctl daemon-reload && sudo systemctl restart ollama</code>. A variable exported in your shell will not survive a service restart.
- **macOS and Windows:** set it in the environment the Ollama application inherits, then quit and relaunch the app.
- **Ollama in Docker:** pass it with <code>-e OLLAMA_HOST=0.0.0.0</code>.

One caution. Binding to <code>0.0.0.0</code> exposes port 11434 to your whole network. On a home network behind a router that is usually fine. On a VPS or anything with a public IP, firewall the port. Ollama ships no authentication of its own.

## Fix 2: Point Open WebUI at an Address It Can Reach

The setting is <code>OLLAMA_BASE_URL</code>, and the right value depends on where each piece runs.

- **Docker Desktop on macOS or Windows, Ollama on the host:** use <code>http://host.docker.internal:11434</code> and add <code>--add-host=host.docker.internal:host-gateway</code> to your run command.
- **Linux, Ollama on the host:** host networking is the simplest fix, since it removes the isolation entirely. Watch the port change: with <code>--network=host</code>, Open WebUI serves on 8080 rather than 3000.
- **Docker Compose with both services in one stack:** use the service name, <code>http://ollama:11434</code>. Compose puts containers on a shared network where names resolve.
- **Podman on macOS:** use <code>http://host.containers.internal:11434</code>.

The Linux command from the official documentation:

<pre class="ql-syntax" spellcheck="false">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
</pre>
Open it at <code>http://localhost:8080</code>.

If you would rather avoid the networking question altogether, the bundled <code>open-webui:ollama</code> image runs both in a single container.

## The Setting Will Not Save, or Keeps Reverting

You correct the URL in your environment, restart, and the old broken one is still sitting there.

Any URL saved through the UI is stored in the database, and that stored value takes precedence over your environment variables. Three ways out, in order of bluntness:

- Fix it directly in Admin Settings, under Connections.
- Set <code>RESET_CONFIG_ON_START=true</code> so environment values override the database on the next boot.
- Set <code>ENABLE_PERSISTENT_CONFIG=false</code> to keep environment variables authoritative for good. The tradeoff is that changes made in the UI stop surviving restarts.

## It Connects, But the Model List Spins Forever

Different symptom, different fix. Open WebUI queries every endpoint you have configured and waits on each one. The default wait is 10 seconds per unreachable endpoint, and a few dead endpoints stack into a settings page that feels broken.

Delete stale Ollama and OpenAI URLs under Connections. If you need to keep an endpoint that goes down sometimes, lower <code>AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST</code> so it fails fast instead of hanging.

## If It Still Will Not Connect

Read the Open WebUI backend logs before guessing again. They name the address that failed, which usually ends the investigation in one line.

Then check the firewall on the machine running Ollama for port 11434. Windows blocks it more often than people expect.

If Open WebUI sits behind a reverse proxy or HTTPS, you may have a CORS or WebSocket problem dressed up as a connection error. That is a separate fix, and the [Open WebUI connection troubleshooting docs](https://docs.openwebui.com/troubleshooting/connection-error) cover it in detail.
