
Deploy Marker
Convert PDFs, scans and Office docs to Markdown with a private API
Just deployed
Deploy and Host Marker on Railway
Marker is an open-source document converter by Datalab. It turns PDFs, scanned pages, images and Office files (DOCX, PPTX, XLSX, EPUB, HTML) into clean Markdown, HTML, JSON or RAG-ready chunks. It detects layout and reading order, rebuilds tables, and runs OCR where a page has no usable text layer.
About Hosting Marker
This template runs Marker 2.2.0 as one service, built from a public GitHub repo. That repo pins the official Python image by digest and installs the released marker-pdf package with CPU-only PyTorch. It runs Marker's own FastAPI server, which serves the interactive Marker Viewer in your browser and a REST API (/marker/upload). Its CPU models (Indra ONNX layout and OCR) are baked into the image at build time, so a deploy starts in seconds and needs no GPU. Every route except /health is protected by an API key generated at deploy time. Marker is stateless, so no volume or database is needed.
Common Use Cases
- Convert PDFs and scans into Markdown or chunks for RAG pipelines and LLM ingestion
- Give internal tools or automations (n8n, scripts, agents) a private document-to-Markdown API
- Extract tables, headings and reading order from reports, papers and invoices
Dependencies for Marker Hosting
- None beyond the Marker service itself: no database, cache or volume
- Optional: a Gemini API key (
GOOGLE_API_KEY) if you want LLM-assisted conversion (use_llm)
Deployment Dependencies
- Marker source and docs: https://github.com/datalab-to/marker
- Marker 2.2.0 release: https://github.com/datalab-to/marker/releases/tag/v2.2.0
- Template repo: https://github.com/aalfath/marker-railway-template
- Model license (free for personal use, research, and organisations under US$5M revenue and funding): https://github.com/datalab-to/marker/blob/master/MODEL_LICENSE
Implementation Details
Find your key in the service's MARKER_API_KEY variable. Open your Railway domain in a browser and sign in with any user name and the key as the password to use the viewer. API docs are at /docs. From code or the command line:
curl -H "Authorization: Bearer YOUR-API-KEY" \
-F file=@document.pdf -F output_format=markdown \
https://YOUR-DOMAIN/marker/upload
The X-API-Key header works too. On CPU, use the fast (default) or no_ocr modes. The balanced and vllm modes need a separate GPU inference server, which you set with SURYA_INFERENCE_URL. Uploads are limited to 100 MB by default (MARKER_MAX_UPLOAD_BYTES). The start script sizes CPU threads from the service's limit (at most 8). Updates arrive as an "update available" notice when the template repo moves to a new Marker version.
Why Deploy Marker on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Marker on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content

