What Is Ollama? Setup, Models and Port 11434 Safety
Ollama is a free, MIT-licensed tool that downloads and runs AI models on your own computer. It serves a local API on port 11434, bound to 127.0.0.1 by default.

On this page
- What is Ollama?
- Is Ollama open source?
- Does Ollama cost money?
- How do you install Ollama?
- How do you update Ollama?
- Which Ollama model should you start with?
- What is the context window in Ollama?
- What is port 11434 and is it exposed?
- What we saw when we opened it up
- Does Ollama have a password or API key?
- How do you expose Ollama safely?
- Does Ollama allow cross-origin requests?
- How do you call Ollama from your own app?
- Is Ollama safe to use?
- Ollama vs LM Studio
- Ollama vs cloud AI APIs: which should you use?
- FAQ
What is Ollama? It's a free tool that downloads open AI models and runs them on your own computer. You chat with them in a terminal or app, or call them from your code through a local API on port 11434. By default that API listens only on your own machine (127.0.0.1). The one setting to treat with care is OLLAMA_HOST: point it at 0.0.0.0 and other machines can reach your models.
By Gary, Greenlight My App. Checked Nov 1, 2026. How we checked this: we read Ollama's own FAQ and its GitHub repository on Nov 1, 2026 and quote them below. We also tested it on Nov 1, 2026: we installed Ollama 0.40.13 in a throwaway Linux home folder with no real keys, imported a tiny model (smollm2:135m), called the local API, and tried the bind settings only on an isolated private test network with no internet route. Screenshots below are from that test. Drafted with AI tools and reviewed by a person before publishing.
What is Ollama?
Ollama is a program that makes running a large language model on your own hardware about as easy as installing an app. You type one command, it downloads a model file, and then you can chat with it. Under the hood it keeps a small server running on your machine so other apps, including code you write, can send it prompts over HTTP.
People use it for three main reasons:
- Privacy. Ollama's FAQ says: "Ollama runs locally. We don't see your prompts or data when you run locally." That's useful when you're working with notes or code you'd rather not send to a cloud service.
- Cost. Local models cost nothing per message. You pay in electricity, disk space and patience on slower hardware.
- Offline work. Once a model is downloaded, it runs without an internet connection.
Ollama sits in the same family as tools like LM Studio and llama.cpp. If you build apps with AI coding tools, you'll often see it used as the "local model" option in editors and terminal agents such as OpenCode.
Is Ollama open source?
Yes. The Ollama GitHub repository (external) lists the MIT License (checked Nov 1, 2026). The models you download carry their own licenses, set by the companies that made them, so check each model's page in the Ollama library (external) before you use it in a product.
Does Ollama cost money?
Running local models with Ollama is free. Ollama also offers cloud models that run on its servers instead of yours. If you only want local use, the FAQ shows how to switch cloud features off: set "disable_ollama_cloud": true in ~/.ollama/server.json, or set the environment variable OLLAMA_NO_CLOUD=1. The docs say the server log then shows "Ollama cloud disabled: true".
How do you install Ollama?
Download it from ollama.com/download (external). There are installers for macOS and Windows, and a one-line script for Linux:
curl -fsSL https://ollama.com/install.sh | shAs with any script piped into a shell, read it first if you're unsure. You can open the same URL in a browser to see exactly what it does.
In our test we used the Linux tarball from the download page instead, unpacked into a folder in our home directory, because the script expects root access and systemd, which our throwaway test folder didn't have.
After installing, check that it works:
ollama --version
ollama run llama3.2We didn't test ollama run llama3.2; our test used smollm2:135m, as shown below. The first ollama run downloads the model, which can take a while. Then you get a chat prompt in your terminal. Type /bye to leave.

How do you update Ollama?
The FAQ says Ollama on macOS and Windows downloads updates automatically; restart the app to apply one. On Linux, run the install script again:
curl -fsSL https://ollama.com/install.sh | shWhich Ollama model should you start with?
Pick one that fits your RAM. Bigger models need more memory and run slower on modest hardware. Start small, see how fast it feels, then step up. If Ollama feels too slow, the usual cause is a model too large for your memory, so try a smaller one first.
| Your machine | Model size to try first | What to expect |
|---|---|---|
| 8 GB RAM laptop | about 1B to 3B parameters | Quick, fine for short answers |
| 16 GB RAM | up to about 7B to 8B | Good everyday quality |
| 32 GB+ or a strong GPU | 14B and up | Better reasoning and code, slower to load |
This is a rough rule of thumb, not an official requirement. Each model's page in the library lists its download size, which is a good hint of the memory it needs.
- For a laptop with 8 to 16 GB of memory: a small model in the 1B to 4B size range answers quickly and handles everyday questions.
- For a desktop with a good GPU or 32 GB or more: 7B to 14B models give noticeably better answers, especially for code.
- For coding help: look for models tagged for code in the library (external).
We're not listing benchmark scores here, because they change with every release and depend on your machine. Try two or three models on a real task you care about and keep the one that does it best.
Useful commands while you experiment:
ollama list # models on disk
ollama ps # models loaded in memory right now
ollama stop llama3.2 # unload a model
ollama rm llama3.2 # delete it from diskIn our test, ollama list showed smollm2:135m at 105 MB on disk, and ollama ps showed it loaded with a 4096 context. We imported that model from a GGUF file with ollama create, because our test machine's network proxy blocked ollama pull.

