Self-hosted Docling document parsing server. PDF/DOCX/HTML to Markdown. NVIDIA GPU (CUDA) support.
10K+
GitHub: https://github.com/hwdsl2/docker-docling
Part of the Self-Hosted AI Stack — deploy a complete self-hosted AI stack with a single command.
Docker image to run a self-hosted document parsing server, powered by IBM Docling. Converts PDF, DOCX, PPTX, XLSX, HTML, Markdown, LaTeX, and more to structured Markdown, JSON, or HTML output. Designed to be simple, private, and self-hosted.
Features:
DOCLING_ENABLE_UI)docling_manage):cuda image tag)DOCLING_LOCAL_ONLY)linux/amd64, linux/arm64📘 The Self-Hosted AI Builder’s Guide: $0.99/£0.99 ebook through Sept. 20 (US/UK). A practical guide to building, securing, and operating your own private AI stack.
Also available:
Use this command to set up a document parsing server:
docker run \
--name docling \
--restart=always \
-v docling-data:/var/lib/docling \
-p 5001:5001 \
-d hwdsl2/docling-server
Note: For internet-facing deployments, using a reverse proxy to add HTTPS is strongly recommended. In that case, also replace -p 5001:5001 with -p 127.0.0.1:5001:5001 in the docker run command above, to prevent direct access to the unencrypted port.
A separate docker-compose.cuda.yml is provided for GPU deployments:
cp docling.env.example docling.env
# Edit docling.env as needed, then:
docker compose -f docker-compose.cuda.yml up -d
docker logs docling
Example docker-compose.cuda.yml (already included):
services:
docling:
image: hwdsl2/docling-server:cuda
container_name: docling
restart: always
ports:
- "5001:5001/tcp" # For a host-based reverse proxy, change to "127.0.0.1:5001:5001/tcp"
volumes:
- docling-data:/var/lib/docling
- ./docling.env:/docling.env:ro
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
volumes:
docling-data:
name: docling-data
Set DOCLING_DEVICE=cuda (or auto) in your env file to use the GPU.
If you have an NVIDIA GPU, use the :cuda image for hardware-accelerated inference:
docker run \
--name docling \
--restart=always \
--gpus=all \
-v docling-data:/var/lib/docling \
-p 5001:5001 \
-d hwdsl2/docling-server:cuda
Requirements: NVIDIA GPU, NVIDIA driver 575.57.08+ (Linux) or 576.57+ (Windows), and the NVIDIA Container Toolkit installed on the host. The :cuda image is linux/amd64 only.
Models are baked into the image and loaded into memory on first start. Check the logs to confirm the server is ready:
docker logs docling
Once you see "Docling document parsing server is ready", convert your first document:
curl -X POST http://your_server_ip:5001/v1/convert/source \
-H "Content-Type: application/json" \
-d '{"sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2501.17887"}]}'
amd64 (x86_64), arm64 (aarch64)For GPU acceleration (:cuda image):
:cuda image supports linux/amd64 onlyFor internet-facing deployments, see Using a reverse proxy to add HTTPS.
Get the trusted build from the Docker Hub registry:
docker pull hwdsl2/docling-server
Alternatively, you may download from Quay.io:
docker pull quay.io/hwdsl2/docling-server
docker image tag quay.io/hwdsl2/docling-server hwdsl2/docling-server
For NVIDIA GPU acceleration, pull the :cuda tag instead:
docker pull hwdsl2/docling-server:cuda
Supported platforms: linux/amd64 and linux/arm64. The :cuda tag supports linux/amd64 only.
All variables are optional. Fresh installs with a mounted /var/lib/docling volume auto-generate an API key. Existing installs without a key remain open for backward compatibility.
This Docker image uses the following variables, that can be declared in an env file (see example):
| Variable | Description | Default |
|---|---|---|
DOCLING_PORT | HTTP port for the API (1–65535). | 5001 |
DOCLING_API_KEY | Optional API key. Fresh persistent installs auto-generate one. If set, conversion/chunk API requests must include X-Api-Key: <key> header. Health and version endpoints do not require the key. Set explicitly empty to disable authentication. | Auto-generated for fresh persistent installs |
DOCLING_LOG_LEVEL | Log level: DEBUG, INFO, WARNING, ERROR. | INFO |
DOCLING_WORKERS | Number of Uvicorn workers. Increase for higher throughput on multi-core systems. Each worker loads models independently (higher RAM). | 1 |
DOCLING_ENABLE_UI | Enable the web UI playground at /ui. Set to true or false. | false |
DOCLING_MAX_PAGES | Maximum number of pages per document. | (unlimited) |
DOCLING_MAX_FILE_SIZE | Maximum file size for uploads in bytes (e.g. 50000000 for ~50 MB). | (unlimited) |
DOCLING_DEVICE | Compute device: cpu, cuda, or auto. | cpu |
DOCLING_LOCAL_ONLY | When set to any non-empty value (e.g. true), disables all HuggingFace model downloads. For offline or air-gapped deployments. | (not set) |
DOCLING_DISABLE_USAGE_COUNTS | Set to 1 to disable anonymous aggregate usage counts. | (not set) |
Note: In your env file, you may enclose values in single quotes, e.g. VAR='value'. Do not add spaces around =. If you change DOCLING_PORT, update the -p flag in the docker run command accordingly.
Example using an env file:
cp docling.env.example docling.env
# Edit docling.env with your settings, then:
docker run \
--name docling \
--restart=always \
-v docling-data:/var/lib/docling \
-v ./docling.env:/docling.env:ro \
-p 5001:5001 \
-d hwdsl2/docling-server
The env file is bind-mounted into the container, so changes are picked up on every restart without recreating the container.
--env-filedocker run \
--name docling \
--restart=always \
-v docling-data:/var/lib/docling \
-p 5001:5001 \
--env-file=docling.env \
-d hwdsl2/docling-server
cp docling.env.example docling.env
# Edit docling.env as needed, then:
docker compose up -d
docker logs docling
Example docker-compose.yml (already included):
services:
docling:
image: hwdsl2/docling-server
container_name: docling
restart: always
ports:
- "5001:5001/tcp" # For a host-based reverse proxy, change to "127.0.0.1:5001:5001/tcp"
volumes:
- docling-data:/var/lib/docling
- ./docling.env:/docling.env:ro
volumes:
docling-data:
name: docling-data
Note: For internet-facing deployments, using a reverse proxy to add HTTPS is strongly recommended. In that case, also change "5001:5001/tcp" to "127.0.0.1:5001:5001/tcp" in docker-compose.yml, to prevent direct access to the unencrypted port.
POST /v1/convert/source
Content-Type: application/json
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
sources | array | ✅ | Array of source objects. Each object has kind ("http") and url (URL to fetch). |
Example:
curl -X POST http://your_server_ip:5001/v1/convert/source \
-H "Content-Type: application/json" \
-d '{"sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2501.17887"}]}'
With API key authentication:
curl -X POST http://your_server_ip:5001/v1/convert/source \
-H "X-Api-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2501.17887"}]}'
POST /v1/convert/file
Content-Type: multipart/form-data
Example:
curl -X POST http://your_server_ip:5001/v1/convert/file \
-F "[email protected]"
For large documents, use async endpoints to avoid timeouts:
POST /v1/convert/source/async → returns task_id
GET /v1/status/poll/{task_id} → poll task status
GET /v1/result/{task_id} → retrieve result
GET /health → liveness check (always returns 200)
GET /ready → readiness check (503 until models are loaded)
GET /version
Returns docling, docling-serve, and docling-core versions.
A full interactive Swagger UI is available at:
http://your_server_ip:5001/docs
Note: API key authentication uses the X-Api-Key header (not Authorization: Bearer). Health, version, and documentation endpoints (/health, /ready, /version, /docs) do not require the API key.
All runtime data is stored in the Docker volume (/var/lib/docling inside the container):
/var/lib/docling/
├── .port # Active port (used by docling_manage)
├── .server_addr # Cached server IP (used by docling_manage)
└── hub/ # HuggingFace Hub cache for runtime-downloaded models
Note: Document conversion models (layout, table structure, OCR) are baked into the Docker image and do not need to be downloaded separately. The Docker volume stores runtime data only.
Use docling_manage inside the running container to inspect and manage the server.
Show server info:
docker exec docling docling_manage --showinfo
List supported formats:
docker exec docling docling_manage --showformats
Download/update models:
docker exec docling docling_manage --downloadmodels
Show version info:
docker exec docling docling_manage --version
Input formats:
| Format | Extensions |
|---|---|
.pdf | |
| Microsoft Word | .docx |
| Microsoft PowerPoint | .pptx |
| Microsoft Excel | .xlsx |
| HTML | .html, .htm |
| Markdown | .md |
| LaTeX | .tex |
| AsciiDoc | .adoc, .asciidoc |
| CSV | .csv |
| Images | .png, .jpg, .jpeg, .tiff, .bmp, .gif |
Output formats:
| Format | Description |
|---|---|
| Markdown | Structured Markdown with tables |
| JSON | Full document structure as JSON |
| HTML | Rendered HTML output |
| Text | Plain text extraction |
| DocTags | Docling's internal tagged format |
Output format is controlled per-request via the API. See the interactive API docs at /docs for full request options.
For internet-facing deployments, place a reverse proxy in front of the Docling server to handle HTTPS termination. The server works without HTTPS on a local or trusted network, but HTTPS is recommended when the API endpoint is exposed to the internet.
Use one of the following addresses to reach the Docling container from your reverse proxy:
docling:5001 — if your reverse proxy runs as a container in the same Docker network as the Docling server (e.g. defined in the same docker-compose.yml).127.0.0.1:5001 — if your reverse proxy runs on the host and port 5001 is published (the default docker-compose.yml publishes it).Example with Caddy (Docker image) (automatic TLS via Let's Encrypt, reverse proxy in the same Docker network):
Caddyfile:
docling.example.com {
reverse_proxy docling:5001
}
Example with nginx (reverse proxy on the host):
server {
listen 443 ssl;
server_name docling.example.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://127.0.0.1:5001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 300s;
}
}
Fresh persistent installs auto-generate a DOCLING_API_KEY. Display it with docker exec docling docling_manage --showkey, or use docker exec docling docling_manage --getkey in scripts. For existing installs without a key, set DOCLING_API_KEY in your env file to enable authentication.
To update the Docker image and container, first download the latest version:
docker pull hwdsl2/docling-server
If the Docker image is already up to date, you should see:
Status: Image is up to date for hwdsl2/docling-server:latest
Otherwise, it will download the latest version. Remove and re-create the container:
docker rm -f docling
# Then re-run the docker run command from Quick start with the same volume and port.
Your runtime data is preserved in the docling-data volume.
Docling can be used as the document conversion service in a broader self-hosted AI setup.
For full and lightweight Docker Compose stacks, manual docker run examples, and voice/RAG/MCP pipeline examples with Kokoro, Embeddings, LiteLLM, Ollama, Docling, and MCP Gateway, see Self-Hosted AI Stack.
See Usage counts.
ghcr.io/docling-project/docling-serve-cpu:latest (CentOS Stream 9), CUDA: ghcr.io/docling-project/docling-serve:latest/v1/convert/* and /v1/chunk/* endpoints (served by FastAPI/Uvicorn)/var/lib/docling (Docker volume for runtime data)X-Api-Key header (health/version endpoints exempt)Note: The software components inside the pre-built image (such as IBM Docling and its dependencies) are under the respective licenses chosen by their respective copyright holders. As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
Copyright (C) 2026 Lin Song
This work is licensed under the MIT License.
Docling and Docling Serve are Copyright (C) 2024 International Business Machines, and are distributed under the MIT License.
This project is an independent Docker setup for IBM Docling and is not affiliated with, endorsed by, or sponsored by International Business Machines (IBM).
Content type
Image
Digest
sha256:3e194da35…
Size
2.2 GB
Last updated
1 day ago
docker pull hwdsl2/docling-server