# How to run your own LLM on a GPU server

> How to run your own LLM on a GPU server: NVIDIA drivers, Ollama or vLLM, and a private OpenAI-compatible API endpoint with safe remote access.

Source: https://lowcostserv.com/guides/run-an-llm-on-a-gpu-server · Publisher: LowCostServ (lowcostserv.com) · Prices in US dollars, as published on November 26, 2026.

From a fresh GPU server to a private, OpenAI-compatible endpoint: drivers, a model server, and safe remote access.

By LowCostServ · Updated November 12, 2026 · 4 min read

This guide takes a freshly delivered GPU server to a private, OpenAI-compatible endpoint that your own applications can call. It covers two model servers: Ollama, the quickest route to a working model, and vLLM, the one to choose when many requests arrive at once. Commands assume Ubuntu 24.04 with NVIDIA drivers installed, and `203.0.113.10` as the server address.

## 1. Check the GPU

Log in over SSH and run:

```
nvidia-smi
```

You should see your card, its total memory and no running processes. If the command is missing, the drivers are not installed: reinstall the server with the image that includes them.

## 2. Choose a model that fits

Parameters in billions × bytes per weight × 1.2 must be below the card’s VRAM. At 4-bit a weight takes about 0.6 byte, so a 32 GB card holds up to about 40B parameters, less with a long context. The method is explained in [How much VRAM do you need to run an LLM?](https://lowcostserv.com/guides/how-much-vram-for-llms)

## 3. Option A: Ollama

Ollama downloads quantized models and serves them with one command. Install it:

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

Pull a model and talk to it. Replace the name with any model from the Ollama library:

```
ollama run llama3.2
```

Ollama also runs as a service and listens on `127.0.0.1:11434`. It speaks the OpenAI API format:

```
curl http://127.0.0.1:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model": "llama3.2", "messages": [{"role": "user", "content": "Say hello in five words."}]}'
```

## 4. Option B: vLLM

vLLM batches concurrent requests on the GPU, which makes it far more efficient when several users or jobs call the model at the same time. Run it from its official container; Docker and the NVIDIA container toolkit are part of our GPU image, and need installing first anywhere else. Replace the model with the Hugging Face repository you want:

```
docker run -d --name vllm --restart unless-stopped --gpus all --ipc=host \
  -p 127.0.0.1:8000:8000 \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  vllm/vllm-openai:latest \
  --model Qwen/Qwen2.5-7B-Instruct \
  --api-key CHANGE-THIS-KEY
```

The first start downloads the weights. Follow it with `docker logs -f vllm`, then test:

```
curl http://127.0.0.1:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer CHANGE-THIS-KEY" \
  -d '{"model": "Qwen/Qwen2.5-7B-Instruct", "messages": [{"role": "user", "content": "Say hello in five words."}]}'
```

This model is loaded at 16-bit and needs about 17 GB: it fits a 32 GB card and larger. On a 16 GB card, pick a smaller model or a quantized repository.

Some models require you to accept a license on Hugging Face first; in that case add a line `-e HF_TOKEN=your_token \` before the line of the image, `vllm/vllm-openai:latest`. With several GPUs, add `--tensor-parallel-size 2` (or 4) after `--model` to spread the model across them.

## 5. Keep the endpoint private

Both commands above bind the API to `127.0.0.1`, so it is reachable only from the server itself. That is deliberate: an open model endpoint on the internet is found and abused within hours. Two safe ways to use it from elsewhere:

### An SSH tunnel, for yourself

On your own computer:

```
ssh -N -L 8000:127.0.0.1:8000 root@203.0.113.10
```

While that command runs, `http://127.0.0.1:8000` on your computer is the server’s endpoint, encrypted through SSH. Use port 11434 for Ollama.

### A reverse proxy with HTTPS, for applications

Put Nginx in front, with a certificate, and make it require the key. Install Nginx and the certificate as in [Host a website on a VPS with Nginx and free HTTPS](https://lowcostserv.com/guides/host-a-website-with-nginx), then use this block for the application. vLLM checks the key itself; Ollama has no key, so Nginx must check it:

```
    location / {
        if ($http_authorization != "Bearer CHANGE-THIS-KEY") { return 401; }
        proxy_pass http://127.0.0.1:11434;        # 8000 for vLLM
        proxy_set_header Host localhost:11434;    # Ollama refuses other host names
        proxy_buffering off;
        proxy_read_timeout 600s;
    }
```

Keep the key long and secret, and test from another machine that a request without it is answered 401.

## 6. Point your code at it

Any library that speaks the OpenAI API works by changing the base URL:

```
from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="CHANGE-THIS-KEY")
reply = client.chat.completions.create(
    model="Qwen/Qwen2.5-7B-Instruct",
    messages=[{"role": "user", "content": "Summarize this in one sentence: ..."}],
)
print(reply.choices[0].message.content)
```

## 7. Watch it work

```
watch -n 1 nvidia-smi
```

Memory used should sit below the card’s total with a little room to spare, and GPU utilization should rise while requests run. If loading fails with an out-of-memory error, choose a smaller model, a lower precision or a shorter maximum context.

## 8. Keep it running

An endpoint is only useful if it survives a reboot. The command of step 4 carries `--restart unless-stopped`, so the container comes back by itself; for a container created without it, run `docker update --restart unless-stopped vllm`. Ollama already runs as a system service.

Our GPU servers are billed by the month at a flat price, with no meter on GPU time or bandwidth, so there is nothing to gain by switching the model off at night. Plans and prices: [GPU servers](https://lowcostserv.com/gpu-servers) and [LLM hosting](https://lowcostserv.com/llm-hosting).

## Sources and further reading

- [Ollama documentation: FAQ](https://docs.ollama.com/faq)
- [Ollama documentation: OpenAI compatibility](https://docs.ollama.com/api/openai-compatibility)
- [vLLM documentation: Using Docker](https://docs.vllm.ai/en/stable/deployment/docker/)
- [vLLM documentation: Quickstart](https://docs.vllm.ai/en/stable/getting_started/quickstart/)

**Put it into practice**

- [**LLM hosting**: Private GPU servers for open models.](https://lowcostserv.com/llm-hosting)
- [**RTX 5090 servers**: 32 GB of VRAM, whole card, flat monthly price.](https://lowcostserv.com/gpu-servers/rtx-5090)

**Keep reading**

- [**Your access key: an account with no email or password**: Getting started · 4 min read](https://lowcostserv.com/guides/access-key)
- [**How to connect to a Linux server with SSH**: Getting started · 3 min read](https://lowcostserv.com/guides/connect-to-a-server-with-ssh)
- [**How to secure a new Linux server in 15 minutes**: Security · 4 min read](https://lowcostserv.com/guides/secure-a-new-linux-server)

## Read next Two guides to follow this one.

[All GPU and AI guides](https://lowcostserv.com/guides/topic/gpu)

- [Monthly vs hourly GPU rental: where the break-even is](https://lowcostserv.com/guides/monthly-vs-hourly-gpu-rental): The formula that decides between a flat month and an hourly meter, with our prices spread over 730 hours and worked examples. (GPU and AI, 5 min read, Nov 12, 2026)
- [How much VRAM do you need to run an LLM?](https://lowcostserv.com/guides/how-much-vram-for-llms): A sizing rule you can do in your head: parameters, quantization and context, with worked examples from 16 to 288 GB. (GPU and AI, 3 min read, Nov 12, 2026)

## A whole GPU, one flat monthly price.

GPU servers from $165 a month, at a flat price: no meter on hours or bandwidth.

- **No KYC**: No email, no ID
- **No DMCA**: Notices not acted on
- **Crypto friendly**: BTC, ETH, XMR, USDT, SOL
- **Unmetered**: On every plan

---

LowCostServ rents cloud VPS, dedicated servers, GPU servers and Windows RDP servers and registers domain names, with no identity check and payment in crypto. Every plan and price: https://lowcostserv.com/pricing.md · The company in facts: https://lowcostserv.com/about.md · Index of the site for language models: https://lowcostserv.com/llms.txt
