...
Skip to main content
Print

How to Install Ollama on a VPS: Your Own AI Server

With Ollama you run AI language models such as Llama, Mistral and Qwen on your own VPS. You install Ollama with one command, download a model and talk to it via the terminal, an API or a chat interface. Your data stays on your own server in Amsterdam and you do not pay per request. Ideal for privacy-sensitive applications and automations with n8n, for example.

How much memory do you need?

On a VPS without a graphics card, small models run best. Count on about 8 GB of RAM for a model of up to 7 billion parameters, and 16 GB for larger models. An NVMe VPS loads models quickly from disk.

Step 1: install Ollama

curl -fsSL https://ollama.com/install.sh | sh

Step 2: download and start a model

ollama pull llama3.2
ollama run llama3.2

Choose another model on ollama.com/library if you want. Close the chat with /bye.

Step 3: add a chat interface with Open WebUI

Open WebUI gives you a chat environment in the browser. You install it with Docker:

docker run -d -p 127.0.0.1:3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

Make the interface reachable via your domain with an Nginx reverse proxy and HTTPS.

Using Ollama via the API

curl http://localhost:11434/api/generate -d '{"model": "llama3.2", "prompt": "Wat is een VPS?"}'

Secure access

The Ollama API has no password. So never open port 11434 to the internet. Use an SSH tunnel or a reverse proxy with login if you want to use the API from outside.

Related articles

Table of Contents