Ollama listens on port 11434 by default. If another service already holds that port, or you want a second server in the foreground to watch its output, you can start Ollama on a different local port and point your clients at the same address.
What you need
- Ollama installed
- A free local port, for example 11435
- A terminal to start the server in the foreground
Step 1: Free the default port first
Check whether a server is already running with curl http://127.0.0.1:11434. If one answers, use it, or stop it first: quit the app on Mac or Windows, or run sudo systemctl stop ollama on Linux.
Step 2: Start the server on the new port
Run OLLAMA_HOST=127.0.0.1:11435 ollama serve. The server now listens on 127.0.0.1:11435 instead of the default.
Step 3: Confirm the new address answers
Run curl http://127.0.0.1:11435 and look for the Ollama is running reply. Point any client at the new address, because clients still default to port 11434.
Worked example: synthetic port change
The table below is a synthetic example. It shows the expected result of changing the port; no server was started.
| Address | Reply | Meaning |
|---|---|---|
| 127.0.0.1:11434 | No reply | Old server stopped |
| 127.0.0.1:11435 | Ollama is running | New server up |
| Client pointed at 11435 | Model answers | Client configured |
Expected result (UNTESTED). the old port stops answering, the new port replies Ollama is running, and a client pointed at 11435 gets an answer. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- Keep the server on 127.0.0.1 unless you understand the risk; binding 0.0.0.0 exposes an unauthenticated API to the whole network.
- Every client needs the new port set, or it will keep knocking on 11434 and find nobody.
- Two servers cannot share one port; the second one fails with address already in use.
