October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Ollama Connection Refused? The 60-Second Triage

Ollama connection refused errors usually come from one of three things: the server is not running, the client uses the wrong address, or the client runs in a separate network namespace such as a container or hosted notebook. Here is an ordered triage.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

“Connection refused” with Ollama means that nothing is accepting connections at the host and port your client is using, from the place where the client is running. The fastest way to find the cause is to answer three questions in order: Is the Ollama server running? Is the client calling the right address and port? Is the client on a different network namespace from the server, such as a container or a hosted notebook? Each question rules out a whole class of causes before you touch configuration.

The checks below take about a minute when the answer is obvious. Some setups need longer, especially containers and remote machines, so treat the 60 seconds as a target for the first pass rather than a guaranteed fix.

As an Amazon Associate I earn from qualifying purchases.

What the error means

Your client sent a TCP connection to an address and port, and the operating system replied that no process was listening there. On Linux the underlying error is often [Errno 111] Connection refused, which is the wording many Python users paste into bug reports. The refusal is about that exact address and port in that exact network context. It does not mean the model is broken or that Ollama is installed incorrectly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Question 1: Is the server listening?

Ollama’s local API is documented at http://localhost:11434/api, and the Ollama FAQ states that the server binds to 127.0.0.1:11434 by default. Test from the same machine where Ollama should be running:

#1 Best Overall
TP-Link AC1200 Gigabit Dual Band WiFi Router (Archer A6)
  • Dual band router upgrades to 1200 Mbps high speed internet (300mbps for 2.4GHz plus 900Mbps for 5GHz), reducing buffering and ideal for 4K stream
  • Full Gigabit Ports - Gigabit Router with 4 Gigabit LAN ports, ideal for any internet plan and allow you to directly connect your wired devices
  • Boosted Coverage - Four external antennas equipped with Beamforming technology extend and concentrate the Wi-Fi signals
  • MU-MIMO technology - (5GHz band) allows high speeds for multiple devices simultaneously
  • Access Point Mode - Supports AP Mode to transform your wired connection into wireless network, an ideal wireless router for home
curl http://localhost:11434/api/version

If that returns a version string, the server is up on that machine and you can move to question 2. If it fails with connection refused, the server is not listening there. Start it, or restart it if it has crashed:

  1. Foreground start: run ollama serve in a terminal and leave it open. Errors print directly to that window.
  2. Desktop app: launch the Ollama app and confirm it is running in the menu bar (macOS) or system tray (Windows).
  3. systemd service (Linux): run systemctl status ollama, then sudo systemctl restart ollama if it is inactive or failed.
  4. Confirm the port: on Linux, ss -ltnp | grep 11434 shows whether anything holds the port and which address it is bound to.

Only debug the client library after the curl check succeeds. Until then, any change to client code is guesswork.

Question 2: Is the client calling the right address and port?

Once the server answers curl on its own machine, compare the client’s base URL with what you tested. The most common mismatches are a wrong port, a scheme typo such as https://, a path that is appended twice, or a value taken from an old example. Print the effective base URL in your code or environment and make sure it matches the address that curl used.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
TP-Link ER605, Wired Gigabit VPN Router
  • 【Five Gigabit Ports】1 Gigabit WAN Port plus 2 Gigabit WAN/LAN Ports plus 2 Gigabit LAN Port. Up to 3 WAN ports optimize bandwidth usage through one device.
  • 【One USB WAN Port】Mobile broadband via 4G/3G modem is supported for WAN backup by connecting to the USB port. For complete list of compatible 4G/3G modems, please visit TP-Link website.
  • 【Abundant Security Features】Advanced firewall policies, DoS defense, IP/MAC/URL filtering, speed test and more security functions protect your network and data.
  • 【Highly Secure VPN】Supports up to 20× LAN-to-LAN IPsec, 16× OpenVPN, 16× L2TP, and 16× PPTP VPN connections.
  • Security - SPI Firewall, VPN Pass through, FTP/H.323/PPTP/SIP/IPsec ALG, DoS Defence, Ping of Death and Local Management. Standards and Protocols IEEE 802.3, 802.3u, 802.3ab, IEEE 802.3x, IEEE 802.1q