The FAQ also explains where models are stored on each operating system and how to move them with the OLLAMA_MODELS variable if your main drive is small.
What is the context window in Ollama?
The context window is how much text the model can consider at once. Ollama's FAQ says the default context length is 4096 tokens and explains how to raise it. A bigger window uses more memory, so increase it only when your prompts get cut off.
What is port 11434 and is it exposed?
Port 11434 is where Ollama's local API listens. Your terminal chat, desktop app and any code you write all talk to http://127.0.0.1:11434.
Ollama's FAQ states it plainly: "Ollama binds 127.0.0.1 port 11434 by default. Change the bind address with the OLLAMA_HOST environment variable."
127.0.0.1 means "this computer only." Nothing else on your Wi-Fi, and nothing on the internet, can reach it. That's a sensible default. In our test, ss -ltnp showed Ollama listening on 127.0.0.1:11434 with no settings changed.

The risk starts when someone changes it. Tutorials that want Ollama reachable from a phone, a second computer or a Docker container often say to set:
OLLAMA_HOST=0.0.0.00.0.0.0 means "every network interface." On a home network behind a router, that usually means devices on the same network can reach it. On a cloud server with a public IP and an open firewall, it can mean the whole internet.
What we saw when we opened it up
We tried this only on a private test network inside our own machine, with no route to the internet. With OLLAMA_HOST=0.0.0.0:11434, a second test machine on that network listed our models and got an answer to a prompt, with no credentials at all. When we switched back to the default, the same request failed with "Could not connect to server".


Does Ollama have a password or API key?
Ollama's FAQ does not describe a login or key for the local API. Treat it as having none. Anyone who can reach port 11434 can send prompts, pull or delete models and use your CPU or GPU.
That isn't a flaw in a tool built for local use. It's a reason not to put it on the open internet without a gatekeeper.
How do you expose Ollama safely?
If you really need remote access, the FAQ shows setups with an Nginx reverse proxy, ngrok and Cloudflare Tunnel. Whichever you choose:
- Keep Ollama itself on 127.0.0.1. Let only the proxy talk to it.
- Add authentication at the proxy. Basic auth, an access policy on the tunnel, or a login in your own app.
- Use HTTPS so prompts and any tokens aren't sent in plain text.
- Firewall the port. On a cloud server, don't open 11434 in the security group at all.
- Check it from outside. From a phone on mobile data, try to open
http://YOUR-SERVER-IP:11434. If it answers, it's exposed.
Here's the Caddy setup from our test. Ollama stayed on 127.0.0.1, and Caddy asked for a password on port 8080 (the password is a fake placeholder; Caddy stores a hash of the real one):
:8080 {
basic_auth {
demo <bcrypt hash of XXXX>
}
reverse_proxy 127.0.0.1:11434
}From the second test machine, a request with no password got 401, and the same request with the password got the model list. For anything beyond a test network, add HTTPS as well.


Store the real token in a server-side env var, never in browser code. Our guide to what an .env file is covers how.
Does Ollama allow cross-origin requests?
Cross-origin requests are when a web page on one site calls an API on another address. Browsers block these unless the server allows them, a rule called CORS. Our CORS policy guide explains it in plain terms.
The FAQ says: "Ollama allows cross-origin requests from 127.0.0.1 and 0.0.0.0 by default. Additional origins can be configured with OLLAMA_ORIGINS."
Be careful with that setting. If you add a wildcard like OLLAMA_ORIGINS=*, any website you visit could ask your browser to send requests to your local Ollama. Add only the exact origins you need, such as http://localhost:3000 for your own dev app.
How do you call Ollama from your own app?
Your code sends a JSON request to the local API:
curl -s http://127.0.0.1:11434/api/tags
curl -s http://127.0.0.1:11434/api/generate -d '{"model":"smollm2:135m","prompt":"Say hello in five words.","stream":false}'Those are the two calls from our test. The first lists your models; the second returns a JSON reply with the model's answer.

