AI Infrastructure·8 min read·

Ollama on Ubuntu: Install, Pull, and systemd

Install Ollama on Ubuntu 24.04, pull a small 3B GGUF-backed model, and run it under systemd on an Intel Xeon Platinum CPU VPS without a GPU.

NB

Netbay Developer Relations

Netbay Engineering

On this page

Ollama is the shortest path from a fresh Ubuntu VPS to a local chat model. It wraps llama.cpp, stores GGUF weights under its own directory, and exposes a REST API on localhost. It does not magically create VRAM. Netbay VPS plans are Intel Xeon Platinum CPU machines with High-Speed SSD in Lucknow, not GPU hosts. Pull a 3B or 7B Q4-class tag, not a 70B blob, and keep the process under systemd so a reboot does not leave you SSH-ing in to start it by hand.

Install the official package, then pin RAM expectations

The installer drops a systemd unit named ollama, a user, and a binary on PATH. Read the script or pin a release if your policy forbids curl-pipe-to-shell. After install, confirm the service is active and bound to 127.0.0.1:11434.

bash
curl -fsSL https://ollama.com/install.sh | sh
systemctl status ollama --no-pager
ss -lntp | grep 11434
ollama --version
free -h

If the unit is missing, the install did not finish. If port 11434 is open on 0.0.0.0, lock it down before you pull models; Ollama is not an authentication layer. An 8 GB VPS should show roughly 7.5 GB after the OS. Leave a gigabyte free. A 7B Q4 model will consume most of what remains once the KV cache grows.

Ollama will happily start a pull that cannot fit. The process then gets OOM-killed mid-load. That looks like a crash loop in journalctl, but it is RAM math. Check the tag size on the library page before you pull.

Pull a small model and smoke-test generate

Prefer 3B tags on 4–8 GB. Llama 3.2 3B and Phi-class 3B tags are the usual starting points. A 7B or 8B Q4 tag can work on 8 GB if nothing else is hungry. Skip anything advertised as 13B or 70B on this class of VPS.

bash
ollama pull llama3.2:3b
ollama list
ollama run llama3.2:3b "Reply with two sentences on systemd Restart=always."
curl -s http://127.0.0.1:11434/api/generate   -d '{"model":"llama3.2:3b","prompt":"Ping","stream":false}'

The CLI run is interactive. The curl call is what you will script. stream false returns one JSON object so you can measure latency. First-token time includes mmap from High-Speed SSD; later prompts are faster if the weights stay resident. If generate hangs then dies, run dmesg | tail and look for Out of memory.

Keep one model loaded. Ollama can keep weights in memory after a run. That is useful for a private tool and fatal if you pull three 7B tags on 8 GB. Remove unused models with ollama rm when you change your mind.

systemd: enable, environment, and a restart policy

The packaged unit is enough for a single-user box. Enable it so it starts on boot. Override the environment if you need a different host bind, a model directory on a larger disk, or fewer parallel slots. Do not raise parallelism on a RAM-limited VPS; one in-flight generate is the honest default.

ini
# /etc/systemd/system/ollama.service.d/override.conf
[Service]
Environment=OLLAMA_HOST=127.0.0.1:11434
Environment=OLLAMA_MODELS=/var/lib/ollama/models
Environment=OLLAMA_NUM_PARALLEL=1
Environment=OLLAMA_MAX_LOADED_MODELS=1
Restart=on-failure
RestartSec=5

Then run systemctl daemon-reload and systemctl enable --now ollama. Confirm the override with systemctl cat ollama. Logs live in journalctl -u ollama -f. If the service flaps, it is usually an OOM or a missing model directory. Create /var/lib/ollama/models, chown it to the ollama user, and try again.

Do not put Ollama on a public interface and call it production. Put nginx in front, or keep it on a tailnet, or SSH-tunnel from your laptop. The local API has no user accounts.

Ollama on Ubuntu under systemd apt + install.sh binary on PATH systemd unit enable --now 127.0.0.1:11434 REST generate API ollama pull 3B Q4-class GGUF Xeon Platinum CPU weights stay in RAM NUM_PARALLEL=1 and MAX_LOADED_MODELS=1 on 8 GB. Do not pull 70B. Lucknow CPU VPS · High-Speed SSD · systemd

Operations that bite people

Models live under /usr/share/ollama or /var/lib/ollama depending on version. Back them up if the download was expensive on your link; otherwise just pull again. Disk is High-Speed SSD, so copies are fast, but a 7B GGUF is still several gigabytes. Do not fill the root filesystem. Put OLLAMA_MODELS on a volume with room.

Upgrades replace the binary. Pin a version in production if a new default tag changes prompt behaviour. After an upgrade, run ollama list and one generate before you walk away.

If you outgrow CPU tokens per second, Ollama will not grow a GPU for you on this host. Move the large-model traffic to a remote API and keep the VPS for small local jobs: classification, drafting, and tools that tolerate a few tokens per second.

Takeaway

Install, pull a 3B Q4-class model, bind to localhost, and let systemd own the process. Treat RAM as the product limit. Ollama is a local runtime, not a managed inference platform, and a CPU VPS is the right home for small GGUF models only.

Spin up Ubuntu 24.04 on Netbay in under 60 seconds, install Ollama, and pull a 3B tag on Intel Xeon Platinum — netbayhosts.in.

Keep reading

Follow along on a real VPS

Deploy Linux in under 60 seconds

These guides are written against Ubuntu, Debian, and RHEL-family images — the same ones on NetBay.

Deploy an instance