Deploy Marker

Convert PDFs, scans and Office docs to Markdown with a private API

Deploy Marker

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

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

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
Weaviate
Vector database with hybrid search and an API key-protected API

GitHub Locker
1
View Template
Möbius Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1