Key Takeaways
- •The error means nothing is listening on port 11434. Run curl http://127.0.0.1:11434 first: 'Ollama is running' means the server is fine and your client is calling the wrong place; 'Connection refused' means the server side needs work.
- •The most common cause is that the server simply is not running. Start it with ollama serve, or on Linux with sudo systemctl enable --now ollama so it survives reboots.
- •Ollama binds to 127.0.0.1 port 11434 by default. If a client calls localhost and the machine resolves localhost to the IPv6 address ::1 first, the connection is refused even though the server is up — use the literal address 127.0.0.1 instead.
- •From Docker, WSL or another machine, localhost does not reach the server. Bind Ollama with OLLAMA_HOST=0.0.0.0:11434, and from a container use host.docker.internal instead of localhost.
- •Do not reinstall first. None of the common causes needs a reinstall — and on Windows, check Windows Defender Firewall, which blocks inbound port 11434 by default.
The Short Answer: Start the Server, Then Check the Address
Ollama has two parts: a background server that loads models and listens on a network port, and the ollama command, which is only a client that sends requests to that server. When the server is not running, every command fails — ollama run, ollama list, API calls from your code — because there is nothing on the other end. The error text varies by version, but the meaning is the same: nothing is listening on port 11434. Before reading on, run the 60-second triage from the same machine and shell your failing tool runs in: curl http://127.0.0.1:11434. If it answers 'Ollama is running', the server is fine and your client is calling the wrong place. If it refuses, the server side needs work — start it first. The most common cause, by a wide margin, is that the server was never started. On macOS and Windows Ollama runs as a tray app that is easy to quit by accident; on Linux the systemd service may never have been enabled after a reboot. Rule this out first.
Match Your Exact Error Message
Ollama has changed this error's wording several times, so first match your message. The messages below were checked against the Ollama 0.40.16 source code on 17 November 2026, the latest release that day. 'Could not connect to ollama app, is it running?' is Ollama 0.7.0 or older. (Ollama 0.40.16 release) On 0.7.1 to 0.15.4 the same situation prints 'ollama server not responding' plus the cause after a dash. On current Linux, and on macOS outside Ollama.app, the message is 'could not connect to ollama server, run ollama serve to start it'. On Windows and macOS the app can also print 'timed out waiting for server to start'. Two messages mean different things. 'Warning: could not connect to a running Ollama instance' comes from ollama -v: no server was found, but your command-line tool is fine. And 'bind: address already in use' is the opposite problem — a server is already running, so do not start another one. From curl or a programming client the error is plainer: 'curl: (7) Failed to connect to localhost port 11434: Connection refused' is your operating system reporting that nothing holds port 11434. All of these mean the same thing — no listener — and all are fixed the same way, in the order below.
Fix 1: Start the Ollama Server
If the triage curl refused, start the server. On macOS, open the Ollama app from Applications or Spotlight; on Windows, start Ollama from the Start menu or the system tray. From any terminal you can also run ollama serve, which runs in the foreground until you stop it — useful for seeing its logs. On Linux the installer sets up a systemd service automatically — use that instead of a manual ollama serve. (Ollama Linux install and service setup) Check it with sudo systemctl status ollama, then start it with sudo systemctl start ollama. Make it permanent with sudo systemctl enable --now ollama, which starts the service and enables it at boot. Verify the fix the same way you diagnosed it: curl http://localhost:11434 should now answer 'Ollama is running', and ollama list should show your models. If the service starts and then dies again, read why first: journalctl -u ollama -n 50 prints the reason.
Fix 2: The localhost Trap and the Wrong Port
If curl answers 'Ollama is running' but your tool still fails, the server is fine and the client is calling the wrong place. The most common version is the localhost trap: Ollama listens on IPv4 127.0.0.1 by default, but on a dual-stack machine localhost can resolve to the IPv6 address ::1 first. (Ollama default bind address) The client dials ::1:11434, nothing listens there, and you get 'fetch failed' or 'ECONNREFUSED ::1:11434'. The Ollama JavaScript client has an open issue for exactly this mismatch. The test costs two seconds: curl http://127.0.0.1:11434. If the raw IP works and the name does not, use the literal IPv4 address everywhere — point the base URL at http://127.0.0.1:11434 instead of http://localhost:11434. The second version is a wrong port. Ollama's default is 11434, not 11435, 8080 or 3000. If you or a tutorial ever set OLLAMA_HOST to a custom address, the server answers on that port and every client still calling 11434 gets refused. Confirm what is actually listening with ss -ltn | grep 1143, or netstat -ano | findstr :11434 on Windows. Expect one line holding 127.0.0.1:11434. No line means the server is down — go back to Fix 1. A different port means your clients are out of date.
Fix 3: Docker, WSL and Other Machines
If the server answers on its own machine but a container, WSL or another computer cannot reach it, the problem is a network boundary, not Ollama. By default Ollama binds to 127.0.0.1 port 11434 — localhost only — and will not accept connections from any other address. That is the official default in Ollama's own FAQ. To let other machines reach it, set OLLAMA_HOST to 0.0.0.0:11434 and restart. On Linux, persist it with sudo systemctl edit ollama, adding Environment="OLLAMA_HOST=0.0.0.0:11434" under [Service], then sudo systemctl daemon-reload and sudo systemctl restart ollama. On macOS run OLLAMA_HOST=0.0.0.0:11434 ollama serve. On Windows, add OLLAMA_HOST as a user environment variable and relaunch Ollama. From Docker, localhost inside a container means the container itself, not your host — use host.docker.internal instead, and on plain Linux add --add-host=host.docker.internal:host-gateway when starting the container. For container-to-container calls, use the service name, as in http://ollama:11434. From WSL2, localhost is the WSL virtual machine, not Windows: use the Windows host IP, or enable mirrored networking in .wslconfig. Two warnings. First, Ollama's API has no username or password, so never expose port 11434 directly to the internet — anyone who can reach it can use your GPU and even delete your models. Bind to 0.0.0.0 only on a network you trust. Second, if the client is a web app in a browser and the connection still fails after the bind, the cause is usually CORS: Ollama allows cross-origin requests from 127.0.0.1 and 0.0.0.0 by default, and other origins need OLLAMA_ORIGINS set, for example OLLAMA_ORIGINS=* ollama serve.
Fix 4: The Firewall, and When Nothing Else Works
If curl works locally but a remote machine still cannot connect after binding to 0.0.0.0, a firewall is dropping the inbound connection. On Windows this is the most common cause of all: Windows Defender Firewall blocks inbound port 11434 by default, and Ollama creates no firewall rule during installation. The fix, in PowerShell as Administrator, is one rule: New-NetFirewallRule -DisplayName "Ollama API" -Direction Inbound -Protocol TCP -LocalPort 11434 -Action Allow. On Linux the same role is played by ufw or a corporate firewall, and endpoint tools such as CrowdStrike or SentinelOne can block the port too. If nothing above has worked, run the server in debug mode: OLLAMA_DEBUG=1 ollama serve prints verbose logs, including the address it binds and any startup error. Check the version too — the latest release was 0.40.16 as of 17 November 2026, so update if you are far behind. Do not reinstall first. None of the causes above needs a reinstall — the server, the port, the address and the firewall are all configuration, and a fresh install keeps the same configuration. Reinstall only after the triage, the logs and the firewall have all been checked. If you are setting Ollama up for the first time, our DeepSeek R1 local guide covers installation first: https://www.techdaur.com/blog/how-to-run-deepseek-r1-locally-vram-gguf-ollama-guide-2026 — and if the server runs but a model fails with an out-of-memory error, see our Ollama CUDA out-of-memory guide: https://www.techdaur.com/blog/fix-ollama-cuda-out-of-memory-vram-tuning-guide-2026
Frequently Asked Questions
Why does Ollama say 'failed to connect'?
It means nothing is listening on port 11434 — either the server is not running, or the client is calling the wrong address or port. Run curl http://127.0.0.1:11434: if it answers 'Ollama is running', the server is fine and the client is wrong; if it refuses, start the server with ollama serve.
How do I know if Ollama is running?
Run curl http://localhost:11434 — a running server answers 'Ollama is running'. Or run curl http://localhost:11434/api/tags for a JSON list of models, or ollama list for a model table. On Linux, systemctl is-active ollama prints 'active' when the service is up.
What port does Ollama use?
Port 11434, bound to 127.0.0.1 (localhost only) by default. Change it with OLLAMA_HOST — for example OLLAMA_HOST=0.0.0.0:11434 ollama serve to listen on all interfaces. Check what is actually listening with ss -ltn | grep 1143.
How do I connect to Ollama from Docker or another computer?
Bind Ollama to all interfaces with OLLAMA_HOST=0.0.0.0:11434 and restart it. From Docker use host.docker.internal instead of localhost. From WSL2 use the Windows host IP or enable mirrored networking. Then allow TCP port 11434 through the firewall — Windows Defender Firewall blocks it by default.
Should I reinstall Ollama to fix a connection error?
No. None of the common causes needs it: a stopped server, a wrong port, the localhost trap, a Docker or WSL network boundary, or a firewall rule are all configuration problems a fresh install keeps. Reinstall only after the triage, the logs and the firewall have been checked.
Jawad Ahmad Almas
Tech entrepreneur, full-stack web developer, and digital strategist with over 5 years of experience in modern CMS architectures, AI-driven content generation, and UI/UX design. Founder of TechDaur and jawadalmas.store, dedicated to auditing frontier LLMs, hardware benchmarks, and publisher monetization playbooks.
More from TechDaur
Fix DeepSeek 'Server Is Busy' (HTTP 503): 7 Workarounds (2026)
How to Fix WSL2 High Memory (vmmem) & Disk Bloat on Windows 11
AWS Activate Credits for Startups: Founders Tier Guide (2026)
Stay Ahead in Tech & AI
Join developers, engineers, and creators. Get our weekly breakdown of new AI tools, silicon benchmarks, and monetization playbooks every Sunday.




