Black Friday: Save 10% for life on all of our VPS plans, now through Cyber Monday

10% off on selected plans for as long as you keep the service · new orders · up to 10 uses per customer · ends Dec 1, 2026, 12:00 AM EST.

See plans
Guideschevron_rightServers

Servers · 6 min read · Updated

How to Fix Ollama Connection Refused Errors

"Connection refused" on port 11434 means nothing is listening where you are calling: the Ollama service is stopped or crashed, it only listens on 127.0.0.1 while you call from another machine, or you are calling from inside a Docker container, where 127.0.0.1 is the container itself. Check systemctl status ollama and journalctl -e -u ollama, set OLLAMA_HOST if it must listen elsewhere, and give containers a real route to it.

Find the Cause Fast

Ollama connection problems and their fixes
Where you call fromUsual causeFix
The same serverThe service is stopped or crashedStart it and read the logs (step 1)
Another computerOllama listens on 127.0.0.1 onlySSH tunnel, or OLLAMA_HOST plus a firewall rule (step 2)
A Docker container127.0.0.1 is the container, not the serverHost networking or one Compose network (step 3)
A web page or browser extensionThe 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).

Common Questions

  • What port does Ollama use?

    11434. By default Ollama listens on 127.0.0.1:11434, so only programs on the same machine can reach it. Change the address with the OLLAMA_HOST environment variable.

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

    Inside a container, 127.0.0.1 is the container itself, not the server. Run Open WebUI with --network=host and OLLAMA_BASE_URL=http://127.0.0.1:11434, or run Ollama as a container in the same Compose project and point Open WebUI at http://ollama:11434.

  • Is it safe to set OLLAMA_HOST=0.0.0.0?

    Only behind a firewall. Ollama's API has no password or key, so anyone who can reach port 11434 can use your models. Allow only your own addresses, or reach it through an SSH tunnel or a VPN instead.

  • Where are Ollama's logs on Linux?

    In the systemd journal: journalctl -e -u ollama shows the latest lines. For a Docker install, use docker logs with the container's name.

Plans and prices

GPU Servers

GPU servers with full root access for Ollama and Open WebUI.

See all plans
  • Intel Core Ultra 9 285K w/ NVIDIA Tesla P4

    NVIDIA Tesla P4 · 8 GB GPU

    24 Cores · 192 GB RAM · 2x 3.84TB NVMe Gen4

    Los Angeles, CA (LA1) · 50 TB transfer · 25 Gbps

    $589.00/mo

  • NVIDIA DGX Spark

    NVIDIA DGX Spark · 128 GB GPU

    20 Cores · 128 GB RAM · 4TB NVMe Gen4

    Ogden, UT (UT1) · 50 TB transfer · 10 Gbps

    $609.00/mo

    Sold out
  • AMD EPYC 7443P w/ NVIDIA RTX 3090

    NVIDIA RTX 3090 · 24 GB GPU

    24 Cores · 256 GB RAM · 3.84TB NVMe

    Ogden, UT (UT1) · 100 TB transfer · 10 Gbps

    $659.00/mo

  • AMD Ryzen 9 9950X w/ NVIDIA RTX 3050

    NVIDIA RTX 3050 · 6 GB GPU

    16 Cores · 192 GB RAM · 2x 2 TB NVMe

    Ashburn, VA (ASH1) · Dallas, TX (TX3) · New York, NY (NY2) · Charlotte, NC (NC1) · Bend, OR (OR1) · Unmetered transfer · 1 Gbps

    $699.00/mo

Keep Reading

All guides