Is port 11434 (Ollama API) exposed to the internet?
Ollama listens on 127.0.0.1:11434 by default, and its local API needs no authentication, so port 11434 becomes exposed only when OLLAMA_HOST, a Docker port mapping or a tunnel opens it. AdminKit's port check does not test 11434; this guide shows how to test it yourself and close it.
By AdminKit team, Netbase JSC · Updated
Key takeaways
- Port 11434 is Ollama’s HTTP API. A plain install binds it to
127.0.0.1, so only the same machine can reach it. - The local API has no authentication. Ollama’s own documentation says so. Whoever reaches the port can run prompts, pull models and delete them.
- The port becomes public in three common ways:
OLLAMA_HOSTset to0.0.0.0, the Docker image run with-p 11434:11434, or a tunnel or proxy that forwards to it. - AdminKit’s port check does not test 11434. Test it manually from outside your network, then trace which of the three settings opened it.
- Fix it by binding to localhost, or by putting an authenticating reverse proxy in front and limiting who can reach it.
What does Ollama listen on by default?
Ollama runs a local HTTP server that its own command-line client and other applications talk to. IANA’s port registry lists TCP 11434 under the service name ollama. The Ollama FAQ answers the exposure question in two sentences: “Ollama binds 127.0.0.1 port 11434 by default. Change the bind address with the OLLAMA_HOST environment variable.”
That default is safe. A loopback address cannot be reached from another machine, so on a laptop or a server where nobody changed the setting, port 11434 is closed to the network. The FAQ’s own configuration examples show how that changes: on macOS it sets OLLAMA_HOST to 0.0.0.0:11434 with launchctl, and on Linux it adds the same value to the systemd service with systemctl edit ollama.service. The address 0.0.0.0 means every interface. On a cloud VM, or a server with a public address, that includes the internet.
Why is an open port 11434 a problem?
The Ollama API authentication page states: “The local API at http://localhost:11434 does not require authentication.” API keys exist, but they are for direct requests to ollama.com, not for your own server. There is no login, token or allowlist built into the local API, so the bind address is the only thing deciding who may use it.
The API reference lists what a caller can do:
| Endpoint | What an outsider gets |
|---|---|
GET /api/tags, GET /api/ps | The models you have installed and the ones loaded in memory right now |
GET /api/version | The exact Ollama version, which tells them which known flaws apply |
POST /api/generate, POST /api/chat | Free use of your CPU or GPU for their own prompts |
POST /api/pull, POST /api/create | New models downloaded or built on your disk |
DELETE /api/delete | Your models removed |
POST /api/push | Models copied out to a registry |
The compute cost alone can be significant on a GPU server, and the delete endpoint makes the API a way to break whatever depends on it. The authentication page adds one more detail: a server that has been signed in to ollama.com can run cloud models through the same local API. On such a server, an open port also lets strangers send requests that run under your account.
Has an exposed Ollama API been exploited before?
The clearest public case is CVE-2024-37032. The GitHub Advisory Database entry describes it as Ollama before 0.1.34 not validating the format of a model digest, so a digest containing ../ could point outside the model directory. Wiz Research, which found it, showed the attack path: a caller asks the /api/pull endpoint to fetch a model from a registry the attacker controls, and the malicious manifest makes the server write files where it should not, which Wiz turned into remote code execution.
Wiz’s write-up makes two points that matter for exposure. First, the default Linux install binds to localhost, which “reduces remote exploitation risk significantly”. Second, in Docker deployments the server runs as root and listens on 0.0.0.0 by default, which “enables remote exploitation”. Ollama fixed the flaw within hours of the report, and 0.1.34 and later are not affected. The lesson outlives the bug: every endpoint of an unauthenticated API is attack surface, and the next flaw will be reachable the same way.
Why does Docker change the default?
The official image does not keep the localhost default. Ollama’s Dockerfile on GitHub sets OLLAMA_HOST=0.0.0.0:11434 inside the container, which is necessary so that traffic from outside the container can arrive at all. Then the Ollama Docker instructions start it like this:
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
The -p 11434:11434 part publishes the port on every interface of the host. Docker’s port publishing documentation is blunt about this: “Publishing container ports is insecure by default”, because the port becomes available “not only to the Docker host, but to the outside world as well”. Adding 127.0.0.1 in front of the mapping limits it to the host.
Many administrators expect the host firewall to catch this. On Ubuntu with ufw, it does not. Docker’s packet filtering page explains that traffic to published ports is diverted in the NAT table before it reaches the chains ufw uses, so “Packets are routed before the firewall rules can be applied, effectively ignoring your firewall configuration.” A ufw deny 11434 rule can look correct and change nothing. The same pattern applies to the Docker Engine API itself; see is port 2375 (Docker API) exposed?
What about tunnels and reverse proxies?
The Ollama FAQ documents three ways to reach the server from elsewhere: an Nginx reverse proxy, ngrok and Cloudflare Tunnel. Each one can be used safely, but none adds authentication by itself. A command such as ngrok http 11434 gives the API a public URL, and the FAQ example passes only a host header. Anyone who learns that URL has the same access as a local user, and port 11434 on the host can look closed while the API is fully reachable through the tunnel.
If you use a tunnel or proxy, configure authentication at that layer: the proxy’s own login or client certificate, or the tunnel provider’s access controls. Then test the public URL from a browser with no session to confirm it asks for credentials.
How do you check your own exposure?
AdminKit’s open ports check tests a fixed list of nine TCP ports on the public IP address you connect from, and 11434 is not on it. Find your public address with what is my IP, then test from a machine outside your network, such as a phone on mobile data with a terminal app or a cloud shell:
nc -vz -w 3 203.0.113.5 11434
curl -s --max-time 5 http://203.0.113.5:11434/api/version
The address is from the documentation range; use your own. Run these only against a host you own or are authorized to test.
| Result | What it means |
|---|---|
nc reports the connection succeeded, and curl prints {"version":"..."} | The Ollama API is open to the internet with no authentication. Fix it now. |
nc connects, but curl returns 401 or a login page | Something in front of Ollama asks for credentials. Check that it covers every path, not only /. |
nc times out or is refused | Nothing answers on 11434 from where you tested. Also check any tunnel URL, which bypasses this test. |
If you forward ports on a home router, check for a port forwarding rule or a UPnP mapping to 11434 as well.
How do you confirm the listener on your own host?
On the machine running Ollama, see which address the port is bound to:
$ sudo ss -ltnp 'sport = :11434'
LISTEN 0 4096 127.0.0.1:11434 0.0.0.0:* users:(("ollama",pid=901,fd=3))
This example output is the safe case. 127.0.0.1:11434 is loopback only. *:11434 or 0.0.0.0:11434 means every interface. For a Docker install, the listener belongs to docker-proxy or does not appear at all, because the NAT rules carry the traffic, so check the container instead:
docker port ollama
An answer of 11434/tcp -> 0.0.0.0:11434 means it is published on every interface. To find where OLLAMA_HOST was set on a systemd host, systemctl cat ollama shows the unit and any override files.
How do you fix an exposed Ollama API?
- Bind to localhost when only this machine uses it. Remove
OLLAMA_HOSTor set it to127.0.0.1:11434, then restart the service. - Publish Docker ports to loopback. Start the container with
-p 127.0.0.1:11434:11434, as Docker’s documentation shows for any port that only the host should reach. - Put authentication in front when other machines need it. Bind Ollama to localhost and expose a reverse proxy that requires a login or client certificate and serves TLS. Wiz’s advice is the same: deploy Ollama behind a reverse proxy that enforces authentication if you decide to expose it.
- Filter at the network edge. Allow 11434, or the proxy’s port, only from the application servers that call it. On Docker hosts, use a cloud security group or the
DOCKER-USERchain rather than ufw alone. - Stay current. Run Ollama 0.1.34 or later at the very least, and update regularly, since the API surface keeps growing.
- Review tunnels. List any ngrok, Cloudflare Tunnel or similar process forwarding to 11434, and close the ones you no longer need.
Does the same question apply to other AI tools?
Yes. Local model servers, agent frameworks and MCP servers often start as developer tools on a laptop, where a localhost-only, no-login API is reasonable, and then move to a shared server with the same settings. How to secure an MCP server covers the same bind-to-localhost rule for MCP’s HTTP transport, and AdminKit’s MCP endpoint check shows whether an MCP server at a URL you give it answers without authentication. The fast data stores covered in is port 6379 (Redis) exposed? follow the same pattern: safe on loopback, risky the moment the bind address widens.
Which servers may you test with these checks?
Every check this page links to is for assets you own or are explicitly authorized to test. Never scan, probe, or attempt to connect to a network or device you don’t control. AdminKit’s active checks only ever run against the IP making the request or an asset you’ve verified ownership of. See our Disclaimer and Acceptable Use Policy for the full terms.
This guide is part of AdminKit’s AI agents and MCP cluster, which covers the security of the services AI tools and agents run on.
This guide is general information, not a security audit of your specific network — see our disclaimer for what AdminKit's guidance does and does not commit to.
Frequently asked questions
Does Ollama require a password or API key on port 11434?
No. Ollama's API documentation says the local API at http://localhost:11434 does not require authentication. API keys apply only to direct requests to ollama.com. Anyone who can reach port 11434 on your server can call the same endpoints you can.
Is Ollama exposed to the internet by default?
Not in a plain install. Ollama's FAQ says it binds 127.0.0.1 port 11434 by default. Exposure starts when OLLAMA_HOST is set to 0.0.0.0 or a public address, when the Docker image is run with -p 11434:11434 on a host with a public address, or when a tunnel or reverse proxy publishes the port.
Why is the Docker install a special case?
The official Ollama image sets OLLAMA_HOST=0.0.0.0:11434 inside the container, and Ollama's Docker instructions publish the port with -p 11434:11434. Docker's own documentation warns that publishing container ports is insecure by default, because the port becomes available to the outside world, and that published ports bypass ufw firewall rules.
What can someone do with an open Ollama API?
Everything the API offers: list and inspect your models, run prompts on your hardware, pull new models, and delete or overwrite existing ones. On versions before 0.1.34, a path traversal flaw in the model pull handler (CVE-2024-37032) let a caller write arbitrary files, which Wiz Research showed could lead to remote code execution.
Does AdminKit's port check scan port 11434?
No. The port check tests a fixed list of nine TCP ports (23, 554, 1883, 8883, 502, 7547, 80, 443, 8080) on the public IP you connect from. Port 11434 is not on that list, so use the manual test in this guide from a machine outside your network.
What is the fastest fix?
Bind Ollama back to 127.0.0.1, or publish the Docker port as 127.0.0.1:11434:11434. If other machines need the API, put a reverse proxy with authentication and TLS in front of it and allow only the client addresses that need it at the firewall.
Sources
- Ollama Docs — FAQ: How can I expose Ollama on my network? (default bind 127.0.0.1:11434, OLLAMA_HOST)
- Ollama Docs — API Authentication (local API does not require authentication)
- Ollama Docs — API Introduction (base URLs and endpoints)
- Ollama Docs — Docker (docker run -p 11434:11434)
- Ollama on GitHub — Dockerfile (ENV OLLAMA_HOST=0.0.0.0:11434)
- Docker Docs — Port publishing and mapping (publishing ports is insecure by default)
- Docker Docs — Packet filtering and firewalls (Docker and ufw)
- Wiz Research — Probllama: Ollama Remote Code Execution Vulnerability (CVE-2024-37032)
- GitHub Advisory Database — GHSA-8hqg-whrw-pv92 / CVE-2024-37032 (Ollama before 0.1.34)
- IANA Service Name and Transport Protocol Port Number Registry (11434/tcp = ollama)
Want AdminKit to watch this for you?
Free checks tell you the state today. Protective DNS and monitoring tell you when it changes.
Talk to an expert
Huy Nguyen (David), Founder & CEO, Netbase JSC
Ask whether this fix applies to your setup, or get a second pair of eyes on your DNS and mail records.