Find the Cause Fast
| Where you call from | Usual cause | Fix |
|---|---|---|
| The same server | The service is stopped or crashed | Start it and read the logs (step 1) |
| Another computer | Ollama listens on 127.0.0.1 only | SSH tunnel, or OLLAMA_HOST plus a firewall rule (step 2) |
| A Docker container | 127.0.0.1 is the container, not the server | Host networking or one Compose network (step 3) |
| A web page or browser extension | The origin is not allowed (an error, not a refused connection) | OLLAMA_ORIGINS (step 4) |
1. Check the Service Is Running
sudo systemctl status ollama sudo systemctl start ollama journalctl -e -u ollama # the latest log lines ss -ltnp | grep 11434 # what is listening, and on which address curl http://127.0.0.1:11434 # should answer straight away
If the service keeps stopping, the log usually says why: a model that does not fit in memory, a GPU driver problem (see installing NVIDIA drivers) or a full disk. For a Docker install, check docker ps and docker logs ollama, and make sure the container was started with -p 11434:11434, as in Ollama's Docker instructions.
2. Reach It From Another Computer
Ollama binds 127.0.0.1:11434 by default. The safest way in is an SSH tunnel, which needs no change on the server:
ssh -N -L 11434:127.0.0.1:11434 you@203.0.113.10 # then use http://127.0.0.1:11434 on your own computer
To listen on the network instead, set OLLAMA_HOST for the service with sudo systemctl edit ollama.service, and allow only your own address, since the API has no key:
[Service] Environment="OLLAMA_HOST=0.0.0.0:11434"
sudo systemctl daemon-reload && sudo systemctl restart ollama sudo ufw allow from 198.51.100.7 to any port 11434 proto tcp
The ollama command reads OLLAMA_HOST too, so a client on another machine uses OLLAMA_HOST=http://203.0.113.10:11434 ollama list. Between your own servers, our private network or WireGuard keeps port 11434 off the internet altogether.
3. Reach It From a Docker Container
A container calling 127.0.0.1:11434 reaches itself. For Open WebUI with Ollama installed on the server, its troubleshooting notes use host networking (the page then moves to port 8080):
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
Or run both in one Compose project, where each service reaches the other by name:
services:
ollama:
image: ollama/ollama
volumes: [ "ollama:/root/.ollama" ]
open-webui:
image: ghcr.io/open-webui/open-webui:main
environment:
OLLAMA_BASE_URL: http://ollama:11434
ports: [ "127.0.0.1:3000:8080" ]
volumes: [ "open-webui:/app/backend/data" ]
volumes:
ollama: {}
open-webui: {}For an NVIDIA GPU, the Ollama container also needs the GPU passed through, as in the Open WebUI guide. Publishing on 127.0.0.1 keeps the page behind your reverse proxy; see why ufw does not block Docker ports.
4. Requests From a Browser or Extension
Ollama accepts cross-origin requests from 127.0.0.1 and 0.0.0.0 by default. A web app on another origin or a browser extension needs its origin added with OLLAMA_ORIGINS, set the same way as OLLAMA_HOST, for example Environment="OLLAMA_ORIGINS=https://app.example.com" (Ollama FAQ).