DeepSeek-R1 can run on a VPS through Ollama when the model size matches the server. The mistake is choosing the largest model first. Start with a smaller distilled model, confirm memory usage, keep the Ollama API private and move to GPU or dedicated hardware only when the workload truly needs it.
Yes, smaller DeepSeek-R1 distilled models can run on a suitable CPU VPS with Ollama. The practical choice for many VPS users is to test a smaller tag first, then move up only if RAM, disk and response time are acceptable. Larger models can require much more memory and may be slow on CPU-only hosting. For heavier inference, use GPU infrastructure or dedicated AI hardware instead of forcing a large model onto a small VPS.
This guide is for Ubuntu or Debian-style VPS environments. Commands and model tags can change, so verify the current DeepSeek-R1 tags on the official Ollama DeepSeek-R1 library page before installing.
Model size is the first decision. A VPS that is comfortable for a small distilled model may be a poor fit for a larger one. The table below is practical planning guidance, not a fixed benchmark. Actual memory use depends on quantization, context length, concurrent users and the way the model is served. Plan disk space as well: model files can consume multiple GB, and larger tags can consume much more than a small first test.
| DeepSeek-R1 class | Practical VPS use | RAM planning | Notes |
|---|---|---|---|
| 1.5B class | Basic testing, small prompts, low-cost private experiments | 4 GB+ can be enough for light use | Good first test when you only need to confirm the setup. |
| 7B or 8B class | Private assistant, coding tests, single-user API, small agent workflows | 8 to 16 GB is a more realistic range | Practical starting point for many CPU VPS users. |
| 14B class | Better reasoning quality with slower CPU inference | 16 to 32 GB is safer | Do not assume it will feel fast on a small VPS. |
| 32B class | Advanced testing with high memory and patience | 48 to 64 GB+ is usually more realistic | Consider dedicated hardware or GPU options. |
| 70B and larger | Serious local inference, research or production workloads | Large RAM/GPU planning required | Usually not a normal low-cost VPS workload. |
For a broader sizing discussion, use the Voxfor guide to VPS specs for Ollama and local LLMs. If the model needs GPU acceleration, compare GPU servers, cloud GPU and hybrid GPU options before choosing the hosting path.
Before installing Ollama, make sure the server is ready. This guide assumes SSH access, a non-root admin user where possible and an Ubuntu or Debian-based VPS with enough RAM for the model you choose.
For Voxfor users choosing a server, start with Voxfor VPS plans for smaller models and private tests. If the project is part of an persistent AI workflow, also review AI Agent VPS hosting.
Connect to the VPS and update the system packages first:
ssh your-admin-user@your-server-ip
sudo apt update
sudo apt upgrade -y
Install Ollama from the official Linux installer:
curl -fsSL https://ollama.com/install.sh | sh
Confirm the install and service status:
ollama --version
sudo systemctl status ollama --no-pager
The Ollama Linux installer normally sets up a local service. If your environment behaves differently, use the official Ollama Linux download instructions as the source of truth.
For a first VPS test, do not start with a heavy model. Choose a smaller tag that fits the server. This example uses an 8B class tag because it is more realistic than starting with 14B or 32B on many CPU VPS plans:
ollama pull deepseek-r1:8b
ollama run deepseek-r1:8b
If the server has limited RAM, try a smaller tag from the official Ollama library page. If the model is too slow or the process is killed by the system, reduce model size before upgrading random settings.
Test the local API from the server itself:
curl -s http://127.0.0.1:11434/api/generate -d '{"model":"deepseek-r1:8b","prompt":"Explain what a VPS is in one paragraph.","stream":false}'
This confirms that Ollama is responding locally. It does not mean the API should be public.
If you need a Python client, use a virtual environment instead of installing packages globally:
sudo apt install -y python3-venv
python3 -m venv ~/ollama-client
source ~/ollama-client/bin/activate
pip install ollama
Create a small test file:
nano deepseek_test.py
Add this example:
import ollama
response = ollama.chat(
model="deepseek-r1:8b",
messages=[
{"role": "user", "content": "Give me a short VPS security checklist."}
],
)
print(response["message"]["content"])
Run it:
python deepseek_test.py
Ollama is useful on a VPS because you can keep the model close to your private workflows. That privacy disappears if you expose the API to the public internet without controls. In most setups, keep Ollama listening locally and connect through SSH tunneling, a private network or a properly authenticated reverse proxy.
For a private SSH tunnel from your local computer:
ssh -L 11434:127.0.0.1:11434 your-admin-user@your-server-ip
Then call http://127.0.0.1:11434 from your local machine while the tunnel is open. Do not open port 11434 to the world just because a tool needs remote access.
A basic firewall posture for a private test server is simple. Before enabling UFW on a remote VPS, confirm that OpenSSH is allowed and keep your current SSH session open until you verify you can reconnect.
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status
If you later add a web UI or public application, expose only the web layer that has authentication and TLS. Keep the model runtime itself private where possible.
Some users want a private chat interface on top of Ollama. In that case, do not improvise a public port with no authentication. Follow a structured setup using Docker Compose, persistent volumes, authentication and a reverse proxy where needed. The Voxfor guide to running Open WebUI on a VPS covers that path. If you are still deciding how to structure containers, read Docker vs Docker Compose on a VPS.
| Problem | Likely cause | What to do |
|---|---|---|
| Model download is slow or fails | Large model files, network interruption or low disk space | Check disk space, retry, or start with a smaller tag. |
| Process is killed during inference | Out-of-memory condition | Use a smaller model, add RAM or move to GPU/dedicated infrastructure. |
| Responses are very slow | CPU-only inference on a larger model | Use 1.5B/7B/8B class first or use GPU infrastructure. |
| Remote client cannot connect | API is local-only or firewall blocks access | Use SSH tunnel or secure reverse proxy rather than opening Ollama publicly. |
| Server becomes unresponsive | Model consumes too much RAM/CPU | Stop the model, review top or htop, and reduce model size. |
For monitoring during tests, check memory, disk and running model state before opening the model to users:
free -h
df -h
ollama ps
sudo apt install -y htop
htop
A CPU VPS is useful for private experiments, smaller models, single-user tools and agent workflows. It is not the right answer for every DeepSeek workload. If you need many concurrent users, long context, larger models, low latency or steady production inference, plan for GPU or dedicated hardware instead of forcing the workload onto a small VPS.
For broader deployment planning, compare cloud VPS hosting, AI agent hosting and GPU infrastructure before committing a larger model to production use.
If you are new to DeepSeek-R1 on a VPS, start with a smaller Ollama tag, keep access private and measure memory before adding a UI or users. If the workload needs a larger model, multiple users or production availability, choose the hosting layer first: Voxfor VPS plans for smaller private models, or GPU/dedicated infrastructure for heavier inference.
It depends on the model tag and quantization. Small distilled models can run with much less RAM than 14B, 32B or 70B class models. For many VPS users, 7B or 8B class models are a more realistic starting point than larger models.
Yes, smaller models can run on CPU, but response speed may be slower than GPU inference. Larger models or multi-user workloads should be planned around GPU or dedicated hardware.
Usually no. Keep Ollama private and access it through SSH tunneling, private networking or a protected web layer with authentication and TLS.
No. Ollama can run models and expose a local API without Open WebUI. Open WebUI is useful when you want a browser-based private chat interface, user management or a more comfortable interface for testing.
Start with a smaller tag that fits your server. If you have enough RAM, an 8B class model is a practical first serious test. Move to 14B or larger only after checking memory, speed and the actual use case.