Open WebUI Can't Connect to Ollama: Fixes

A small navy laptop and a navy server cube on a calm desk, joined by a cable with a gap in the middle that a soft amber spark bridges

By Annie Vane · Fixes · Docs-only · Checked November 30, 2026

Short answer: Open WebUI usually can't connect to Ollama because the URL points to the wrong place (inside Docker, localhost is the container, not your computer), Ollama only listens on 127.0.0.1, or a firewall blocks port 11434. Fix the URL first, then the listener, then the firewall.

Each fix below comes from the Open WebUI connection errors guide and the Ollama FAQ. Work through them in order.

Does Open WebUI work with Ollama?

Yes. Open WebUI speaks the Ollama API, which normally runs on port 11434, and tries to connect to your Ollama server automatically once it starts. When that fails, the Open WebUI docs say the most common cause is a network misconfiguration, not a bug.

A small navy laptop and a navy server cube on a calm desk, joined by a cable with a gap in the middle that a soft amber spark bridges
Illustration: Local AI Scout

One detail explains most connection errors: Open WebUI calls Ollama from its backend, never from your browser. So the Ollama URL has to work from wherever the Open WebUI server runs, which in Docker is inside the container.

Step 1: check the Ollama server is running

On the computer running Ollama, open http://127.0.0.1:11434/api/version in a browser or run:

curl http://127.0.0.1:11434/api/version

A JSON reply with the Ollama version means the server is up. If the connection is refused, Ollama is not running: start it, see how to stop, restart or quit Ollama, or check port 11434 already in use.

Step 2: configure the right Ollama URL in Open WebUI

In Open WebUI go to Admin Panel > Settings > Connections. Enter the base URL only: http://host:port with nothing after the port. Open WebUI does not check the format. It adds /api/version to test the connection, so a wrong URL shows Ollama: Network Problem.

You enteredWhat goes wrongEnter instead
192.168.1.5:11434No http://, so the request is never senthttp://192.168.1.5:11434
http://192.168.1.5No port, so it tries port 80http://192.168.1.5:11434
http://localhost:11434/apiRequests /api/api/versionhttp://localhost:11434
Source: Open WebUI, "Network Problem When You Verify a Connection URL".

Which host to use depends on how Open WebUI runs:

How Open WebUI runsOllama URL to use
Installed directly on the same computer (pip or desktop)http://127.0.0.1:11434
Docker on Mac or Windows (Docker Desktop)http://host.docker.internal:11434
Docker on Linux (Docker Engine)http://host.docker.internal:11434 and start the container with --add-host=host.docker.internal:host-gateway
Docker with host networkinghttp://127.0.0.1:11434
Ollama in its own container on the same Docker networkhttp://ollama:11434
Ollama on another computerhttp://<that computer's IP>:11434
Podman on Machttp://host.containers.internal:11434

Why can't Open WebUI connect to Ollama in Docker?

Inside a Docker container, localhost means the container itself, so http://localhost:11434 never reaches an Ollama server on your computer. The backend log then shows a line such as Connect call failed ('127.0.0.1', 11434). Use host.docker.internal instead.

The Open WebUI quick start docker run command already includes the Linux fix:

docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data -e WEBUI_SECRET_KEY=your-secret-key --name open-webui --restart always ghcr.io/open-webui/open-webui:main

With no OLLAMA_BASE_URL set, this image looks for Ollama at http://host.docker.internal:11434 (then port 12434). Keep the right-hand port mapping at 8080: Open WebUI listens on 8080 inside the container. Replace your-secret-key with the output of openssl rand -hex 32.

Test the connection from inside the Docker container:

docker exec open-webui curl --fail --show-error --silent --max-time 5 http://host.docker.internal:11434/api/version

A version reply means the container can reach Ollama. If the hostname does not resolve on Linux, recreate the container with --add-host (or extra_hosts in Compose). If it resolves but the request fails, go to Step 4.

Option: host networking with --network=host

You can also share the host's network, so 127.0.0.1 inside the container is your computer. The docs give this command:

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 things to know: Docker ignores -p in this mode, so the UI is on http://localhost:8080; on Docker Desktop it needs version 4.34 or later with Settings > Resources > Network > Enable host networking turned on; and without that setting your browser cannot connect at all. If you can't enable it, go back to -p 3000:8080 and host.docker.internal.

For more on running Ollama itself in a container, see Ollama in Docker.

Step 3: let Ollama listen beyond 127.0.0.1

Ollama binds 127.0.0.1 port 11434 by default, so it only accepts connections from the same machine. If Open WebUI runs in a container that can't use host networking, or on another computer, set OLLAMA_HOST=0.0.0.0 and restart Ollama. The Ollama FAQ gives these steps:

  • Mac app: run launchctl setenv OLLAMA_HOST "0.0.0.0:11434", then restart the Ollama application.
  • Linux (systemd): run systemctl edit ollama.service, add Environment="OLLAMA_HOST=0.0.0.0:11434" under [Service], then run systemctl daemon-reload and systemctl restart ollama.
  • Windows: quit Ollama from the taskbar, add OLLAMA_HOST to your user environment variables, then start Ollama from the Start menu.

Then check which address the Ollama service listens on:

ss -tlnp | grep 11434        # Linux
netstat -an | findstr 11434  # Windows

0.0.0.0:11434, *:11434 or [::]:11434 means it listens on all interfaces. If it still shows 127.0.0.1:11434, the setting was not applied: on Linux, a missing [Service] line or a skipped daemon-reload or restart is the usual reason.

How to connect to a remote Ollama server

To run Open WebUI on one machine and Ollama on another, set OLLAMA_HOST=0.0.0.0 on the Ollama machine (Step 3), then point Open WebUI at it, either in Admin Panel > Settings > Connections or with OLLAMA_BASE_URL when you create the container. The quick start's example for Ollama on a different server:

docker run -d -p 3000:8080 -e OLLAMA_BASE_URL=https://example.com -v open-webui:/app/backend/data -e WEBUI_SECRET_KEY=your-secret-key --name open-webui --restart always ghcr.io/open-webui/open-webui:main

Replace https://example.com with your server's address, such as http://192.168.1.5:11434. The Ollama FAQ also covers putting Ollama behind a reverse proxy such as Nginx.

Step 4: check the firewall and port 11434, and keep it safe

If the URL is right and Ollama listens on 0.0.0.0 but the request still fails, check that the host firewall allows traffic from the Docker network or the Open WebUI machine to port 11434.

Keep that rule narrow. Ollama's local API has no login, so with 0.0.0.0 anything that can reach your computer on port 11434 can use it. Your users' browsers never need that port. Allow it only from the Open WebUI host, or put both on the same Docker network without publishing Ollama's port and use OLLAMA_BASE_URL=http://ollama:11434, as the project's docker-compose.yaml does.

How to fix an old or wrong Ollama URL that keeps coming back

Open WebUI saves connection settings in its database, and saved values take precedence over environment variables. So if you saved an unreachable URL, changing OLLAMA_BASE_URL and restarting does nothing, and the settings page may hang while it waits for the dead endpoint. The docs list three ways out:

  • Start once with RESET_CONFIG_ON_START=true so environment variables overwrite the saved values.
  • Run with ENABLE_PERSISTENT_CONFIG=false so environment variables always win (changes made in the UI then don't survive a restart).
  • As a last resort, back up and edit the SQLite database to delete the saved Ollama and OpenAI base URLs.

To recreate the container with new variables, the quick start uses docker rm -f open-webui, then the docker run command again. Your chats stay in the open-webui Docker volume.

If the model list is just slow, set AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST=3. By default Open WebUI waits 10 seconds for each unreachable endpoint.

Why can't Open WebUI find Ollama models?

Open WebUI lists only the models that the Ollama URLs in Settings > Connections return from /api/tags. A URL that does not answer adds no models. When the model selector differs from ollama list, Open WebUI and your terminal are usually talking to different Ollama servers:

  • Two Ollama installs, such as a native install plus an Ollama container. Each has its own models. Run docker exec ollama ollama list to see a container's models.
  • A renamed or missing Docker volume. Ollama keeps models in the volume mounted at /root/.ollama; a new volume name starts empty.
  • The bundled :ollama image run without -v ollama:/root/.ollama, so models vanish when the container is recreated.

Settings > About shows the lowest Ollama version across your connections, which helps you spot a stale second server. To add models, admins can type a name into the model selector and Open WebUI offers to pull it from Ollama.

Windows and WSL2

The Open WebUI docs say to install Docker Desktop with the WSL 2 backend, turn on Settings > Resources > WSL Integration, and run docker commands from your WSL terminal, not PowerShell. Watch for the two-installs problem above: Ollama in WSL and Ollama on Windows each keep their own models. If downloads are slow in WSL2 on Windows 10, the Ollama FAQ suggests disabling Large Send Offload on the vEthernet (WSL) adapter.

Connected, but chats fail

Verify Connection only calls /api/version, and the model list comes from /api/tags, so neither runs a model. If chats fail with "Server Connection Error", run ollama run <model> on the Ollama machine. If that fails too, the problem is in Ollama, often memory: see Ollama troubleshooting.

Frequently asked questions

Why can't Open WebUI connect to Ollama in Docker?

Inside Docker, localhost is the container itself. Use http://host.docker.internal:11434, and on Linux start the container with --add-host=host.docker.internal:host-gateway.

Does Open WebUI work with Ollama?

Yes. It connects to the Ollama API on port 11434 automatically, and lets admins pull, update and delete Ollama models from Settings > Connections.

How do I connect to Ollama remotely?

Set OLLAMA_HOST=0.0.0.0 on the Ollama machine, restart it, then enter http://<its IP>:11434 in Open WebUI. Allow port 11434 only from the Open WebUI host.

Why can't Open WebUI find my models?

It is usually reading a different Ollama server or Docker volume from the one your terminal uses. Compare ollama list on the server the URL points to.

I changed OLLAMA_BASE_URL but Open WebUI still uses the old URL. Why?

The saved setting in the database wins over the environment variable. Edit it in Settings > Connections, or start once with RESET_CONFIG_ON_START=true.

Next: set up Open WebUI, install Ollama or keep the Ollama commands list handy.

How we researched this

This is a Docs-only guide: it is built from the official documentation linked below, opened on November 30, 2026. We have not run these steps on our own test machine yet. If something here no longer matches what you see, tell us and we will log the correction.

Sources

Spotted a mistake? Tell us

Annie Vane, author of Local AI Scout

ABOUT THE AUTHOR

Annie Vane

Annie edits Local AI Scout and tests the models she covers on her own 24 GB M5 MacBook Air. She has worked in search, affiliate marketing and digital publishing for national newspapers and magazine groups.

More about Annie and how we test

Keep exploring: Apps · Models · All guides

Good finds.
Less noise.

The Scout Letter: new guides, app reviews and "Can I run it?" checks on new models, in one short email every two weeks. No spam.

Free to join. Unsubscribe with one click.