Deploy DeepSeek-R1 on a VPS with Ollama: Specs Setup and Security
Last edited on July 10, 2026

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.

Quick Answer: Can DeepSeek-R1 Run on a VPS?

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.

Choose the Model Before the Server

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 classPractical VPS useRAM planningNotes
1.5B classBasic testing, small prompts, low-cost private experiments4 GB+ can be enough for light useGood first test when you only need to confirm the setup.
7B or 8B classPrivate assistant, coding tests, single-user API, small agent workflows8 to 16 GB is a more realistic rangePractical starting point for many CPU VPS users.
14B classBetter reasoning quality with slower CPU inference16 to 32 GB is saferDo not assume it will feel fast on a small VPS.
32B classAdvanced testing with high memory and patience48 to 64 GB+ is usually more realisticConsider dedicated hardware or GPU options.
70B and largerSerious local inference, research or production workloadsLarge RAM/GPU planning requiredUsually 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.

VPS Setup Assumptions

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.

  • Operating system: Ubuntu 22.04, Ubuntu 24.04 or a compatible Debian-based distribution.
  • Disk: leave room for the model files, logs and future updates. Larger models need more storage.
  • Memory: choose the model by RAM first, not by popularity.
  • Access: keep SSH protected with keys and limit who can administer the server.
  • Network: do not expose the Ollama API publicly without authentication, TLS and a clear access model.

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.

Install Ollama on the VPS

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.

Pull and Test DeepSeek-R1

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.

Use Python Without Turning the Server Into a Mess

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

Keep Ollama Private

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.

Optional: Add Open WebUI

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.

Troubleshooting DeepSeek-R1 on a VPS

ProblemLikely causeWhat to do
Model download is slow or failsLarge model files, network interruption or low disk spaceCheck disk space, retry, or start with a smaller tag.
Process is killed during inferenceOut-of-memory conditionUse a smaller model, add RAM or move to GPU/dedicated infrastructure.
Responses are very slowCPU-only inference on a larger modelUse 1.5B/7B/8B class first or use GPU infrastructure.
Remote client cannot connectAPI is local-only or firewall blocks accessUse SSH tunnel or secure reverse proxy rather than opening Ollama publicly.
Server becomes unresponsiveModel consumes too much RAM/CPUStop 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

When a VPS Is Not Enough

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.

Recommended Next Step

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.

Frequently Asked Questions

How much RAM does DeepSeek-R1 need on a VPS?

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.

Can I run DeepSeek-R1 without a GPU?

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.

Should I expose Ollama to the public internet?

Usually no. Keep Ollama private and access it through SSH tunneling, private networking or a protected web layer with authentication and TLS.

Is Open WebUI required for DeepSeek-R1?

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.

Which DeepSeek-R1 tag should I test first?

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Lifetime Solutions:

VPS SSD

Lifetime Hosting

Lifetime Dedicated Servers