Use

MarkItDown in Docker

Updated 2026-11-16·Upstream source ↗
Markdown view

The upstream repository has two Dockerfiles: one for the command line and one for the MCP server. We built both, ran them on a CI runner, and found three things worth knowing: each image is about 1.5 GB, a folder you mount for output must be writable by the user inside the container, and the server's non-local bind prints a warning.

Short answer

Build the command-line image, mount your folder, and write the output as your own user:

Command
git clone https://github.com/microsoft/markitdown.git
cd markitdown
docker build -t markitdown:latest .
Command
docker run --rm -v "$PWD:/data:ro" markitdown:latest /data/report.docx

Tested with markitdown 0.1.9 · Python Docker 29.4.2 on a GitHub-hosted Ubuntu runner (x86-64); upstream Dockerfiles at commit ed17895 (2026-11-07); Apple Silicon and Windows were not tested (T14) · 2026-11-16 · evidence: t14.log

The command-line image

The build took about 72 seconds and the image is 1.57 GB, of which the Python packages are 440 MB. It includes ffmpeg and ExifTool, installs markitdown[all] and the sample plugin, and runs as nobody (user 65534). Piping a file through standard input worked for Word and for a PDF (the PDF needed no hint):

Command
docker run --rm -i markitdown:latest < report.docx > report.md

An MP3 mounted into the container converted with its metadata and transcript, because ffmpeg is in the image (audio; the transcript needs a network).

Writing output: the permission trap

With -o to a mounted folder, the image's user nobody could not write to a folder owned by someone else:

markitdown 0.1.9 · Ubuntu 24.04 · Docker 29.4.2 (CI runner) · 2026-11-16
$ docker run --rm -v "$PWD/docs:/data:ro" -v "$PWD/out:/out" markitdown:latest /data/report.docx -o /out/report.md
  File "/usr/local/lib/python3.13/site-packages/markitdown/__main__.py", line 313, in _handle_output
    with open(args.output, "w", encoding="utf-8") as f:
         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/out/report.md'

raw log

Running as your own user fixed it:

markitdown 0.1.9 · Ubuntu 24.04 · Docker 29.4.2 (CI runner) · 2026-11-16
$ docker run --rm --user "$(id -u):$(id -g)" -v "$PWD/docs:/data:ro" -v "$PWD/out:/out" markitdown:latest /data/report.docx -o /out/report.md
total 4
-rw-r--r-- 1 runner runner 850 Nov 16 03:33 report.md

raw log

The MCP image

The second Dockerfile builds in about 75 seconds to 1.53 GB, sets MARKITDOWN_ENABLE_PLUGINS=True, and its working directory is /workdir.

Command
docker build -t markitdown-mcp:latest packages/markitdown-mcp
docker run --rm -i -v "$PWD/docs:/workdir:ro" markitdown-mcp:latest

Inside the container the files are at the mounted path, not your host path. In our test file:///workdir/report.docx converted (838 characters) and the host's absolute path failed with Could not read the resource: No such file or directory. Tell the model the path inside the container (MCP page).

With --http --host 0.0.0.0 the server answered on /mcp and printed WARNING: The server is being bound to a non-localhost interface (0.0.0.0). Publish the port on 127.0.0.1 only.

The image on Docker Hub

mcp/markitdown exists on Docker Hub, is 1.44 GB, runs as nobody, and was created on 2026-06-24 (the namespace is Docker's catalogue, not Microsoft's). It answered the same three tool calls, but with 831 characters for the Word file instead of 838, so it contains an older MarkItDown than 0.1.9. Check which version an image has before relying on it.

Not tested

Apple Silicon (arm64) builds, Windows containers, a slimmer image with only some extras, Docker Compose, and running with a read-only filesystem.