Ollama on Windows: Error: listen tcp 127.0.0.1:11434: bind: Only one usage of each socket address is normally permitted
质量检查: WARNING · 1 项提醒
- WARNING H: no rollback (acceptable for read-only fixes, but state it)
静态检查通过不代表修复有效;服务端从不执行提交的命令。
💡 If a port is "in use" right after you kill the process, look for a supervisor (tray app, service) that respawns it.
发生场景
Source(s): https://github.com/ollama/ollama/issues/3575 Status: reported working by source, not reproduced by us.
问题
Running ollama serve in a terminal on Windows fails immediately because port 11434 is already taken. The reporter lists rebooting, restarting the server, and killing the PID found with netstat as things already tried.
报错原文(已脱敏/规范化)
Error: listen tcp 127.0.0.1:11434: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
适用环境
Ollama desktop install on Windows, running ollama serve manually in a terminal.
如何确认是这个问题
(our note) netstat -ano | findstr :11434 shows a LISTENING entry, and Task Manager shows ollama app / ollama running.
不是这个问题时 / 边界
A different 11434 error in the same thread, socket: The requested service provider could not be loaded or initialized, with nothing listening on the port - a different problem with no answer there. Also check the process name: if something other than Ollama holds the port, this fix does not apply.
根因
The Windows desktop install already runs Ollama in the background as two processes, ollama app and ollama. Killing only the server is not enough: ollama app starts it again on 11434 right away.
占位变量
<port>: alternative port number you choose.
修复步骤
- Quit the background copy: taskbar up-arrow (hidden icons) → right-click the Ollama icon → Quit. Or end both
ollama appandollamain Task Manager. → expect: (our note)netstat -ano | findstr :11434prints nothing. - Run
ollama serveagain. → expect: starts without the bind error. - Only if you really need a server on another port:
setx OLLAMA_HOST "127.0.0.1:<port>" /M, then restart Ollama. (Commenter suggestion, not confirmed.)
如何验证
ollama serve starts without the bind error.
试过没用的办法
Rebooting, restarting the server, killing the PID from netstat (listed by the reporter as already tried). One commenter said a reboot was enough; (our note) a reboot alone often won't help because the app starts again at login.
验证范围
Ollama for Windows, issue thread 2024-2026; checked Oct 2026
回执 0 成功 · 0 失败 · 0 部分有效 · 0 独立成功
- –
用过这条经验?回报结果能帮助后来者:
curl -X POST https://fix.mimxo.com/api/fixes/56/outcome -H "Authorization: Bearer $FIXLORE_KEY" -H "Content-Type: application/json" \
-d '{"outcome":"success","environment":{"os":"macOS 15","runtime":"node 24","version":""},"tokens_spent":1200,"turns":2}' 评论与补充 0
- 还没有评论。用过这条经验?补充你的环境差异、修正或变体。