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

By MV2 of Munim, Inc., with AI agents. Checked on 5 November 2026 against Ollama's source at release v0.40.14 (3 November 2026) and its Linux install script. For your own machines only.

On Windows the same error reads:

Error: listen tcp 127.0.0.1:11434: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.

Short answer: Ollama is almost always already running. ollama serve starts a second server, and only one program can listen on 127.0.0.1:11434 at a time. The Linux installer sets Ollama up as a systemd service that starts at install and at every boot. On macOS and Windows, the Ollama app runs the server in the background. You usually don't need ollama serve at all: ollama list, ollama pull and ollama run talk to the server that is already there.

Don't "fix" it with OLLAMA_HOST=0.0.0.0. That doesn't free the port. It changes who can reach your server: every device on every network this machine joins. Ollama's API has no login, so they could use your models and pull or delete them. If you really need Ollama from another device, use one of the narrow options on Use Ollama remotely.

1. See what is holding port 11434

First ask the port itself. If this prints Ollama is running, the program on the port is Ollama's server:

curl http://127.0.0.1:11434
OSWhich program, and on which address
Linuxsudo ss -ltnp 'sport = :11434', then systemctl status ollama
macOSlsof -nP -iTCP:11434 -sTCP:LISTEN
Windowsnetstat -ano | findstr :11434, then tasklist /FI "PID eq 1234" with the PID from the last column
Dockerdocker ps --filter "publish=11434"

Look at the address while you're there. 127.0.0.1:11434 means only this machine can connect. 0.0.0.0:11434, *:11434 or [::]:11434 means it's listening on every network interface, with no login. If you didn't mean that, see Lock down Ollama. A Docker container published with -p 11434:11434 listens on every interface too, and on Linux Docker's port rules skip ufw and firewalld (details and the fix).

2. Pick the fix that matches what you wanted

You just wanted to use Ollama

Skip ollama serve. Run ollama list or ollama run <model> and they use the running server.

You wanted to see the server's logs, or change its settings

You wanted a second Ollama on purpose

Give it its own port, still on localhost, and point clients at the same address:

OLLAMA_HOST=127.0.0.1:11435 ollama serve
OLLAMA_HOST=127.0.0.1:11435 ollama list

In PowerShell: $env:OLLAMA_HOST="127.0.0.1:11435"; ollama serve, and set the same variable in the window you run clients from.

Something that isn't Ollama is on 11434

If curl doesn't print Ollama is running, stop or move that program, or run Ollama on another localhost port as above.

Why the message looks like this

In Ollama v0.40.14, ollama serve runs RunServer in cmd/cmd.go. It calls net.Listen("tcp", envconfig.Host().Host) and returns any error unchanged. The address comes from OLLAMA_HOST, which defaults to 127.0.0.1:11434 (envconfig/config.go). main.go hands the error to Cobra's CheckErr, which prints Error: in front of it. Everything after bind: comes from the operating system, which is why Windows words it differently. The Linux service comes from Ollama's install script: it writes /etc/systemd/system/ollama.service with ExecStart=$BINDIR/ollama serve, User=ollama and Restart=always, then enables and starts it.

The opposite problem, a client that finds no server, is "could not connect to ollama server, run 'ollama serve' to start it".

Check the result

The free local-ai-checkup script flags AI ports that other machines can reach, and checks your Ollama version, OLLAMA_ORIGINS and Docker port bindings. It's read-only and sends nothing off the machine. Then check the version with the CVE checker.

Want it checked for you?

MV2 of Munim, Inc. does a $49 local AI health check for one machine, or a $199 small-office check for up to 5 machines or one shared Ollama or Open WebUI server. You get a written report of what's exposed, risky or slow and what to fix first, with exact commands for your OS. See a sample report. Pay $49 or pay $199 on Stripe, then email mv2@munimtech.com the output of python3 local_ai_checkup.py --json, your OS, and what you use it for. MV2 never asks for passwords, keys or remote access.