Remember that the address the client uses must be reachable from where the client runs. A value that works on your laptop can fail inside a container or on a remote machine even when the server is healthy.

Question 3: Is the client in another network namespace?

A container, a virtual machine, a WSL distribution, or a hosted notebook can each have its own network context. Inside that context, localhost refers to that environment, not to your host. An Ollama issue report shows a client container failing against localhost:11434 while the server ran on the host, and another report shows a hosted Google Colab client getting connection refused on that endpoint. Those reports describe a common pattern rather than universal instructions.

Containers

Run the same curl test from inside the container, for example with docker exec -it <container> sh, then curl the address the application uses. Pick the address based on where Ollama runs:

Rank #3
Sale
TP-Link AC1200 WiFi Router Dual Band Wireless Internet Router (Archer A54) | 4 x 10/100 Mbps Fast Ethernet Ports, EasyMesh Compatible, Support Guest WiFi, Access Point Mode, IPv6 & Parental Controls
  • Dual-band Wi-Fi with 5 GHz speeds up to 867 Mbps and 2.4 GHz speeds up to 300 Mbps, delivering 1200 Mbps of total bandwidth¹. Dual-band routers do not support 6 GHz. Performance varies by conditions, distance to devices, and obstacles such as walls.
  • Covers up to 1,000 sq. ft. with four external antennas for stable wireless connections and optimal coverage.
  • Supports IGMP Proxy/Snooping, Bridge and Tag VLAN to optimize IPTV streaming
  • Access Point Mode - Supports AP Mode to transform your wired connection into wireless network, an ideal wireless router for home
  • Advanced Security with WPA3 - The latest Wi-Fi security protocol, WPA3, brings new capabilities to improve cybersecurity in personal networks
  • Ollama in its own container on the same Compose network: use the service name, such as http://ollama:11434, from the other services. Check the service name in your docker-compose.yml.
  • Ollama on the host: Docker Desktop on macOS and Windows provides the host.docker.internal hostname for reaching host services. On Linux Docker Engine, that name is usually added with --add-host=host.docker.internal:host-gateway. Confirm how your platform’s Docker documentation describes host access before relying on it.

If the hostname resolves but the connection is still refused, the server is probably bound only to loopback on the host. That is the bind-address problem covered in the next section.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Hosted notebooks

A hosted notebook runs on the provider’s virtual machine. Ollama on your laptop is not at localhost from that runtime. Install and start Ollama inside the notebook’s runtime, then point the client at that local address, or use a tunnel or a server you control if the model must run elsewhere. Notebook runtimes can reset, so restart the server after a runtime restart.

Binding Ollama beyond localhost

Change the bind address only when a client outside the server’s loopback interface must reach it. Set OLLAMA_HOST on the process that launches the server, then restart Ollama. Setting it in your shell after Ollama has started does nothing for the running server.

Rank #4
Sale
TP-Link AX1800 WiFi 6 Router (Archer AX21 V5)
  • DUAL-BAND WIFI 6 ROUTER: Wi-Fi 6(802.11ax) technology achieves faster speeds, greater capacity and reduced network congestion compared to the previous gen. All WiFi routers require a separate modem. Dual-Band WiFi routers do not support the 6 GHz band.
  • AX1800: Enjoy smoother and more stable streaming, gaming, downloading with 1.8 Gbps total bandwidth (up to 1200 Mbps on 5 GHz and up to 574 Mbps on 2.4 GHz). Performance varies by conditions, distance to devices, and obstacles such as walls.
  • CONNECT MORE DEVICES: Wi-Fi 6 technology communicates more data to more devices simultaneously using revolutionary OFDMA technology
  • EXTENSIVE COVERAGE: Achieve the strong, reliable WiFi coverage with Archer AX1800 as it focuses signal strength to your devices far away using Beamforming technology, 4 high-gain antennas and an advanced front-end module (FEM) chipset
  • OUR CYBERSECURITY COMMITMENT: TP-Link is a signatory of the U.S. Cybersecurity and Infrastructure Security Agency’s (CISA) Secure-by-Design pledge. This device is designed, built, and maintained, with advanced security as a core requirement.

macOS app

