Ollama Not Working? Fix "Could Not Connect" and Port 11434

A man with his hand to his forehead at a laptop showing code, beside a notebook and a mug on a wooden desk by a window.

By Annie Vane · Local · Mac · Fix · Docs-only · Checked October 25, 2026

Every command and error message below comes from the Ollama documentation or its source code on GitHub, checked October 25, 2026. The Mac advice assumes the menu-bar app on Apple Silicon; Windows fixes are marked.

Most Ollama problems on a Mac come down to four things: the server is not running, it is already running when you try to start a second copy on port 11434, the model is too big for your memory so part of it runs on the processor, or the context window is set larger than the machine can hold. Each has a two-minute fix, and the server log at ~/.ollama/logs/server.log tells you which one you have. This page lists the fixes in the order people need them, taken from Ollama's own FAQ and troubleshooting documentation. New to Ollama? Start with the Ollama guide; this page is for when it misbehaves.

Quick fix: run ollama serve in a Terminal window to start the server and see its log, ollama ps to check which models are loaded and whether they are on the GPU, and ollama list to check which are installed. The sections below explain each error.

Start here: read the log

Ollama's documentation says the best way to find out what happened is the server log. On a Mac, open Terminal and run:

cat ~/.ollama/logs/server.log

Scroll to the bottom; the last few lines usually name the problem. If you started Ollama by typing ollama serve in a Terminal window, the log is in that window instead. Two quick checks go with it: ollama ps shows which models are loaded and where, and ollama list shows which are installed.

Ollama documentation Troubleshooting page showing how to read the server log on a Mac, 27 November 2026
Screenshot: Ollama troubleshooting documentation, taken November 27, 2026. Source: docs.ollama.com.

How to check if the Ollama server is running

  1. Look for the icon: the llama in the Mac menu bar, or in the Windows system tray (click the arrow for hidden icons).
  2. Ask the server: open http://localhost:11434 in a browser, or run curl http://localhost:11434. A running server replies "Ollama is running". "Connection refused" means it is not.
  3. Check the version: ollama -v prints "ollama version is" and a number when the server is up, and a "could not connect" warning when it is not.
  4. Find the process: search for ollama in Activity Monitor on a Mac. On Windows, Task Manager shows "ollama app.exe" (the app) and "ollama.exe" (the server). On Linux, run systemctl status ollama.

Be careful with ollama ps as a test. On a Mac or Windows PC, ollama ps, ollama list and ollama run open the app for you if it is closed, so they can hide the problem. If the terminal cannot find Ollama at all, start with how to fix "ollama: command not found".

Ollama error messages and what they mean

Each heading is the message exactly as Ollama prints it, from its source code on GitHub on October 25, 2026.

Warning: could not connect to a running Ollama instance

You see this after ollama -v. The command is installed but the server is not running, so it can only report its own version, as "Warning: client version is" and a number. Open the Ollama app, or run ollama serve, and try again. If the app is open and the warning stays, check that OLLAMA_HOST is not set to a different address in your Terminal. The "client version" line can also appear alone after an update, when the app and the command differ; quit and reopen the app.

Error: could not connect to ollama server, run 'ollama serve' to start it

On a Mac or Windows PC, commands try to open the app when the server is down; this means they could not, usually because the ollama command was installed separately from the app. On Linux nothing starts automatically: run sudo systemctl start ollama. Elsewhere, open the app or run ollama serve. More in could not connect.

Error: listen tcp 127.0.0.1:11434: bind: address already in use

This comes from ollama serve when something already holds port 11434, nearly always the Ollama app. On Windows it ends "Only one usage of each socket address (protocol/network address/port) is normally permitted". See port 11434 is already in use.

upgrade in progress...

Windows only. A command tried to start the app while the installer was running, usually during an automatic update. Wait a minute and try again.

model requires ollama version ... or newer

The model needs a newer Ollama. Click the Ollama icon and choose Restart to update, or download it again from ollama.com/download. Check Ollama's releases page for the current version.

Out of memory: "out of memory", "cudaMalloc failed" or "failed to allocate"

The model and its context did not fit. Ollama retries once with a smaller automatic context; the log then says "reducing automatic context and retrying once". If it still fails, free memory with ollama stop and the name of any model you are not using, pick a smaller size or the 4-bit build, and shorten the context. If you raised OLLAMA_NUM_PARALLEL, set it back to 1, because memory grows with it.

