OrbitHost
AI

Ollama on Ubuntu VPS: Install, Models, and API

Install Ollama on Ubuntu 24.04, pull models, expose the API behind a firewall or reverse proxy, and size RAM for EU self-hosted LLM inference.

By Noah Keller · Developer Advocate9 min read
Author
Noah Keller
Developer Advocate

Noah writes practical guides for Next.js deploys, AI self-hosting (Ollama, n8n), and PaaS panels like Coolify and Dokploy. His focus is getting apps from git clone to HTTPS with the fewest moving parts.

Why Ollama on a VPS

Ollama wraps model download, quantization-friendly defaults, and a local HTTP API. On a European VPS you get a private endpoint for apps, n8n, and OpenClaw-style agents.

OrbitHost `/vps-for-ollama` plans are the same KVM NVMe lineup — pick RAM for the models you actually pull.

Native install on Ubuntu 24.04

The official install script places the `ollama` service on systemd. Review it or install from release artifacts if you require air-gapped policies.

sudo apt update && sudo apt install -y curl
curl -fsSL https://ollama.com/install.sh | sh
sudo systemctl enable --now ollama
ollama --version

Pull and run a model

Pulls land under Ollama’s data directory and can consume many GB. Watch `df -h` on NVMe before downloading multiple 10GB+ tags.

ollama pull llama3.2
ollama run llama3.2

# non-interactive generate via API (localhost)
curl http://127.0.0.1:11434/api/generate -d '{
  "model": "llama3.2",
  "prompt": "Explain NVMe in one sentence",
  "stream": false
}'

Docker alternative

If you already standardized on Compose, run the official image and mount a volume for model storage so pulls survive container recreation.

services:
  ollama:
    image: ollama/ollama:latest
    ports:
      - "127.0.0.1:11434:11434"
    volumes:
      - ollama:/root/.ollama
    restart: unless-stopped
volumes:
  ollama:

Exposing the API safely

Prefer SSH tunnels or WireGuard for admin access. For HTTPS public access, reverse-proxy with basic auth or SSO and rate limits.

Set environment variables on the systemd unit if you must listen on a specific interface — then firewall everything else.

  • Keep 11434 off the public internet by default
  • Proxy only if clients cannot use VPN
  • Monitor disk for model growth
  • Pin model names in app configs

Performance notes on Ryzen CPU

Token generation on CPU is sensitive to threads and RAM bandwidth. Close competing JVMs/game servers on the same box. NVMe helps model load times more than steady-state decode.

For agent stacks, pair Ollama with our n8n and OpenClaw guides rather than stuffing every experiment on one Nano plan.

Backup and migration

Back up the Ollama data directory if custom Modelfiles matter. Apps should treat model tags as infrastructure-as-code so a new VPS can `ollama pull` to rebuild.

FAQ

Should I bind Ollama to 0.0.0.0?

Only behind auth/TLS or a private network. Default localhost is safer. If you expose the API publicly, put Nginx/Caddy with auth in front or restrict by WireGuard.

Docker or native install?

Both work. Native install is simple on a dedicated model host. Docker helps if the VPS already runs Compose for the rest of your stack.

Which model to start with?

Start small (e.g. llama3.2 or similar lightweight tags) to validate RAM and latency, then pull larger quants once metrics look good.

GPU required?

No for small models on CPU. GPUs help throughput and larger models. Many personal EU assistants run quantized models on Ryzen VPS CPU today.

Ready to Launch?

Create your server today.