Run launchctl setenv OLLAMA_HOST "0.0.0.0", then quit and reopen the Ollama app. The FAQ documents launchctl for the macOS app.

Linux systemd service

  1. Run sudo systemctl edit ollama.service.
  2. Add the following under a [Service] section, then save:
    [Service]
    Environment="OLLAMA_HOST=0.0.0.0"
  3. Run sudo systemctl daemon-reload, then sudo systemctl restart ollama.

Windows

Add OLLAMA_HOST as a user or system environment variable, then quit Ollama completely and relaunch it so it picks up the new value.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choosing the bind address

0.0.0.0 accepts connections on every network interface, which means anyone who can reach the machine on port 11434 can use the API. Where possible, bind to the specific interface address that your client uses, and restrict the port with a host firewall. Do not expose the port to a public network without authentication in front of it.

Best Value
Sale
TP-Link Dual-Band AX3000 Wi-Fi 6 Wireless Gigabit Internet Router for Home | EasyMesh, VPN Clients & Server, HomeShield, OFDMA, MU-MIMO, USB 3.0, Secure by Design - Archer AX55
  • Next-Gen Gigabit Wi-Fi 6 Speeds: 2402 Mbps on 5 GHz and 574 Mbps on 2.4 GHz bands ensure smoother streaming and faster downloads; support VPN server and VPN client¹
  • A More Responsive Experience: Enjoy smooth gaming, video streaming, and live feeds simultaneously. OFDMA makes your Wi-Fi stronger by allowing multiple clients to share one band at the same time, cutting latency and jitter.²
  • Expanded Wi-Fi Coverage: 4 high-gain external antennas and Beamforming technology combine to extend strong, reliable, Wi-Fi throughout your home.
  • Improved Battery Life: Target Wake Time helps your devices to communicate efficiently while consuming less power.
  • Improved Cooling Design: No heat ups, no throttles. A larger heat sink and redefined case design cools the WiFi 6 system and enables your network to stay at top speeds in more versatile environments.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Proxy settings: a later check

The Ollama FAQ warns that HTTP_PROXY can interrupt client connections to the server. Proxy variables are therefore worth checking only after the server, the address, and the network context are confirmed. If the curl test works from the client’s runtime but the application still fails, check whether HTTP_PROXY or HTTPS_PROXY is set there, and make sure NO_PROXY includes localhost, 127.0.0.1, and any host or service name you use. The FAQ also notes that Ollama uses HTTPS, not HTTP, for model pulls, so proxy problems during ollama pull have a separate cause from API connection refusals.

Symptom-to-check reference

Symptom Most likely cause Next check
curl to localhost:11434 is refused on the host Server is not running Start ollama serve or restart the service, then check the port with ss
Host works, container refused on localhost:11434 Container’s own localhost Use the service name or host-access hostname for your platform
Container reaches the host hostname but is still refused Ollama bound only to 127.0.0.1 Set OLLAMA_HOST for the server process and restart it
Hosted notebook refused on localhost:11434 Server is not running inside the notebook runtime Install and start Ollama in that runtime
curl works but the client library fails Wrong base URL or proxy variables in the client Print the effective URL and check HTTP_PROXY and NO_PROXY
Remote machine refused, server works locally Server not bound beyond loopback, or the address is not reachable from the client’s network Set OLLAMA_HOST, then confirm the client can reach the server’s address

Where the 60 seconds comes from

The sequence above is designed to rule out causes quickly, and most local mix-ups fall out in the first two questions. The time target is editorial, not a measured figure. Container networking, remote machines, and hosted runtimes can each take longer, and no official source promises a fixed resolution time for this error.

Quick Recap

Bestseller No. 1
TP-Link AC1200 Gigabit Dual Band WiFi Router (Archer A6)
TP-Link AC1200 Gigabit Dual Band WiFi Router (Archer A6)
MU-MIMO technology - (5GHz band) allows high speeds for multiple devices simultaneously
$44.99
SaleBestseller No. 2
SaleBestseller No. 4
TP-Link AX1800 WiFi 6 Router (Archer AX21 V5)
TP-Link AX1800 WiFi 6 Router (Archer AX21 V5)
VPN SERVER: Archer AX21 Supports both Open VPN Server and PPTP VPN Server
$59.98

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.