9 min read ·
Ollama on a GPU server: install, API and Open WebUI
Ollama on a GPU server: install on Linux and in Docker, pull and run, the OpenAI-compatible API, Open WebUI, Ollama versus vLLM and which GPU fits each model size.

Ollama is a program that downloads and runs open language models (Qwen, Llama, Gemma, DeepSeek and others) with one command and gives you a chat and an API. For answers to arrive quickly the model needs a graphics card, which is why Ollama is handy on a GPU server. The easiest route is the Open WebUI + Ollama template on gpu.nz: everything is installed, and you pay only for the minutes the server runs. Below is how it works and how to install Ollama yourself.
What Ollama is and why it needs a GPU
Ollama handles downloading the model, quantising it (compressing the weights) and running it. Small models run on a processor, but slowly, while a graphics card speeds up answers many times over. The key condition is that the model's weights must fit entirely into video memory, otherwise some layers spill into system memory and everything slows down. The memory arithmetic is in the VRAM guide.
Installing Ollama on Linux and in Docker
On your own Linux computer or server with an NVIDIA driver, installation is one command. The script installs Ollama and starts it as a system service:
curl -fsSL https://ollama.com/install.sh | sh
ollama --versionIf you work with Docker and have the NVIDIA Container Toolkit, you can run Ollama as a container; the volume keeps downloaded models from disappearing:
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollamaOn a rented gpu.nz server you install nothing: the Open WebUI + Ollama template starts both services itself, and you enter the model name at launch.
Main commands and ports
| Command or port | What it does |
|---|---|
| ollama pull qwen3:8b | Downloads a model |
| ollama run qwen3:8b | Opens a chat with the model in the terminal |
| ollama list | Shows downloaded models |
| ollama ps | Shows which models are loaded into memory right now |
| ollama rm qwen3:8b | Deletes a model from disk |
| ollama serve | Starts the API server |
| port 11434 | The Ollama API |
| port 8000 | The vLLM API, if you run it |
The Ollama API and the OpenAI-compatible /v1
The API listens on port 11434. By default it is reachable only on the server itself; to open it outward in a manual install, set the OLLAMA_HOST environment variable. Do not expose the API to the internet unprotected: anyone could run jobs on your graphics card. On gpu.nz the protection is already there, described below. A check from the server itself:
curl http://localhost:11434/api/generate -d '{"model":"qwen3:8b","prompt":"Hello","stream":false}'From your own app, call the API through the protected «Ollama API» link on the server page: an address like https://<id>-11434.run.gpu.nz, with the access token from the same page as the key. Without the token the API does not answer, so the model is not open to the whole internet. The /v1 endpoint is OpenAI-compatible, so any OpenAI SDK client works:
curl https://<id>-11434.run.gpu.nz/v1/chat/completions \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{"model":"qwen3:8b","messages":[{"role":"user","content":"Hello"}]}'If you prefer not to use the link, forward the port over SSH, and the API is reachable only on your own computer:
ssh -L 11434:localhost:11434 <user>@<server address> -p <port>Open WebUI: a ChatGPT-style chat
Open WebUI is a web interface for Ollama with chat history, model switching and file uploads. In the gpu.nz template it is already connected to Ollama: an «Open the chat» button appears on the server page, and no separate sign-up is needed because the link is protected by your rental token. In a manual install, Open WebUI runs as its own container and you point it at the Ollama address.
Ollama or vLLM: when to switch
| Ollama | vLLM | |
|---|---|---|
| Start | One command, models from the Ollama library | You name a Hugging Face model and set parameters |
| Model formats | Quantised GGUF, low memory | Hugging Face weights, including quantised AWQ, GPTQ and FP8 |
| Load | One user or a small team | Many simultaneous requests, batching |
| API | Its own API and /v1 | An OpenAI-compatible server |
| Take it for | Chat, tests, personal tasks, prototypes | A production service under load |
Start with Ollama. Move to vLLM when requests pile up and speed is limited by queue handling. The vLLM template starts the API on port 8000 with Qwen2.5-7B-Instruct, and the key is your rental's token. The first start takes longer: the model downloads and compiles, and the server page tells you when the API is ready. To serve another model, restart it over SSH and cap the context with --max-model-len:
vllm serve Qwen/Qwen2.5-14B-Instruct --port 8000 --api-key <token> --max-model-len 8192OpenAI SDK clients work unchanged: base_url is https://<id>-8000.run.gpu.nz/v1 (the link on the server page) and api_key is the same token.
Which graphics card for which model
| Model | Weights, roughly | Video memory | Example cards |
|---|---|---|---|
| 8B | about 5 GB | 8–12 GB | an RTX 3090 with room to spare |
| 14B | about 9 GB | 16 GB | an RTX 4090 |
| 32B | about 20 GB | 24 GB | RTX 3090 and RTX 4090 24 GB |
| 70B | about 43 GB | 48 GB and more | L40S 48 GB, A100 80 GB |
Context takes extra memory, so for long documents pick a card with headroom. Which models to choose is covered in the best Ollama models guide.
Common mistakes
- The model does not fit: shorten the context, use a quantised build, or pick a bigger card.
- The API answers 401: send the token from the server page in the Authorization: Bearer header.
- The download is slow: large models are tens of gigabytes. Run pull inside screen or tmux.
- Answers are slow: ollama ps shows whether part of the model moved to the processor.
Stop the server when you are done. The disk holding the model is billed while the server is stopped, so delete what you do not need.
Questions and answers
- What is Ollama?
- A program for running open language models on your own computer or server: it downloads a model with one command and gives you a chat and an API.
- Do I need a graphics card for Ollama?
- It works without one, but answers are slow on a processor. For comfortable speed you need a graphics card that fits the model's weights.
- How is Ollama Cloud different from Ollama on my own GPU server?
- Ollama Cloud is a hosted service from Ollama itself. On gpu.nz you run regular Ollama on a rented graphics card: the model and data stay on your server, and you pay for the minutes it runs.
- How do I connect to Ollama over the API?
- Use the protected «Ollama API» link on the server page and the rental token in the Authorization header. The /v1 address is OpenAI-compatible.
- Why choose vLLM over Ollama?
- vLLM handles many simultaneous requests faster and gives an OpenAI-compatible server, so it is taken for load. Ollama is easier to start and lighter on memory.
- Which graphics card does a 70-billion-parameter model need?
- In Q4 quantisation the weights take about 43 GB, so you need a card with 48 GB or more, such as an L40S, or an A100 or H100 with 80 GB.