Docling OCRIndependent Docling guide

Setup guide · 10–20 minutes

Installing Docling Without Losing an Afternoon

Docling installs with one command and then asks for three more decisions: which OCR engine, which PyTorch build, and which models to pre-fetch. Get those wrong and you end up with a 6 GB download that still runs on CPU.

Updated 2026-10-26 · 3 min read

The short version

  • –Base install is pip install docling (or uv add docling). Everything else is an extra.
  • –Linux CPU-only machines should install PyTorch from the CPU wheel index, or pip will pull multi-gigabyte CUDA libraries you cannot use.
  • –Intel Macs need docling[mac_intel] — recent PyTorch releases dropped Intel Mac wheels entirely.
  • –Air-gapped and containerized deployments should pre-download models with docling-tools models download, not let the first run do it.
  • –Verify with a real conversion, not with pip show: constructing a DocumentConverter is what proves the models and pipeline are usable.

The base install

Docling supports macOS, Linux and Windows on both x86_64 and arm64. If you only need PDF → Markdown with the standard pipeline, the base package is enough:

Base install
pip install docling
# or, if the project uses uv
uv add docling

Python version: the base package sets no strict minimum in its docs, but some extras do — Nemotron-OCR requires Python 3.12, and the Intel Mac workaround requires 3.12 or lower. Pick your interpreter before you pick extras.

Extras, and which ones you actually need

Extras are installed with pip install "docling[NAME1,NAME2]". There is no ocr or chunking extra — chunking ships with the core, and each OCR engine is its own extra.

ExtraWhat it addsInstall it when
rapidocrRapidOCR + onnxruntimeYou want CPU OCR with no PyTorch. The common choice.
easyocrEasyOCR engineMulti-language recognition, and you accept a PyTorch dependency.
tesserocrTesseract bindingYou have system Tesseract and want the in-process binding.
ocrmacmacOS Vision engineYou run on macOS and want zero model downloads.
vlmVision-language model pipelineYou plan to use --pipeline vlm with Granite Docling or similar.
asrASR pipeline dependenciesYou are transcribing audio/video, which is a different job entirely.
htmlrenderHTML page renderingYou convert HTML sources that need browser-grade rendering.
feat-ocr-nemotronNVIDIA Nemotron OCRLinux x86_64 + Python 3.12 + CUDA 13.x only.
mac_intelPinned Torch for Intel MacsYour Mac has an Intel CPU and no other install works.

Platform by platform

1

Linux with a GPU

Install the base package and let pip resolve CUDA wheels. Verify Torch sees the device before blaming Docling: python -c "import torch; print(torch.cuda.is_available())". Then run with --device cuda (or leave it on auto).

2

Linux, CPU only

Install from the PyTorch CPU index so pip does not fetch CUDA libraries: pip install docling --extra-index-url https://download.pytorch.org/whl/cpu. With uv, add a named index pytorch-cpu and map torch to it via [tool.uv.sources] before running uv add docling.

3

macOS on Apple Silicon

Base install works. PyTorch ships arm64 wheels, and Docling can use MPS (--device mps) for the layout and table models. Apple does not have NVIDIA CUDA, so any guide telling you to set CUDA_VISIBLE_DEVICES is wrong for your machine.

4

macOS on an Intel Mac

Recent PyTorch (2.6+) has no Intel Mac wheels. Either pip install "docling[mac_intel]", or pin the stack: uv add torch==2.2.2 torchvision==0.17.2 docling. Expect CPU-only speed and plan around it — this is a fine machine for a hundred pages, not for ten thousand.

5

Windows

Install normally with a 64-bit Python, ideally a virtualenv. If OCR fails, the usual cause is a missing engine extra rather than the platform. Running Docling inside WSL2 gives you the Linux CUDA path with less wheel friction, at the cost of moving files across the boundary.

6

Containers

For a service, do not hand-build the image — use the published docling-serve images (CPU, CUDA 12.8, CUDA 13.0) covered in the docling-serve guide. CUDA images are not tagged latest, so pin a version.

Pre-downloading models (offline and air-gapped)

The first conversion downloads layout, table-structure and OCR models. On a laptop that is a one-time cost; in a container that restarts, or on a machine with no egress, it is a failure waiting to happen.

Pre-fetch the artifacts during image build, then point Docling at that directory on the runtime host:

Fetch models once, run offline
# download the model artifacts into a local folder
docling-tools models download

# there is also a helper for pulling a Hugging Face repo
docling-tools models download-hf-repo

# then, at runtime, point Docling at the local artifacts
export DOCLING_ARTIFACTS_PATH=/opt/docling-models

The exact env var and flags have changed between releases — check the offline / model-catalog page for your installed version. The principle does not change: model fetch must not happen at request time.

Verify the install properly

A successful pip install proves nothing. What proves the install works is constructing the converter — that is the step that loads models and builds the pipeline:

  • If the smoke test hangs for minutes on first run, it is downloading models — expected once, not on every run.
  • ModuleNotFoundError for an OCR engine means the extra was not installed, not that Docling is broken.
  • OperationNotAllowed means you enabled a remote service without enable_remote_services=True.
  • CUDA out-of-memory on a 4 GB card is normal for the accurate table model — see troubleshooting.
Smoke test
python -c "from docling.document_converter import DocumentConverter; DocumentConverter(); print('ok')"

# and a real conversion
docling convert https://arxiv.org/pdf/2206.01062 --to md

The honest shortcut

If you are installing Docling to convert three documents, the install is almost certainly more work than the task. The pipeline is available without a local environment through the online Docling OCR UI — same family of models, no CUDA, no tessdata.

Install Docling yourself when you need it in a pipeline: batch ingestion, a scheduler, a service other software calls, or data that cannot leave your network. Those are good reasons. "I have one PDF" is not.

Frequently asked questions

How do I install Docling on Windows?+

pip install docling in a 64-bit Python virtualenv works. Most Windows failures are missing OCR engine extras or a broken Torch wheel; WSL2 with the Linux path is a reliable fallback.

Why is pip downloading gigabytes of CUDA packages?+

The default PyTorch wheel bundles CUDA. On a CPU-only machine, install from https://download.pytorch.org/whl/cpu with --extra-index-url so pip picks CPU wheels instead.

Does Docling work on an Intel Mac?+

Yes, with pinning. PyTorch 2.6+ has no Intel Mac wheels, so use pip install "docling[mac_intel]" or pin torch==2.2.2 and torchvision==0.17.2 alongside docling.

How much disk space does Docling need?+

Budget several gigabytes: the Python environment with PyTorch plus the layout, table-structure and OCR models. A CPU-only install with RapidOCR is dramatically smaller than a CUDA install with EasyOCR.

Can I run Docling fully offline?+

Yes. Pre-download the model artifacts at build time with docling-tools models download, point Docling at that local path, and avoid any pipeline option that calls a remote service.

Do I need Python 3.12?+

Not for the base install. Specific extras require it — Nemotron-OCR needs 3.12, and the Intel Mac workaround needs 3.12 or lower.

Try it online

Run the same pipeline in the browser — no install, no uploads stored.

Try it in the browser

Keep reading