HostingRunning a Local LLM on a VPS with Ollama: CPU-Only Expectationshostinq.com

Running a Local LLM on a VPS with Ollama: CPU-Only Expectations

Running your own large language model is attractive: your prompts and documents never leave your server, there is no per-token bill, and you can wire the model into internal tools. Ollama makes the installation easy. The part most tutorials skip is what performance you can expect on an ordinary VPS without a graphics card.

This guide is honest about that. Hostinq.com VPS plans, like most general-purpose VPS plans, have no GPU, so everything below assumes CPU-only inference. That works well for some jobs and poorly for others.

What CPU-only inference really means

When a model generates text, it reads most of its weights from memory for every token it produces. On a GPU those weights sit in very fast video memory. On a CPU they sit in regular RAM, which is much slower to read. The result is that generation speed on a CPU is limited mainly by memory bandwidth and core count, not by how much RAM you have.

Two numbers matter:

  • Prompt processing: how fast the model reads your input. Long inputs, such as a 20-page document, take noticeably longer on a CPU.
  • Generation speed: tokens per second while the answer is written. A token is roughly three quarters of an English word.

RAM decides which models you can load at all. CPU and memory speed decide how fast they answer. Our article on CPU, RAM and IO in hosting explains these resources in more detail.

How much RAM each model size needs

Ollama's library ships most models in 4-bit quantized form by default, which shrinks them to roughly 0.6 to 0.7 GB per billion parameters. The download size is a good estimate of the memory the weights need. Add 1 to 3 GB for the context window and runtime, plus whatever else runs on the server.

Model classExamples (download size)Server RAM to plan for
1-4B parametersqwen3:1.7b (1.4 GB), llama3.2:3b (2.0 GB), qwen3:4b (2.5 GB)4-8 GB
7-8B parametersqwen3:8b (5.2 GB)8 GB minimum, 12-16 GB comfortable
12-14B parametersgemma4:12b (about 8 GB), qwen3:14b (9.3 GB)16 GB
Mixture of experts, 26-30B totalgemma4:26b (16-19 GB), qwen3:30b (19 GB)32 GB
Dense 30B and largerqwen3:32b (20 GB), gemma4:31b (about 20 GB)32 GB or more
70B and larger40 GB and up64 GB or more, and very slow on CPU

Mixture of experts (MoE) models are interesting for CPU servers. qwen3:30b activates about 3B parameters per token and gemma4:26b about 3.8B, so they generate much faster than a dense model of the same total size. They still need the full model in RAM.

Two settings increase memory use: a longer context window, and serving several requests in parallel. A model that fits with one user and a 4,096-token context may not fit with four users and a 32,000-token context.

What speed to expect

Results depend on the CPU generation, memory bandwidth and how busy the host is, so measure on your own server instead of trusting anyone's chart, including this one. As a rough guide for a VPS with a handful of vCPUs:

  • Models in the 1-4B range are usually fast enough for short answers, classification and extraction.
  • 7-8B models typically generate in the single digits of tokens per second. Usable for one person, slow for chat with many users.
  • 14B and larger dense models are noticeably slower again and best kept for background jobs.

Ollama prints the real numbers when you add --verbose. Look at "prompt eval rate" and "eval rate" after each answer.

Good and bad jobs for a CPU-only LLM

Work that suits a CPU server:

  • Background tasks where nobody waits: tagging support tickets, summarizing yesterday's emails, extracting fields from documents overnight.
  • Embeddings for search and retrieval. Embedding models are small and run well on CPUs.
  • Private internal tools used by one or a few people at a time.
  • Automation workflows, for example an n8n instance on a VPS calling a local model.

Work that needs a GPU or a hosted API:

  • Public chatbots with many simultaneous users.
  • Coding assistants and agents that send long contexts on every request.
  • Large models (70B and up) at interactive speed.
  • Fine-tuning or training. CPU servers are for inference only.

When you need a GPU