Ollama not opening, or the app won't start

Ollama needs macOS 14 Sonoma or later, or Windows 10 22H2 or later. The app keeps its own log, separate from the server log.

Ollama not opening on a Mac

  • Read the app log: cat ~/.ollama/logs/app.log.
  • Check the menu bar: it may be running with no window. Opening it again closes the first copy and starts a fresh one.
  • Keep it in Applications: if you said no to "Move to Applications?" on first launch, the ollama command may not be linked.
  • Reinstall: download it again and replace the app. Models in ~/.ollama stay put.

Ollama not opening on Windows

  • Check the system tray: opening Ollama again from the Start menu brings the running copy forward rather than starting a second one.
  • Read the logs: press Windows key + R and type explorer %LOCALAPPDATA%\Ollama. app.log is the app, server.log the server.
  • Turn on debug logging: quit Ollama from the tray, then start it from PowerShell:
$env:OLLAMA_DEBUG="1"
& "ollama app.exe"

"Could not connect to ollama server"

The server is not running. On a Mac the server is the menu-bar app: look for the llama icon at the top right of the screen. If it is missing, open Ollama from Applications, or start the server yourself with:

ollama serve

Then try your command again in a second Terminal window. If the app refuses to start, the fastest reset is to quit it from the menu bar, wait ten seconds and open it again. Nothing is lost: your models stay in ~/.ollama/models. If you have told another program, such as OpenClaw or Open WebUI, where Ollama lives, make sure it points at http://127.0.0.1:11434 with nothing after the port number; the OpenClaw guide explains why a trailing /v1 breaks tool calling.

Port 11434 is already in use

An error saying the address 127.0.0.1:11434 is already in use means Ollama is already running, almost always as the menu-bar app, and you have tried to start a second copy with ollama serve. You do not need both. Either quit the menu-bar app and keep the Terminal version, or close the Terminal and use the app; ollama run and every other command talk to whichever one is alive.

If something else has taken the port, or you want Ollama on a different one, change the address with the OLLAMA_HOST setting. For the menu-bar app on a Mac, set it with launchctl and restart the app:

launchctl setenv OLLAMA_HOST "127.0.0.1:11435"

The same setting, with 0.0.0.0:11434, lets other machines on your network reach Ollama. The docs note it binds to 127.0.0.1 only by default, which is the safe choice; only open it up if you understand who else is on the network.

Ollama is not using the GPU

Run ollama ps while a model is loaded and read the PROCESSOR column. The docs give three readings: 100% GPU means the whole model is on the graphics chip, 100% CPU means it is all in system memory, and a split such as 48%/52% CPU/GPU means part of it did not fit. On an Apple Silicon Mac the GPU is the same chip and the same memory, so a split means the model is bigger than the share of memory macOS lets the graphics side use, which is about 75% by default.

The fix is a smaller model or a smaller file: pick the 4-bit version, drop a size (14B instead of 27B), or shorten the context length as described below. Once the smaller one works, delete the Ollama models you no longer use to get the disk space back. The local LLM memory calculator shows which models fit your memory with room to spare. Intel Macs have no usable GPU for Ollama and always run on the processor. On Linux PCs with Nvidia or AMD cards, the troubleshooting docs cover driver problems; an AMD card on a driver older than ROCm 7 hangs during discovery and falls back to the CPU.

Ollama using the CPU, not the GPU, on a Windows or Linux PC

"100% CPU" in ollama ps on a PC with a graphics card means the card or driver was not picked up. Nvidia cards need compute capability 5.0 or newer and, on Windows, driver 551.61 or newer; cards of compute capability 5.0 to 6.2 need driver 570 or newer. AMD Radeon cards use ROCm v7 or Vulkan, and Ollama recommends Vulkan for Radeon RX 6000 cards that do not get ROCm v7 on Windows. Update the driver, restart Ollama and check again.

Answers are slow, or the first one takes a long time

Three causes, in order of likelihood:

  1. The model is loading. The first answer after a pause includes reading the whole file into memory. By default Ollama unloads a model after five minutes idle. To keep it loaded, set OLLAMA_KEEP_ALIVE to -1 (see changing settings), or warm it up before you need it with ollama run gemma4 "". To free the memory on purpose, use ollama stop gemma4.
  2. Part of the model is on the CPU. Check ollama ps as above. Even a 10% spill slows every word.
  3. The context is huge. A long document or a long chat fills the context window, and every new word has to attend to all of it. Start a fresh chat, or raise the limit only as far as you need.

