How to Run DeepSeek R1 Locally on Linux with Ollama (Step-by-Step VRAM Guide)
LLM Serving(Updated )

How to Run DeepSeek R1 Locally on Linux with Ollama (Step-by-Step VRAM Guide)

Start with the model and the workload

The useful sizing question is whether a checkpoint can run with your actual prompt, output budget, concurrency, and available memory. A model that loads for a short interactive prompt may behave differently when a coding agent supplies a large collection of files and conversation history.

Ollama’s DeepSeek-R1 registry lists distilled models alongside the full model. These are different checkpoints, not interchangeable settings on one model. The registry identifies the 8B checkpoint as DeepSeek-R1-0528-Qwen3-8B and the 671B checkpoint as DeepSeek-R1. Record the exact model revision and Ollama release for a reproducible deployment; a familiar tag alone is insufficient evidence that two installations use identical artifacts.

Before downloading, record the GPU model, total and currently available VRAM, available system memory, and disk space. Include other services that must continue running. A package needs disk space, while inference also needs runtime memory for weights, context, and other allocations.

Choose a checkpoint without treating package size as VRAM

The following are approximate registry package sizes from the November 13, 2026 retrieval. They are not tested minimum VRAM, peak memory, or a promise of GPU-only execution. Registry values can change, so check the exact artifact before deployment. The registry also lists 128K context for these distilled tags and 160K for 671B; those are model metadata, not proof that your installation allocates or can serve those lengths.

Registry tag Approximate package size Starting decision
deepseek-r1:1.5b 1.1 GB Smallest listed starting point for a basic local workflow
deepseek-r1:7b 4.7 GB Consider when the smallest model is insufficient
deepseek-r1:8b 5.2 GB Check the revision carefully; this tag received a 0528 update
deepseek-r1:14b 9.0 GB Budget additional runtime memory beyond the package
deepseek-r1:32b 20 GB Assess headroom and offloading before committing
deepseek-r1:70b 43 GB Plan for substantial memory and storage
deepseek-r1:671b 404 GB Treat as a separate, large deployment project

Use this decision path:

  1. Limited memory or unknown headroom: start with a smaller distilled checkpoint and a modest workload. Observe placement and memory before increasing either.
  2. Loads but is too slow: check whether it is partly in system memory, then compare a smaller checkpoint or shorter context on the same representative task.
  3. Loads and meets the workflow’s needs: keep the revision and settings fixed while evaluating correctness. Increase capacity only if the measured workload requires it.

Package size alone cannot predict the outcome: runtime allocation, context, concurrent work, backend, and available memory all matter. Do not infer coding quality or throughput from parameter count alone.

Check hardware support and placement

The current Ollama hardware documentation states that NVIDIA GPUs need compute capability 5.0 or newer and driver 550 or newer; it specifies driver 570 or newer for compute capabilities 5.0 through 6.2. The same page specifies an AMD ROCm v7 driver for its listed Linux AMD devices. These are statements in current documentation, not a guarantee for every older Ollama release. Match the documentation to the release you intend to run before changing a driver.

After loading a model, the official FAQ documents ollama ps as a way to inspect placement. Its PROCESSOR column distinguishes GPU-only, CPU-only, and split placement; the current context-length documentation also shows a CONTEXT column. Confirm what your pinned release displays.

If placement is split, investigate free VRAM, competing workloads, the chosen checkpoint, and context allocation before attributing the result to a defective GPU. If a GPU disappears after suspend and resume, the hardware documentation describes a possible NVIDIA discovery issue; diagnose the machine and active workloads before attempting any driver intervention.

Size context for the request

Context is the token space available to the model during inference. Longer context requires more memory, and an agent’s instructions, retrieved files, conversation history, and generated output all contribute to the capacity its workflow needs.

The supplied official pages differ on defaults: the current context-length page describes VRAM-dependent defaults, while the FAQ states a 4,096-token default. Both are moving main documents. Neither excerpt establishes which behavior applies to a particular historical release. Inspect the documentation for your installed version and observe the allocation rather than assuming either default.

For a controlled change:

  • Record the release, model revision, current allocated context, placement, and representative prompt size.
  • Check that release’s official documentation for the applicable server, interactive, or API setting and its precedence. The supplied excerpts do not establish a version-pinned Modelfile create-and-run sequence.
  • Change one setting at a time, then inspect the allocation and placement again. If memory pressure or offloading becomes unacceptable, reduce the setting or select a smaller checkpoint.
  • Test a representative coding request, including its intended output budget. A short prompt alone does not validate an agent workflow.

The context page recommends at least 64,000 tokens for tasks such as coding agents, but that recommendation is not evidence that a particular machine can allocate it. Treat it as a workload target to evaluate against available resources.

Connect a coding client cautiously

Keep the inference service reachable only by intended clients. Before changing a Linux service, inspect its existing configuration and listening address; an internet-exposed inference service can allow unwanted use of compute. The FAQ describes environment-variable configuration for systemd, but its example uses an all-interface bind. Do not copy that exposure setting without an intentional access-control design.

For a coding client, first establish whether it supports the API and model capabilities required by your workflow. The registry shows a native chat example; it does not, in the supplied excerpt, verify an OpenAI-compatible request, authentication behavior, or acceptance of any placeholder key. Check the exact endpoint, request schema, authentication requirements, and tool-calling support in official documentation for both pinned releases before configuring the integration.

Then verify service reachability, the selected model revision, and a small request. If tool calling fails, collect the client error, request format, and model capability information before changing network exposure. Avoid putting sensitive code into an integration until you understand where that client sends requests.

Primary sources

Validation boundary: No command, model download, GPU run, client integration, benchmark, or numerical memory result was independently executed or verified for this article. Source excerpts were reviewed on November 13, 2026; the registry sizes above come from the November 13, 2026 retrieval and can change. Verify release-specific behavior and live documentation before deployment.

BC

Written by B. Cho

Systems & AI Infrastructure Engineer

Specializing in GPU inference engines (vLLM, SGLang, Ollama), CUDA memory allocation, and Model Context Protocol (MCP) infrastructure on Linux workstations.