AI agents & automation
Run local AI models with Ollama on a VPS: what to expect
Install Ollama on your own VPS, run an open AI model without a GPU, keep its API private and connect it to n8n. Plus honest expectations about RAM and speed.

On this page
Ollama lets you download open AI models and run them on your own machine. Running it on a VPS means your data never leaves your server and you don't pay per message. The trade-off is speed and hardware: a language model is heavy, and most VPS plans have no GPU.
Is a local model right for you?
Choose Ollama on a VPS when:
- privacy rules mean data can't go to an outside AI company,
- you have steady, simple tasks (classifying, summarising short texts, extracting fields),
- and slower responses are acceptable.
Stay with a cloud model if you need fast, high-quality answers in a chat with customers. Our cloud vs self-hosted AI guide compares the two.
Step 1: Install Ollama
The official one-line installer for Linux:
curl -fsSL https://ollama.com/install.sh | sh
Or with Docker, CPU only (from Ollama's Docker docs):
docker run -d -v ollama:/root/.ollama -p 127.0.0.1:11434:11434 --name ollama ollama/ollama
We added 127.0.0.1: to the port so the API isn't reachable from the internet; more on that below.
Step 2: Run a small model
ollama run llama3.2
The first run downloads the model; then you can chat in the terminal. With Docker, prefix the command: docker exec -it ollama ollama run llama3.2. Browse other models in the Ollama library and start with the smaller variants.
Check whether the model is running on the CPU or a GPU, and how much memory it uses:
ollama ps
free -h
How much RAM and how fast?
Ollama doesn't publish a fixed RAM table per model size, so be wary of anyone quoting exact numbers. What the docs do say:
- the model must fit in memory, so bigger models need more RAM;
- RAM use also grows with the number of parallel requests and the context length (the default context is 4,096 tokens);
- without a GPU, Ollama runs on the CPU, which works but is slow.
Practical approach: start with a small model on a plan with 8 GB of RAM or more, measure with ollama ps and free -h, and move to a bigger plan (16 GB+) only if you need a larger model.
Step 3: Keep the API private
Ollama listens on 127.0.0.1:11434 by default, which means only the server itself can reach it. Keep it that way. The API has no login, so anyone who can reach it can use your server's resources.
If n8n runs on the same server in Docker, put both in the same Compose project and point n8n at http://ollama:11434. There's no need to open the port to the internet.
Step 4: Use it from n8n
n8n has an Ollama chat model node you can attach to its AI Agent node. Set the base URL to your Ollama address, pick the model you downloaded, and your agent runs entirely on your server. See our n8n installation guide for the n8n side.
Choosing a plan
For local models, RAM and CPU cores matter most. Our VPS sizing guide explains the options; Hostinger's KVM 4 (16 GB) and KVM 8 (32 GB) are the sensible starting points for Ollama.
Frequently asked questions
Do I need a GPU to run Ollama?
No. Ollama runs on the CPU when there's no supported GPU. It works, but answers are much slower than on a GPU or from a cloud API, so pick small models.
How much RAM does Ollama need?
It depends on the model size, and Ollama's docs don't publish a fixed table. The model has to fit in memory, and the FAQ notes that RAM use also grows with parallel requests and context length. Test with a small model first and watch memory with ollama ps and free -h.
Sources & references
Related reading
AI agents & automation
Cloud AI API or your own server? Privacy, cost and quality compared
Should your AI agent use a cloud model like GPT, Claude or Gemini, or a model running on your own server? A practical comparison for businesses that care about data.
2 min read
AI agents & automation
Best VPS for n8n and AI agents: how much server you actually need
How much RAM and CPU n8n, OpenClaw, Hermes Agent and Ollama really need, which VPS plan size fits each, and what to check before you pick a provider.
2 min read
AI agents & automation
How to install Hermes Agent on a VPS and connect it to Telegram
Set up Nous Research's open-source Hermes Agent on your own VPS, choose an AI model, connect it to Telegram and lock it down with the official safety settings.
2 min read