When you deploy an app that uses a model, think about where that call happens:
- Server-side calls (an API route, a backend function) are the right place. The model server address and any tokens stay private.
- Browser-side calls expose the address, and any key you include, to every visitor. If an AI tool wrote a fetch to your model server inside a React component, move it to a server route.
The same rule applies when you switch from Ollama to a paid cloud model. An API key placed in frontend code can be copied by anyone. If that has already happened, see what to do if your AI API key was stolen.
Is Ollama safe to use?
For local use on your own machine with the defaults, Ollama is designed to keep the API on 127.0.0.1, and its docs say it doesn't see your prompts when you run locally. The main risks come from how it's set up:
- Changing
OLLAMA_HOSTto 0.0.0.0 on a machine reachable from the internet, with no proxy or firewall. - Wildcard
OLLAMA_ORIGINS, which lets other websites talk to it through your browser. - Running models from unknown sources. Stick to models in the official library or from makers you trust.
- Old versions. Keep it updated; Linux users need to re-run the install script.
None of this means you should avoid Ollama. It means you should treat port 11434 like a database port: useful on your machine, risky when it's public.
Ollama vs LM Studio
Both run open models on your own computer. Ollama started as a command-line tool with a local API, and now has a desktop app too. LM Studio is built around a desktop app where you browse and chat with models. If you mostly want to call a model from code or a coding agent, Ollama's API-first design is handy. If you want to point and click, try LM Studio. The same safety rule applies to both: keep any local server on 127.0.0.1 unless you've put a login in front of it.
Ollama vs cloud AI APIs: which should you use?
| Ollama (local) | Cloud AI API | |
|---|---|---|
| Cost per message | None for local models | Billed per token |
| API key | Not used for the local API | Required |
| Speed | Depends on your hardware | Usually fast |
| Model quality | Open models | Includes the largest closed models |
| Privacy | Prompts stay on your machine | Sent to the provider |
| Main risk | Exposing port 11434 | Leaking the API key |
Many developers use both: Ollama while prototyping, and a cloud model in production. If you go the cloud route, read how to get an OpenAI API key and keep the key on the server.
FAQ
What is Ollama used for? Running open AI models on your own computer for chat, coding help or app prototyping, without a cloud API key or per-message cost.
Is Ollama open source? Yes. Ollama's GitHub repository lists the MIT License (checked Nov 1, 2026). Each model you download has its own license.
What port does Ollama use? Port 11434. Ollama's docs say it binds 127.0.0.1 port 11434 by default, so only your own computer can reach it unless you change OLLAMA_HOST.
Is it safe to set OLLAMA_HOST to 0.0.0.0? Only on a trusted network or behind a firewall and a proxy with a login. The docs don't describe built-in auth for the local API.
Does Ollama send my prompts to the cloud? Not for local models. Ollama's FAQ says it doesn't see your prompts when you run locally. Cloud models run on its servers; OLLAMA_NO_CLOUD=1 turns them off.
Does Ollama need an API key? No, not for local models. The docs don't describe a login for the local API, which is why you shouldn't expose port 11434 publicly.
How do I update Ollama? Mac and Windows download updates automatically; restart the app. On Linux, re-run curl -fsSL https://ollama.com/install.sh (external) | sh, per Ollama's FAQ.
Does Ollama cost any money? Running local models is free. Ollama also offers cloud models; set OLLAMA_NO_CLOUD=1 if you want local only.
Why is Ollama so slow? Usually the model is too big for your memory or it's running on CPU only. Try a smaller model, and run ollama ps to see what's loaded.
Does Ollama need a GPU? No, it can run on a CPU, just slower. A GPU or Apple Silicon makes larger models practical.
How do I uninstall Ollama? On Mac or Windows, quit the app and remove it like any other app. Delete the models folder too if you want the disk space back.
Built an app on top of a local or cloud model? Run a free scan with Greenlight My App to check your live site's public code for exposed API keys and missing security headers.
Sources
On this site
Related posts

Codex CLI: Install, Sign In and Safe Permissions
How to install the Codex CLI, sign in with ChatGPT or an API key, pick safe sandbox and approval settings, and keep your .env file out of reach.

Cursor AI: What It Is, Pricing and Is It Safe?
What is Cursor AI? An AI code editor: its free and paid plans, what the Oct 29 extension notice means, and settings to check before you ship.

Is ChatGPT Free? Free Plan Limits and What Not to Paste
Is ChatGPT free? Yes. What the Free plan includes, where its limits are, how to turn off training, and why API keys never belong in a chat.
Get the next change before it bites
Greenlight tips and new blog posts: short, practical notes when Supabase, Lovable, Bolt, Cursor or another tool you build with changes something that affects your app, plus what to check. About twice a month.
We'll send a confirmation email first. Unsubscribe anytime. Privacy. Greenlight My App is independent and not affiliated with or endorsed by Supabase, Lovable, Bolt, Cursor or any other tool we mention.
Ollama is a trademark of its owners and is not affiliated with Greenlight My App. Model names belong to their makers. Defaults and settings were checked on Nov 1, 2026 and can change. Keys shown are fake placeholders. This page is general information, not professional security advice, legal advice, a security audit or a guarantee. Check your own setup against the vendor's current docs.