Configuration: Ollama local-only, private and with more context
Copyable recipes to turn off Ollama’s cloud features, keep it reachable only from your computer, increase the context and store models on another disk.
What it’s for
Ollama runs models on your computer, but it also offers cloud features. These recipes, taken from its official documentation, make sure everything stays on your computer and adapt Ollama to long documents.
1. Turn off cloud features
Create or edit the file ~/.ollama/server.json:
{
"disable_ollama_cloud": true
}
Or, alternatively, set the environment variable:
OLLAMA_NO_CLOUD=1
2. Keep it on your computer only
By default Ollama listens on 127.0.0.1:11434, that is, only on your computer. Don’t set OLLAMA_HOST=0.0.0.0 unless you know how to protect access from your network.
3. More context for long documents
OLLAMA_CONTEXT_LENGTH=8192 ollama serve
The default context is 4096 tokens. More context means more memory; check with:
ollama ps
4. Store models on another disk
OLLAMA_MODELS=/path/to/another/disk/ollama-models
How to set variables on your system
| System | How |
|---|---|
| Windows | Quit Ollama, search for “environment variables” in Settings, add the variable for your account and reopen Ollama |
| macOS | launchctl setenv NAME value and restart the Ollama app |
| Linux | Edit the service with systemctl edit ollama.service, add Environment="NAME=value" and restart |
Precautions
- After changing anything, restart Ollama so it takes effect.
- If an external app uses your Ollama, check its privacy settings too.
Frequently asked questions
What exactly does turning off the cloud do?
According to the official documentation, it disables Ollama’s cloud models and web search, so you only use local models.
Why shouldn’t I use 0.0.0.0?
OLLAMA_HOST=0.0.0.0 makes Ollama accept connections from other computers on your network. Without extra protection, anyone with access could use it. If only you use it on your computer, you don’t need it.
How much context should I set?
The default is 4096 tokens. Raise it only as much as you need: more context requires more memory. With ollama ps you can see the context and whether the model fits on the graphics card.
Keep reading
Sources
- FAQ (documentación oficial) — Ollama
- Quickstart (documentación oficial) — Ollama
Change log
- : First published.
Educational content, prepared with the help of AI tools, with sources cited. It is not a substitute for professional advice. Tools change fast: if you spot something out of date, write to us at contacto@cognenza.com. How we work.