Guide

Ollama port 11434 — fix conflicts & configuration guide

Ollama listens on localhost:11434 by default. This guide covers fixing "port already in use" errors, changing the port with OLLAMA_HOST, exposing Ollama to your LAN, and configuring Windows Firewall.

Ollama uses port 11434 for its local API

When Ollama starts on Windows, it binds to localhost:11434 and listens for HTTP requests. This is the local API that you (or any compatible app) use to send prompts and receive responses. The port is only accessible on your own machine — it is not exposed to the internet or your local network by default.

You can verify Ollama is running by visiting http://localhost:11434 in a browser or running curl http://localhost:11434 in a terminal. You should see the text Ollama is running.

cmd.exe
C:\> curl http://localhost:11434
Ollama is running

Fix "port 11434 already in use"

This error means another process is already using port 11434 when Ollama tries to start. Most commonly it is a previous Ollama instance that did not shut down cleanly.

  • 1

    Find which process is using the port

    cmd.exe
    C:\> netstat -ano | findstr 11434
    TCP 127.0.0.1:11434 0.0.0.0:0 LISTENING 8472
    # The last number (8472) is the PID
  • 2

    Identify the process by PID

    cmd.exe
    C:\> tasklist | findstr 8472
    ollama.exe 8472 Console 1 45,320 K
    # It is a previous Ollama instance
  • 3

    Stop the process

    If it is an Ollama process: right-click the Ollama system tray icon → Quit Ollama. Or force-kill by PID:

    cmd.exe
    C:\> taskkill /PID 8472 /F
    SUCCESS: The process with PID 8472 has been terminated.
  • 4

    Restart Ollama

    Start Ollama from the Start menu. Verify the port is now available:

    cmd.exe
    C:\> curl http://localhost:11434
    Ollama is running

Use a different port

If port 11434 is permanently used by another application on your system, you can configure Ollama to use a different port via the OLLAMA_HOST environment variable:

cmd.exe — set for current session
# Use port 11435 instead:
C:\> set OLLAMA_HOST=127.0.0.1:11435
C:\> ollama serve

To make it permanent, add OLLAMA_HOST as a System environment variable with value 127.0.0.1:11435 via Settings → System → Advanced system settings → Environment Variables.

If you change the port, any apps or scripts that call localhost:11434 must also be updated to use the new port.

Expose Ollama to your local network

By default Ollama only listens on 127.0.0.1 (localhost). To allow other devices on your LAN to connect — for example, a phone running a chat app against your PC:

cmd.exe
# Listen on all network interfaces:
C:\> set OLLAMA_HOST=0.0.0.0:11434
C:\> ollama serve

Other devices on your LAN can then connect to http://YOUR-PC-IP:11434.

Exposing Ollama to your network gives any device on that network access to your local models. Only do this on trusted networks.

Allow apps to reach Ollama through Windows Firewall

When Ollama starts for the first time, Windows Firewall may prompt you to allow connections. Click Allow access for private networks. If you missed this prompt or accidentally blocked it:

PowerShell — admin
PS> New-NetFirewallRule -DisplayName "Ollama local" -Direction Inbound -Protocol TCP -LocalPort 11434 -Action Allow -Profile Private

Port 11434 questions

Is port 11434 exposed to the internet?
No. By default Ollama only binds to 127.0.0.1 (localhost), which is only accessible from your own machine. It is not reachable from the internet or your local network unless you explicitly set OLLAMA_HOST=0.0.0.0.
Another Ollama is already running — how do I know?
Check the system tray (bottom-right). If you see the Ollama icon, the service is running. You can also run curl http://localhost:11434 — "Ollama is running" confirms it is active.
ollama serve: listen tcp: bind: address already in use
Ollama is already running in the background. You do not need to run ollama serve manually — the service starts automatically. Just use ollama run or ollama pull directly.

Ollama not starting at all?

Check the full troubleshooting guide for service and startup issues.

Troubleshooting guide