If your use case is in the second list, a CPU VPS will disappoint you, whatever its size. Your options are a GPU cloud instance, a machine with a suitable graphics card that you manage yourself, or a commercial model API. A common middle ground is to keep your application, database and a small local model on a VPS, and send only the heavy requests to a hosted API.

Step by step: install Ollama on a VPS

  1. Connect over SSH (see our SSH basics guide) and update the system:
    sudo apt update && sudo apt upgrade -y
  2. Check that the CPU exposes AVX2, which the CPU runner uses for speed:
    grep -o -w -E 'avx2|avx512f' /proc/cpuinfo | sort -u
  3. Install Ollama with the official script. It creates an ollama system user and a systemd service:
    curl -fsSL https://ollama.com/install.sh | sh
    systemctl status ollama
  4. Pull a small model first and test it with timing output:
    ollama pull qwen3:4b
    ollama run qwen3:4b --verbose "Summarize what a VPS is in two sentences."
  5. Confirm where the model is running. On a server without a GPU the Processor column shows 100% CPU:
    ollama ps
  6. Test the HTTP API that your applications will use:
    curl http://127.0.0.1:11434/api/generate -d '{"model":"qwen3:4b","prompt":"Say hello","stream":false}'

Models are stored under /usr/share/ollama/.ollama/models. Several models add up quickly, so keep an eye on disk space.

Tuning Ollama for a CPU server

Settings go into a systemd override. Run sudo systemctl edit ollama.service and add:

[Service]
Environment="OLLAMA_CONTEXT_LENGTH=8192"
Environment="OLLAMA_NUM_PARALLEL=1"
Environment="OLLAMA_MAX_LOADED_MODELS=1"
Environment="OLLAMA_KEEP_ALIVE=30m"

Then apply it with sudo systemctl daemon-reload && sudo systemctl restart ollama.

  • Context length: on machines without a large GPU, Ollama defaults to 4,096 tokens. Raise it only as far as you need, because it costs memory and prompt time.
  • One request and one model at a time keeps memory predictable on a small server.
  • Keep alive: models unload after 5 minutes by default. A longer value avoids reloading the model from disk for every occasional request.

Do not count on swap to run a model that does not fit in RAM. It technically loads, but generation becomes extremely slow.

Keep the API private

Ollama listens on 127.0.0.1:11434 by default and has no authentication. Leave it that way. Anyone who can reach an exposed Ollama port can use your CPU and list, delete or replace your models.

  • To use the API from your own computer, open an SSH tunnel instead of exposing the port: ssh -N -L 11434:127.0.0.1:11434 user@SERVER_IP.
  • If you add a web interface such as Open WebUI, put it behind a reverse proxy with HTTPS and a login, and do not publish its container port to the internet.
  • Docker can open ports that bypass ufw rules. Read our notes on firewall setup on a VPS before publishing any container.

Frequently asked questions

Can I run a 70B model on a VPS without a GPU?

Only with 64 GB of RAM or more, and the answers will arrive very slowly. For most people a well-chosen 8B, 14B or MoE model gives better results per second of waiting.

Which Hostinq.com plan should I start with?

The Cloud VPS Starter plan (4 vCPU, 8 GB RAM) runs 1-4B models comfortably and an 8B model with little headroom. For 8B models next to other services, choose a plan with more RAM, and for 26-32B models consider a dedicated server with 64 GB.

Does more vCPU always mean faster answers?

Up to a point. Generation is limited mostly by memory bandwidth, so doubling vCPUs does not double tokens per second. Measure with --verbose before and after an upgrade.

Is a local model private?

The model runs on your server and Ollama does not need to send prompts anywhere. Privacy then depends on how you secure the server, the API and any web interface.

Hostinq.com KVM VPS plans are CPU-only, with NVMe storage and full root access, starting at $24.80 a month for 4 vCPU and 8 GB RAM in Germany, and VPS Standard (6 vCPU, 12 GB RAM) is available in the US, the UK, Singapore, Japan, Australia and India from $53.60 a month. For larger models, the Ryzen 12C dedicated server offers 12 cores and 64 GB of DDR5 RAM, also without a GPU.

Share: