Running DeepSeek on Linux: Web, API and Local Options

You have a Linux box — Ubuntu, Fedora, Arch, Debian, take your pick — and you want DeepSeek working on it tonight. There are three ways to do it: the hosted chat in a browser, the DeepSeek API from a Python script or curl, or open weights running locally through Ollama, SGLang or vLLM. Many tutorials online still point at DeepSeek-R1 from January 2025 or at the April 2026 V4 preview; today the API serves deepseek-flash (DeepSeek-V4.1-Flash-1017, released 17 October 2026) and deepseek-v4-pro (DeepSeek-V4-Pro-0813, released 13 August 2026).
This guide covers all three paths, with the exact commands, the current model IDs and realistic hardware requirements, so you can pick the route that fits your machine and budget.
The three ways to run DeepSeek on Linux

Before any commands, decide which surface you actually need. The three options behave very differently in terms of cost, latency, privacy and the hardware they demand.
| Path | Best for | Hardware | Cost | Privacy |
|---|---|---|---|---|
| Web chat (browser) | Quick questions, no setup | Any Linux with a modern browser | Free tier | Data processed by DeepSeek |
| DeepSeek API (Python/curl) | Apps, scripts, automation | Any Linux with Python 3.9+ | Pay-per-token | Data sent to DeepSeek servers |
| Local (Ollama, SGLang) | Offline use, full data control | 16 GB+ RAM as a rough guide; GPU strongly recommended | Electricity + hardware | Stays on your machine |
If you only need a chat window, skip to “Path 1.” If you are building software, “Path 2” is what you want. If you need offline operation or refuse to send prompts off-box, jump to “Path 3.”
Path 1: Use DeepSeek’s web app from any Linux desktop
The simplest option costs nothing and works on any distro. Open Firefox, Chromium, Brave or your preferred browser and go to chat.deepseek.com, then sign in. According to DeepSeek’s 17 October 2026 Change Log, the official web and app models were updated to DeepSeek-V4.1-Flash-1017; for the background on the V4 family, see DeepSeek’s V4 release.
There is no Linux desktop app from DeepSeek — the web client is the official surface, and any “DeepSeek for Linux” .deb or .AppImage you find on third-party sites is unofficial. If a packaged client matters to you, see our notes on verifying the official DeepSeek app.
What about Electron wrappers?
Several community projects wrap the web chat in an Electron or Tauri shell so it sits in your launcher. They are unaffiliated with DeepSeek and simply load the same web chat, so you get the same model and limits as in the browser. For heavier or automated work, plan on the API instead.
Path 2: Call the DeepSeek API from Linux