Two settings help at long context. OLLAMA_FLASH_ATTENTION=1 forces on a memory-saving method that Ollama normally picks automatically, and OLLAMA_KV_CACHE_TYPE=q8_0 halves the memory the conversation cache uses with, in the docs' words, usually no noticeable impact on quality.

Changing the context length without running out of memory

Ollama's default context window is 4,096 tokens, roughly 3,000 words, which is too small for a long document (our guide to why Ollama cuts off long prompts shows how to spot it). You can raise it three ways. For one chat, type this inside ollama run:

/set parameter num_ctx 16384

For every model, set OLLAMA_CONTEXT_LENGTH as a server setting. For a program that talks to the API, pass num_ctx in the options. Memory use grows with the context, and the docs point out it is multiplied again by OLLAMA_NUM_PARALLEL if you allow parallel requests, so a 32K context on a 16GB Mac can push a model that fitted at 4K onto the CPU. Raise it in steps and watch ollama ps. Coding agents need far more: Ollama's documentation recommends at least 64,000 tokens for coding tools, which is covered in Claude Code with Ollama.

Changing Ollama's settings on a Mac

Ollama is configured with environment variables. When it runs as the menu-bar app, the docs say to set each one with launchctl setenv and then restart the app:

launchctl setenv OLLAMA_KEEP_ALIVE "-1"
launchctl setenv OLLAMA_CONTEXT_LENGTH "16384"

The settings people change most:

SettingWhat it doesDefault
OLLAMA_HOSTAddress and port the server listens on127.0.0.1:11434
OLLAMA_MODELSFolder where models are stored; use it to move them to an external drive~/.ollama/models
OLLAMA_KEEP_ALIVEHow long a model stays loaded after use; -1 keeps it, 0 unloads at once5 minutes
OLLAMA_CONTEXT_LENGTHDefault context window in tokens4096
OLLAMA_ORIGINSExtra web origins allowed to call the API, such as browser extensionsLocal only
OLLAMA_MAX_LOADED_MODELSHow many models may be in memory at once3 per GPU
OLLAMA_NO_CLOUD1 turns off Ollama's cloud models and web searchOff
OLLAMA_DEBUG1 writes more detail to the logOff

Two more that are not environment variables. To stop Ollama opening at login, go to System Settings, search for Login Items and switch off Ollama under "Allow in the Background". To turn off every cloud feature permanently, put {"disable_ollama_cloud": true} in ~/.ollama/server.json; after a restart the log shows "Ollama cloud disabled: true". The Ollama guide covers updating, stopping, restarting and uninstalling. Every everyday command is in the Ollama commands cheat sheet, and what the cloud features cost and send is in Ollama Cloud explained.

How to use ollama serve

ollama serve starts the server in the current Terminal window and prints its log there. Use it on Linux without the background service, on a machine without the desktop app, or to try a setting for one session. With the Mac or Windows app running you do not need it, and a second copy hits the port 11434 error.

ollama serve                               # start on 127.0.0.1:11434
OLLAMA_HOST=127.0.0.1:11435 ollama serve   # another port, this session only
OLLAMA_DEBUG=1 ollama serve                # more detail in the log
ollama serve --help                        # every setting it reads

Leave that window open; Ctrl+C stops the server and unloads every model. Run other commands in a second window, with the same OLLAMA_HOST if you changed the port. In PowerShell, set it first with $env:OLLAMA_HOST="127.0.0.1:11435". On Linux with the service installed, use sudo systemctl start ollama and read the log with journalctl -e -u ollama.

Frequently asked questions

Why does Ollama say port 11434 is already in use?

Because Ollama is already running, usually as the menu-bar app, and you have tried to start a second copy with ollama serve. Use the copy that is running, or quit the app first. To put Ollama on another port, set OLLAMA_HOST to an address such as 127.0.0.1:11435 with launchctl setenv and restart the app.

How do I check whether Ollama is using the GPU on my Mac?

Run ollama ps with a model loaded and read the PROCESSOR column. 100% GPU means the whole model is on the graphics chip; a split such as 48%/52% CPU/GPU means it did not fit in the memory macOS allows the GPU. Choose a smaller model, the 4-bit version or a shorter context to get back to 100% GPU.

