---
title: "Deploy Marker"
description: "Convert PDFs, scans and Office docs to Markdown with a private API"
category: "AI/ML"
url: https://railway.com/deploy/marker
---

# Deploy Marker

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

**[Deploy Marker on Railway](https://railway.com/template/marker)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/marker/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** AI/ML
- **Total deploys:** 2

## Template content

### Marker https://raw.githubusercontent.com/datalab-to/marker/v2.2.0/data/images/datalab-logo.png

- **Source:** https://github.com/aalfath/marker-railway-template
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# 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:

```sh
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.



## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/marker