For any kind of automation — a CLI tool, a Slack bot, an internal RAG service — the API is the right answer. The DeepSeek API uses a format compatible with OpenAI and Anthropic, so the OpenAI or Anthropic SDK, or software built for either API, can reach it by changing the configuration. On Linux, that means a base_url and API-key change in any existing OpenAI client.
Step 1: Get an API key
Create an account at platform.deepseek.com, then go to “API Keys” and generate one. Export it in your shell so you do not paste secrets into scripts:
export DEEPSEEK_API_KEY="sk-..."
echo 'export DEEPSEEK_API_KEY="sk-..."' >> ~/.bashrc
For a deeper walk-through, see our guide to getting a DeepSeek API key.
Step 2: First request with curl
Chat requests hit POST /chat/completions, the OpenAI-compatible endpoint. From any Linux terminal:
curl https://api.deepseek.com/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DEEPSEEK_API_KEY}" \
-d '{
"model": "deepseek-flash",
"messages": [
{"role": "user", "content": "Summarise the Linux kernel scheduler in 3 sentences."}
]
}'
Thinking mode is the default, so the response carries reasoning_content alongside the final content. Add "stream": true to the body to receive server-sent events instead of one JSON object.
Step 3: Python with the OpenAI SDK
Install the OpenAI SDK in a venv (the standard Linux pattern that avoids polluting the system Python):
python3 -m venv ~/ds-env
source ~/ds-env/bin/activate
pip install openai
Then a minimal Python script. Note the base_url override — that is the core of the switch from OpenAI to DeepSeek:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DEEPSEEK_API_KEY"],
base_url="https://api.deepseek.com",
)
response = client.chat.completions.create(
model="deepseek-flash",
messages=[{"role": "user", "content": "Plan a Postgres migration."}],
reasoning_effort="high",
extra_body={"thinking": {"type": "enabled"}},
)
print(response.choices[0].message.reasoning_content)
print(response.choices[0].message.content)
That request spells out thinking mode, which returns reasoning_content alongside the final content. Thinking is already the default (effort high), so the two extra fields only make it explicit. For a latency-sensitive chat path, opt out with extra_body={"thinking": {"type": "disabled"}}. Swap the model to deepseek-v4-pro to call DeepSeek-V4-Pro-0813 instead. For more patterns, see DeepSeek Python integration.
Model IDs to use
Two model IDs are current, both with a 1M-token context window and up to 384K output tokens:
deepseek-flash— served by DeepSeek-V4.1-Flash-1017. The default choice for chat and standard workloads, and the only current model that accepts images.deepseek-v4-pro— served by DeepSeek-V4-Pro-0813. No vision support.
Older scripts may still use legacy names. deepseek-v4-flash and deepseek-v4-flash-vision-exp are still accepted but are served by DeepSeek-V4.1-Flash-1017; deepseek-chat and deepseek-reasoner were scheduled for retirement on 2026-07-24 at 15:59 UTC and are no longer listed in the official docs. Switching is a one-line model= change; base_url stays the same. See DeepSeek OpenAI SDK compatibility for the full mapping.
Parameters worth knowing
reasoning_effort—"low","high"(the default) or"max"; thinking is on unless you disable it withextra_body={"thinking": {"type": "disabled"}}.temperature— has no effect in thinking mode. In non-thinking mode, DeepSeek’s official guidance is 0.0 for code and maths, 1.0 for data analysis, 1.3 for general chat and translation, 1.5 for creative writing.top_p— nucleus sampling; whether it takes effect depends on the model and mode, so check the official docs before tuning it.max_tokens— output cap, up to 384K tokens on both current models.stream=true— server-sent events for token-by-token output; with thinking on, reasoning content streams alongside the final content.- JSON mode —
response_format={"type": "json_object"}is designed to return valid JSON, not guaranteed. Always include the word “json” plus a small example schema in the prompt, handle the occasional empty response, and setmax_tokenshigh enough that the response cannot truncate.
The API is stateless — your Linux client must resend the conversation history with every request to maintain a multi-turn chat. The web app keeps that state for you; the API does not.
What the API costs
As of October 2026, deepseek-flash lists $0.006 cache-hit input, $0.30 cache-miss input and $1.20 output per 1M tokens at peak, and half that off-peak ($0.003 / $0.15 / $0.60); deepseek-v4-pro lists $0.044 / $1.32 / $3.96 at peak and $0.022 / $0.66 / $1.98 off-peak. Peak hours are 01:00–04:00 and 06:00–10:00 UTC, Monday to Friday, excluding Chinese public holidays. For worked monthly estimates, see our DeepSeek API pricing guide.
Path 3: Run DeepSeek locally on Linux
For air-gapped work, regulated data, or simply learning how MoE models behave, you can run DeepSeek’s open weights on your own Linux box. Two routes dominate: Ollama for ease, SGLang or vLLM for multi-user serving.
Honest hardware reality check
The full current models are not consumer-runnable. On Hugging Face, the DeepSeek-V4-Pro-0813 repository’s files add up to about 893 GB and the DeepSeek-V4.1-Flash-1017 repository’s to about 510 GB (checked 23 October 2026), and the V4-Pro-0813 model card’s example vLLM command serves the model on a 4×GB300 node. What most people actually run locally are the DeepSeek R1 Distill variants — fine-tuned versions of open-source models like LLaMA and Qwen, trained on data generated by DeepSeek-R1, that are far easier to self-host.
| Model size | Min RAM (rough) | GPU VRAM (rough, recommended) | Ollama download | Use |
|---|---|---|---|---|
| 1.5B distill | 8 GB | None / 4 GB | 1.1 GB | Quick experiments, low-end laptops |
| 7B / 8B distill | 16 GB | 8 GB | 4.7 GB / 5.2 GB | General-purpose local chat |
| 14B distill | 32 GB | 12 GB | 9.0 GB | Solid reasoning on a single GPU |
| 32B distill | 64 GB | 24 GB | 20 GB | RTX 4090 / 3090 territory |
| 70B distill | 128 GB | 48 GB+ (or two GPUs) | 43 GB | Workstation / small server |
| V4.1-Flash-1017 / V4-Pro-0813 full | — | Multi-GPU server (e.g. 4×GB300 for V4-Pro-0813) | ~510 GB / ~893 GB on Hugging Face | Dedicated inference server |
Download sizes are the default tags in the Ollama deepseek-r1 library (checked 23 October 2026); the RAM and VRAM columns are a rough rule of thumb for 4-bit quantised builds, not vendor requirements, and real needs grow with context length. For a more granular view, see our DeepSeek hardware calculator.
Step-by-step: Ollama on Ubuntu, Fedora or Arch
- Install Ollama. One curl command, distro-agnostic:
curl -fsSL https://ollama.com/install.sh | shThis script downloads and installs the Ollama binary, sets up the necessary services, and adds Ollama to your system’s PATH.
- Verify the service.
ollama --version systemctl status ollamaIf the service is not active, start it with
sudo systemctl start ollama. - Pull a model. Pick the largest size your VRAM can hold:
ollama pull deepseek-r1:7b # or for stronger reasoning on a 24 GB GPU: ollama pull deepseek-r1:32b - Run an interactive session.
ollama run deepseek-r1:7bYou get a REPL — type a prompt, hit Enter. Exit with
/bye. - Hit it from code. Ollama exposes an OpenAI-compatible server at
http://localhost:11434, so the same Python snippet from Path 2 works against your local model withbase_url="http://localhost:11434/v1"and the model name changed to the tag you pulled (for exampledeepseek-r1:7b); the DeepSeek-specificthinkingandreasoning_effortfields belong to DeepSeek’s API, so drop them locally.
For the deeper version of this walk-through with troubleshooting, see running DeepSeek on Ollama and the broader install DeepSeek locally guide.
GPU acceleration on Linux
Ollama uses your GPU automatically once the drivers are present. On NVIDIA hardware, install the proprietary driver — Ollama’s GPU documentation lists support for compute capability 5.0 and newer with driver version 550 or later. On AMD, install ROCm and use a recent kernel. Verify with nvidia-smi (NVIDIA) or rocm-smi (AMD) that the model is actually on the GPU during inference; if you see CPU pegged at 100% and GPU idle, the driver chain is broken.
Production-grade serving with SGLang or vLLM
Ollama is for one user. For multi-tenant inference — a team behind an internal API — SGLang and vLLM are the right tools. DeepSeek-V4-Pro-0813 (MIT-licensed weights on Hugging Face) is built on the V4-Pro (Preview) model structure with a DSpark speculative-decoding module, and its model card gives launch commands for both engines. The vLLM example targets a single 4×GB300 node:
vllm serve deepseek-ai/DeepSeek-V4-Pro-0813 \
--trust-remote-code --kv-cache-dtype fp8 --block-size 256 \
--data-parallel-size 4 --enable-expert-parallel \
--moe-backend deep_gemm_mega_moe \
--attention-config '{"use_fp4_indexer_cache": true}' \
--speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"greedy"}'
The card links to the vLLM recipe and the SGLang cookbook for other hardware configurations; for SGLang it enables DSpark with --speculative-algorithm DSPARK. For containerised setups generally, see DeepSeek Docker deployment.
Adding a web UI: Open WebUI on Linux
The Ollama CLI is fine for quick prompts, but most teams want a chat UI. Open WebUI is a common pairing. In a Python venv:
sudo apt install python3-venv # Debian/Ubuntu
python3 -m venv ~/open-webui-venv
source ~/open-webui-venv/bin/activate
pip install open-webui
open-webui serve
Then visit http://localhost:8080, sign in to create the local admin account, and your installed Ollama models appear in the model dropdown. To run it as a background service, create a small systemd unit that starts open-webui serve after Ollama. To use the same UI against the hosted API instead of local models, add a connection pointing at https://api.deepseek.com with your API key.
Choosing the right path
Each path fits a different job. The web chat suits stray questions from a laptop. The API suits scripts and services running on Ubuntu or any other server distro. A local R1 distill suits offline work and documents that must not leave the machine.
If you are picking one to start with, the API is the most practical option on Linux: no hardware investment, a base_url change for any existing OpenAI code, and deepseek-flash is served by DeepSeek-V4.1-Flash-1017, the model DeepSeek’s 17 October 2026 Change Log says now runs the web chat and app. Add Ollama later when you have a specific reason to keep data local.
Is there an official DeepSeek desktop app for Linux?
No. DeepSeek does not publish a native Linux desktop client. The official surfaces on Linux are the web chat at chat.deepseek.com and the API at https://api.deepseek.com. Third-party Electron wrappers exist but are unaffiliated; treat any unofficial .deb, .rpm or AppImage with caution. See our notes on how to verify the official DeepSeek app before installing anything packaged.
How do I install DeepSeek on Ubuntu without a GPU?
You have two CPU-only options. Use the hosted API from any Python script — that needs no local model at all. Or install Ollama with curl -fsSL https://ollama.com/install.sh | sh and pull the smallest distill, ollama pull deepseek-r1:1.5b (a 1.1 GB download). As a rough rule of thumb, the 1.5B model is small enough for CPU-only use on a machine with about 8 GB of RAM, though CPU inference is much slower than GPU inference. Larger sizes are not realistic without a GPU; full DeepSeek system requirements are in our hardware guide.
What hardware do I need to run DeepSeek V4 locally on Linux?
The full DeepSeek-V4-Pro-0813 and DeepSeek-V4.1-Flash-1017 checkpoints are meant for multi-GPU inference servers: their Hugging Face repositories hold about 893 GB and 510 GB of files, and the V4-Pro-0813 model card’s vLLM example runs on a 4×GB300 node. On a single workstation, run an R1 distill instead. Use our DeepSeek hardware calculator to size a specific model against your machine.
Can I use the OpenAI Python SDK to call DeepSeek from Linux?
Yes — that is the recommended pattern. The DeepSeek API is OpenAI-compatible, so the official openai package works by setting base_url="https://api.deepseek.com" and your DeepSeek API key. An Anthropic-compatible endpoint is also available at https://api.deepseek.com/anthropic. Full details of the wire-level mapping live in our DeepSeek API documentation notes.
Why does my DeepSeek API call lose the conversation history on Linux?
Because the API is stateless — DeepSeek does not store prior turns server-side. Every POST /chat/completions request must include the full messages array with all previous user and assistant turns. The web chat maintains session history for you; the API delegates that to your client. See our DeepSeek API getting started guide for a working multi-turn example.
Sources & Methodology
Primary sources
- OfficialDeepSeek API documentationEndpoints, request/response shape, model IDsLast checked: October 23, 2026
- PricingDeepSeek API pricing pagePer-1M-token rates, billing units, cache-hit pricingLast checked: October 23, 2026
- Model cardDeepSeek on Hugging FaceWeights, license, usage notes per modelLast checked: October 23, 2026
Technical references
- Technical reportDeepSeek-R1 paper (arXiv:2501.12948)R1 reasoning approach, distillation resultsLast checked: October 23, 2026
Methodology
Information in this article was checked against the official DeepSeek documentation, the article's cited primary sources, and the deepseekai.guide pricing dataset on the date shown above. Where third-party numbers are quoted, the originating source is linked inline so the reader can verify and re-check.
Data confidence
High for facts cited inline with primary-source links; medium for context narrative.
Editorial note
AI tooling moves quickly. If you spot an outdated number or a broken link, the contact link in the footer is the fastest way to flag it for the editorial team.
