[GH-ISSUE #9444] Error: listen tcp 127.0.0.1:11434: bind: An attempt was made to access a socket in a way forbidden by its access permissions. #68214

Closed
opened 2026-05-04 12:53:38 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @DevelopSim on GitHub (Mar 1, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9444

OS: Win10

ollama serve
Error: listen tcp 127.0.0.1:11434: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

What I tried out:
1.
"ollama run llama2 --verbos"
works fine after some seconds.

ollama run llama2 --verbose

hello
Hello! It's nice to meet you. Is there something I can help you with or would you like to chat?

total duration: 43.523033856s
load duration: 29.490347562s
prompt eval count: 21 token(s)
prompt eval duration: 11.34s
prompt eval rate: 1.85 tokens/s
eval count: 26 token(s)
eval duration: 2.689s
eval rate: 9.67 tokens/s

already looked in
https://github.com/ollama/ollama/issues/2560#issuecomment-1950690705
https://github.com/ollama/ollama/issues/2627
and
https://github.com/ollama/ollama/issues/2627#issuecomment-2325218799
but did not solve my issue.

Do you have a hint?

Originally created by @DevelopSim on GitHub (Mar 1, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9444 OS: Win10 >`ollama serve` Error: listen tcp 127.0.0.1:11434: bind: An attempt was made to access a socket in a way forbidden by its access permissions. What I tried out: 1. "ollama run llama2 --verbos" works fine after some seconds. 2. ollama run llama2 --verbose >>> hello Hello! It's nice to meet you. Is there something I can help you with or would you like to chat? total duration: 43.523033856s load duration: 29.490347562s prompt eval count: 21 token(s) prompt eval duration: 11.34s prompt eval rate: 1.85 tokens/s eval count: 26 token(s) eval duration: 2.689s eval rate: 9.67 tokens/s 3. already looked in https://github.com/ollama/ollama/issues/2560#issuecomment-1950690705 https://github.com/ollama/ollama/issues/2627 and https://github.com/ollama/ollama/issues/2627#issuecomment-2325218799 but did not solve my issue. Do you have a hint?
Author
Owner

@rick-github commented on GitHub (Mar 1, 2025):

https://github.com/ollama/ollama/issues/7524#issuecomment-2586006961

<!-- gh-comment-id:2692304237 --> @rick-github commented on GitHub (Mar 1, 2025): https://github.com/ollama/ollama/issues/7524#issuecomment-2586006961
Author
Owner

@flywiththetide commented on GitHub (Mar 1, 2025):

It looks like this issue might be caused by Windows reserving certain ports, including port 11434, for dynamic allocation. Here are a few solutions that have worked for similar cases:

Solution 1: Exclude Port 11434 from Windows' Reserved Ports

Run the following commands in an Administrator Command Prompt:

net stop winnat
netsh int ipv4 add excludedportrange protocol=tcp startport=11434 numberofports=1
net start winnat
  • This stops the Windows NAT service, excludes port 11434 from the reserved range, and restarts NAT.

Solution 2: Use a Different Port for Ollama

Set the OLLAMA_HOST environment variable to run Ollama on a different port:

set OLLAMA_HOST=127.0.0.1:5005
ollama serve
  • This will start Ollama on port 5005 instead of 11434.

Solution 3: Check if Another Process is Using Port 11434

Run this command:

netstat -ano | findstr :11434
  • If a process is already using port 11434, you can stop it with:
taskkill /PID <process_id> /F

(Replace <process_id> with the actual number from the previous command.)

Let us know if any of these solutions work for you!

<!-- gh-comment-id:2692316259 --> @flywiththetide commented on GitHub (Mar 1, 2025): It looks like this issue might be caused by Windows reserving certain ports, including port 11434, for dynamic allocation. Here are a few solutions that have worked for similar cases: ### **Solution 1: Exclude Port 11434 from Windows' Reserved Ports** Run the following commands in an **Administrator Command Prompt**: ``` net stop winnat netsh int ipv4 add excludedportrange protocol=tcp startport=11434 numberofports=1 net start winnat ``` - This stops the **Windows NAT service**, excludes **port 11434** from the reserved range, and restarts NAT. ### **Solution 2: Use a Different Port for Ollama** Set the `OLLAMA_HOST` environment variable to run Ollama on a different port: ``` set OLLAMA_HOST=127.0.0.1:5005 ollama serve ``` - This will start Ollama on **port 5005** instead of **11434**. ### **Solution 3: Check if Another Process is Using Port 11434** Run this command: ``` netstat -ano | findstr :11434 ``` - If a process is already using port **11434**, you can stop it with: ``` taskkill /PID <process_id> /F ``` (Replace `<process_id>` with the actual number from the previous command.) Let us know if any of these solutions work for you!
Author
Owner

@DevelopSim commented on GitHub (Mar 1, 2025):

thanks a lot @flywiththetide
had Docker container running parallely. Stop the container -> now it als works.

<!-- gh-comment-id:2692327912 --> @DevelopSim commented on GitHub (Mar 1, 2025): thanks a lot @flywiththetide had Docker container running parallely. Stop the container -> now it als works.
Author
Owner

@daralucky commented on GitHub (Jun 10, 2025):

Thank you @flywiththetide
Solution 1 works great for me.

<!-- gh-comment-id:2957533402 --> @daralucky commented on GitHub (Jun 10, 2025): Thank you @flywiththetide Solution 1 works great for me.
Author
Owner

@shiro76 commented on GitHub (Oct 1, 2025):

Disabling Hyper-V and the Windows Hypervisor Platform allowed Ollama to bind the port successfully.

Open “Turn Windows features on or off”

Uncheck Hyper-V and Windows Hypervisor Platform

Restart your PC

Run ollama serve again → works as expected

It seems the hypervisor on Windows 10 reserves certain local TCP ports.

<!-- gh-comment-id:3358001114 --> @shiro76 commented on GitHub (Oct 1, 2025): Disabling Hyper-V and the Windows Hypervisor Platform allowed Ollama to bind the port successfully. Open “Turn Windows features on or off” Uncheck Hyper-V and Windows Hypervisor Platform Restart your PC Run ollama serve again → works as expected It seems the hypervisor on Windows 10 reserves certain local TCP ports.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#68214