Where does Ollama store models on a Mac?

In ~/.ollama/models, a hidden folder in your home directory. To keep them somewhere else, such as an external drive, set the OLLAMA_MODELS variable to the new folder with launchctl setenv OLLAMA_MODELS, move the folder, and restart Ollama.

How do I keep a model loaded in Ollama?

Ollama unloads a model five minutes after its last use. Set OLLAMA_KEEP_ALIVE to -1 to keep every model loaded until you unload it, or pass keep_alive: -1 in an API call for one model. ollama stop followed by the model name unloads it and frees the memory right away.

How do I increase the context length in Ollama?

The default is 4,096 tokens. Inside ollama run, type /set parameter num_ctx followed by the number you want. For every model, set OLLAMA_CONTEXT_LENGTH on the server. Larger contexts use more memory, so check ollama ps afterwards to make sure the model is still fully on the GPU.

Where are the Ollama logs on a Mac?

At ~/.ollama/logs/server.log. Run cat ~/.ollama/logs/server.log in Terminal and read the last lines. Set OLLAMA_DEBUG to 1 and restart Ollama for more detail, and Ollama's Discord helps interpret what you find.

Why does Open WebUI or a browser extension get a 403 from Ollama?

Ollama only accepts browser requests from 127.0.0.1 and 0.0.0.0 by default. Add the other origin with OLLAMA_ORIGINS; for all Chrome, Firefox and Safari extensions the docs suggest chrome-extension://*,moz-extension://*,safari-web-extension://*. Programs that call the API from outside a browser do not need this.

How do I turn off Ollama's cloud features?

Set disable_ollama_cloud to true in ~/.ollama/server.json, or set the OLLAMA_NO_CLOUD environment variable to 1, then restart Ollama. The log will show "Ollama cloud disabled: true". You lose cloud models and web search; local models are unaffected.

What does "could not connect to a running Ollama instance" mean?

The ollama command is installed but the Ollama server is not running, so ollama -v can only report the command's own version. Open the Ollama app, or run ollama serve, and the warning goes. If the app is already open, check that OLLAMA_HOST is not pointing at a different address.

How do I check if the Ollama server is running?

Open http://localhost:11434 in a browser or run curl http://localhost:11434. A running server replies "Ollama is running". You can also run ollama -v, look for the llama icon in the Mac menu bar or Windows system tray, or find the ollama process in Activity Monitor or Task Manager.

Why won't Ollama open on Windows?

Check the system tray first, because Ollama often runs there with no window. Then read app.log and server.log in %LOCALAPPDATA%\Ollama. Ollama needs Windows 10 22H2 or later. If a command says upgrade in progress, wait for the installer to finish before opening it again.

Sources

  • Ollama FAQ: context length, GPU check, environment variables on macOS, keep-alive, origins, model location, cloud features - checked October 22, 2026
  • Ollama troubleshooting: log locations, debug logging, GPU discovery on Linux - checked October 22, 2026
  • Ollama documentation, Windows and macOS: system requirements, app and server log locations, debug logging - checked October 25, 2026
  • Ollama documentation, GPU: Nvidia compute capability and drivers, AMD ROCm and Vulkan - checked October 25, 2026
  • Ollama CLI reference: ollama serve and ollama serve --help - checked October 25, 2026
  • Ollama source code on GitHub: exact error and warning text in cmd/cmd.go, cmd/start_darwin.go and cmd/start_windows.go; "Ollama is running" in server/routes.go; out-of-memory retry in server/sched.go and llm/status.go - read October 25, 2026

This page is reviewed monthly and was last checked on October 25, 2026. Your next step: run ollama ps and read ~/.ollama/logs/server.log to see which of the four causes you have.

Spotted a mistake? Tell us

Annie Vane, author of Local AI Scout

ABOUT THE AUTHOR

Annie Vane

Annie edits Local AI Scout and tests the models she covers on her own 24 GB M5 MacBook Air. She has worked in search, affiliate marketing and digital publishing for national newspapers and magazine groups.

More about Annie and how we test

Keep exploring: Apps · Models · All guides

Good finds.
Less noise.

The Scout Letter: new guides, app reviews and "Can I run it?" checks on new models, in one short email every two weeks. No spam.

Free to join. Unsubscribe with one click.