---
title: "Run Ollama on a VPS: a language model on CPU only | StreetHosting"
description: "Install Ollama on a VPS without a GPU, run small quantized models, estimate the RAM you need and protect the port 11434 API with a proxy or an SSH tunnel."
url: "https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu"
type: "page"
language: "en-US"
---

VPS · 9 min · Intermediate

Published on Nov 13, 2026 · Updated on Nov 13, 2026

# Run a language model on your VPS with Ollama, using only the CPU

You can run 1B to 8B parameter models on an ordinary VPS, with no GPU. See how to install Ollama, how much RAM each model needs, what to expect from the speed and how to expose the API without leaving the port open to the internet.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[Linux administration](https://streethosting.com.br/en/guides/topics/linux) [Hardware and datacenter](https://streethosting.com.br/en/guides/topics/hardware)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Frun-ollama-llm-vps-cpu.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Frun-ollama-llm-vps-cpu.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Frun-ollama-llm-vps-cpu.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Frun-ollama-llm-vps-cpu.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Frun-ollama-llm-vps-cpu.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=Run%20Ollama%20on%20a%20VPS%3A%20a%20language%20model%20on%20CPU%20only&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Frun-ollama-llm-vps-cpu "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Frun-ollama-llm-vps-cpu "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Frun-ollama-llm-vps-cpu "Share on LinkedIn") [](https://wa.me/?text=Run%20Ollama%20on%20a%20VPS%3A%20a%20language%20model%20on%20CPU%20only%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Frun-ollama-llm-vps-cpu "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu.md)

In this guide 7 sections

* [What to expect from a CPU-only model](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#expectativas)
* [How much RAM each model needs](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#ram)
* [What sets the speed](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#velocidade)
* [Install and run the first model](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#instalar)
* [Use the API on port 11434](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#api)
* [Reach it from outside without opening the port](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#expor)
* [Where to run this at StreetHosting](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#onde-rodar)

Quick answer

**Ollama** runs open language models on your own VPS. VPS plans have no GPU, so everything runs on the CPU and RAM: pick small, quantized models of 1B to 8B parameters. Install it with `curl -fsSL https://ollama.com/install.sh | sh`, run a model with `ollama run llama3.2:3b` and use the HTTP API on port 11434. It listens only on 127.0.0.1 and has no password, so do not expose it directly: use an SSH tunnel or an Nginx with authentication.

## What to expect from a CPU-only model[](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#expectativas)

Let's start with what matters: StreetHosting VPS plans have no graphics card. A language model running on a VPS uses the CPU cores and RAM, and that changes the experience quite a bit compared with hosted services or a computer with a GPU.

In practice, the CPU handles light, one-off tasks well: summarizing a text, sorting messages by topic, pulling fields out of an email, rewriting a sentence, answering short questions about a passage you send yourself. It also suits internal automations, where nobody is watching the screen waiting for the answer to appear word by word.

It does not suit what depends on a large model or heavy concurrency: a chat open to the public, long texts with top quality or several users asking at once. If that is your goal, a GPU is the way to go, and an ordinary VPS will not solve it. For people who want privacy (the text never leaves your server) and a fixed cost, a small model on the CPU is a good tool.

Models of 1B to 8B parameters make more mistakes, invent more and understand less context than the large ones. Always test with your own texts before putting one into an automation, and have a person review any output that has consequences.

## How much RAM each model needs[](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#ram)

The whole model has to fit in memory. Ollama models usually come quantized, meaning the weights are stored in a few bits (the default is close to 4 bits per weight) instead of 16. That cuts the size by about four times with a small loss of quality.

The rough rule for planning: **quantized model size plus 1 to 2 GB of headroom** for the conversation context, Ollama itself and the system. The longer the text you send, the more memory the context uses. For the exact number of each model, open its page at `ollama.com/library` and check the size of the variant you are going to download.

* **1B to 3B parameters:** the quantized file is around 1 to 2 GB. It fits on a 4 GB VPS, with Ollama alone on the machine.
* **7B to 8B parameters:** the file is around 4 to 5 GB. Think 8 GB of RAM at the very least, to leave room for context and let the rest of the system breathe.
* **Above 8B:** it already takes 16 GB or more and CPU speed drops to the point of being annoying. For that size, consider a GPU.

If the model does not fit in RAM, the system starts using swap and speed collapses. The [swap guide](https://streethosting.com.br/en/guides/vps/set-up-swap-ubuntu-vps) helps keep the process from being killed for lack of memory, but swap is not a way to run a large model: it is a safety net.

## What sets the speed[](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#velocidade)

Generating text with a language model means that, for every new word, almost all of the model weights are read from memory. That makes **memory bandwidth** the factor that weighs the most: how fast the RAM delivers data to the cores. A smaller model has less to read for each word, so it answers faster.

**CPU cores** come second. More cores help mainly with reading your input text (the prompt) and with the computation itself. Fast memory, such as DDR5, also helps compared with DDR4. More aggressive quantization (fewer bits) makes the model smaller and faster, with a quality drop that grows the fewer bits you use.

There is no single words per second figure that holds for everyone, because it depends on the model, the quantization, the prompt size and the machine. The honest way to know is to measure your own case: the command `ollama run MODEL_NAME --verbose` prints statistics at the end of the answer, including the generation rate. Test two or three models with a typical text from your use and pick the smallest one that delivers the quality you need.

Run the test with the VPS idle, with no other heavy services. Use the [guide to checking CPU, RAM and disk on Linux](https://streethosting.com.br/en/guides/vps/check-cpu-ram-disk-network-linux) to watch consumption while the model answers.

## Install and run the first model[](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#instalar)

On Ubuntu, the official installer creates the binary and a systemd service that starts Ollama with the server. Run it as a user with sudo:

`curl -fsSL https://ollama.com/install.sh | sh ollama --version systemctl status ollama`

The script downloads and runs code as root, so it is worth reading its contents first if that worries you. With the service active, download and open a conversation with a small model:

`ollama run llama3.2:3b # type the question, and /bye to leave ollama list # downloaded models ollama ps # models loaded right now ollama stop llama3.2:3b ollama rm llama3.2:3b`

The first time, the command downloads the model, which can take a few minutes, and then opens the interactive prompt. Other popular small models in the library include variants of Qwen, Gemma and Phi; the exact name and tag (for example the parameter count after the colon) are on each one's page. Models live on disk, so check the free space before downloading several.

## Use the API on port 11434[](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#api)

Besides the terminal, Ollama starts an HTTP API on port 11434, which is what applications and automations use. By default it listens on `127.0.0.1`, so only programs inside the VPS itself can call it. Test it like this:

`curl http://127.0.0.1:11434/api/generate -d '{ "model": "llama3.2:3b", "prompt": "Summarize in one sentence: VPS servers use KVM virtualization.", "stream": false }'`

There is also the `/api/chat` endpoint for conversations with history. Two variables are worth knowing. `OLLAMA_KEEP_ALIVE` sets how long the model stays in memory after the last use (the default is 5 minutes); keeping it loaded avoids the wait of loading on every call, at the cost of the RAM it holds. And `OLLAMA_NUM_PARALLEL` controls how many requests the same model serves together, defaulting to 1. Raising it uses more memory and splits the CPU among the requests.

To set a variable on the service, use a systemd override:

`sudo systemctl edit ollama.service # in the editor, add: [Service] Environment="OLLAMA_KEEP_ALIVE=30m" sudo systemctl daemon-reload sudo systemctl restart ollama`

## Reach it from outside without opening the port[](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#expor)

Ollama's API has no user or password. Whoever reaches port 11434 uses your server for free, burns your CPU and can download or delete models. Do not set `OLLAMA_HOST` to 0.0.0.0 and leave the port open in the firewall.

There are two safe ways to call the API from your computer or from another server. The simplest is the **SSH tunnel**, which forwards a local port to the VPS port using the connection you already have. On your computer:

`ssh -N -L 11434:127.0.0.1:11434 user@VPS_IP # in another terminal, on your computer: curl http://127.0.0.1:11434/api/tags`

The second is a **reverse proxy with a password**, useful when an application elsewhere has to call the API without a tunnel. Nginx sits in front, asks for a user and password and passes the request on to 127.0.0.1:11434. The basics of the proxy are in the [Nginx reverse proxy guide](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps); here is the part that changes:

`sudo apt install -y apache2-utils sudo htpasswd -c /etc/nginx/.htpasswd-ollama myuser # inside the server block of your HTTPS site: location / { auth_basic "Ollama"; auth_basic_user_file /etc/nginx/.htpasswd-ollama; proxy_pass http://127.0.0.1:11434; proxy_set_header Host localhost:11434; proxy_read_timeout 300s; proxy_buffering off; }`

The high `proxy_read_timeout` keeps long answers from being cut off, and `proxy_buffering off` lets the answer arrive in pieces as it is generated. Always use HTTPS together with the password, or it travels unprotected: the [Let's Encrypt SSL certificate guide](https://streethosting.com.br/en/guides/vps/lets-encrypt-ssl-certificate-vps) covers that step. If your client also needs an access key, a small application in front of the API does the job, and the rest of the server stays protected by [secure SSH](https://streethosting.com.br/en/guides/vps/secure-ssh-linux-vps).

## Where to run this at StreetHosting[](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#onde-rodar)

A language model on CPU needs fast memory and CPU, and root access to install the service and adjust systemd. On StreetHosting VPS plans the virtualization is KVM, with root, a dedicated IPv4, AntiDDoS included and servers in São Paulo. They have no GPU, so what we describe here applies to small models.

The Ryzen 9 9950X VPS uses DDR5 memory, which helps generation speed, and goes from 2 GB up to 64 GB of RAM, covering everything from a 1B model to 8B ones with room to spare. It starts at R$ 43.00 per month and uses NVMe, good for storing several models. The Xeon VPS, with 2 vCPU and 2 GB of DDR4 for R$ 26.00, is enough to try a 1B model, with no room for the larger ones. Check the [Ryzen VPS page](https://streethosting.com.br/en/vps/ryzen) to see the available configurations before choosing the memory.

In this guide

* [What to expect from a CPU-only model](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#expectativas)
* [How much RAM each model needs](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#ram)
* [What sets the speed](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#velocidade)
* [Install and run the first model](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#instalar)
* [Use the API on port 11434](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#api)
* [Reach it from outside without opening the port](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#expor)
* [Where to run this at StreetHosting](https://streethosting.com.br/en/guides/vps/run-ollama-llm-vps-cpu#onde-rodar)

## Frequently asked questions

Can you run a language model on a VPS without a GPU?

Yes, with small quantized models of 1B to 8B parameters. The VPS uses only the CPU and RAM, so answers come out slower than on a graphics card. For summaries, classification and internal use with a few people it works well. For many simultaneous users or large models, you need a GPU.

How much RAM do I need to run a model on Ollama?

As a rough rule, add the size of the quantized model file to 1 or 2 GB of headroom for the context and the system. A 3B parameter model at 4-bit quantization takes around 2 GB on disk and in memory. The exact size of each model is on its page at ollama.com/library.

Is Ollama's port 11434 open to the internet?

Not by default. Ollama listens only on 127.0.0.1, so only the VPS itself can see the API. It becomes exposed only if you change the OLLAMA\_HOST variable to 0.0.0.0. Because the API has no authentication, keep it on 127.0.0.1 and reach it through an SSH tunnel or an Nginx with a password.

Does Ollama replace ChatGPT or a GPU?

No. Models of 1B to 8B running on CPU are good for light, repetitive tasks, but they answer with lower quality and more slowness than large hosted models. They suit people who want data privacy, predictable cost and internal automations, not those who want to compete with the largest ones.

Does Ollama keep using memory after I am done?

The model stays loaded for 5 minutes after the last request and is then unloaded. You change that with the OLLAMA\_KEEP\_ALIVE variable or with the keep\_alive parameter on each API call. With ollama stop MODEL\_NAME the model leaves memory right away.

Next step

See Ryzen VPS

Ryzen 9 9950X VPS in São Paulo with root access, NVMe and gamer Anti-DDoS.

[See Ryzen VPS](https://streethosting.com.br/en/vps/ryzen)

[See VPS plans Root VPS in Brazil with NVMe and Anti-DDoS.](https://streethosting.com.br/en/vps)

## Related guides

[VPS Beginner How to check CPU, RAM, disk and network usage on Linux When a VPS slows down, each right command rules out one hypothesis. Here is a one-minute checklist and how to read load average, available memory, disk latency and network connections. 10 min Read guide](https://streethosting.com.br/en/guides/vps/check-cpu-ram-disk-network-linux) [VPS Intermediate How to set up Nginx as a reverse proxy on a VPS Your app runs on an internal port and you want to serve it on a domain with HTTPS. Nginx as a reverse proxy solves that and also brings several apps together in one place. 3 min Read guide](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps) [VPS Intermediate How to set up swap on Ubuntu on a VPS Swap does not replace RAM, but it helps during peaks and can keep services from crashing when memory runs out. 2 min Read guide](https://streethosting.com.br/en/guides/vps/set-up-swap-ubuntu-vps)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
