Open WebUI talks to Ollama over HTTP, and “connection refused” means nothing is listening at the address it was given. The cause is usually one of three: Ollama is not running, the address is wrong, or Open WebUI runs in Docker and localhost means the container, not your machine. This guide checks them in order.
Before you start
- Open WebUI installed, with Ollama installed on the same machine or a server.
- A terminal, and the Open WebUI settings page.
- curl to test the Ollama address.
Check Ollama is running
Test Ollama from a terminal:
curl http://localhost:11434/api/tags
If the command is refused, Ollama is not running: start it with ollama serve and try again. If it answers with a list of models, Ollama is fine and the problem is the address Open WebUI uses.
Check the address in Open WebUI
Open Settings, then Connections, and look at the Ollama base URL. It should match the address that worked in the previous step, usually http://localhost:11434 when both run on the same machine. Fix the address if it points somewhere else, then save and try a chat again.
Fix the Docker case
If Open WebUI runs in Docker and Ollama runs on the host, localhost inside the container is the container itself, not your machine. Point Open WebUI at the host instead, for example http://host.docker.internal:11434 on Docker Desktop, or start Ollama with OLLAMA_HOST set to 0.0.0.0 so it listens on the network, and use the host’s LAN address.
Worked example
Worked example: curl to localhost:11434 lists your models, but Open WebUI in Docker still says connection refused. Change the base URL to http://host.docker.internal:11434 and save. A chat prompt should now be answered, and the model list in Open WebUI should match the curl output.
Expected result
UNTESTED in this guide: no server was run while writing it. The expected result is that curl lists the models, the corrected base URL connects, and a chat prompt is answered.
Limitations
Opening Ollama to the network with OLLAMA_HOST=0.0.0.0 lets anyone on that network use it, so only do it on a trusted network and set access control first if the port is reachable beyond your own machine.
