---
title: "Deploy Paperless-ngx OCR"
description: "Tesseract OCR and PDF/A archives for every scan"
category: "Storage"
url: https://railway.com/deploy/deploy-paperless-ngx-ocr-on-railway
---

# Deploy Paperless-ngx OCR

Tesseract OCR and PDF/A archives for every scan

**[Deploy Paperless-ngx OCR on Railway](https://railway.com/template/deploy-paperless-ngx-ocr-on-railway)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-paperless-ngx-ocr-on-railway/manifest.json

- **Creator:** onepush
- **Category:** Storage

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### paperless-ngx

- **Image:** ghcr.io/paperless-ngx/paperless-ngx:3.3.0
- **Public domain:** Yes

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

## Documentation

# Deploy and Host self hosted Paperless-ngx OCR (Open-Source Receipt and Invoice Archive) on Railway

Paperless-ngx OCR turns receipts, invoices, and bills into a searchable archive you control. This Railway stack runs Paperless-ngx 3.3.0 with Tesseract OCR, Postgres, and Redis.

## About Hosting Paperless-ngx OCR open-source software on Railway (self hosted Paperless-ngx receipt management template)

Paperless-ngx is GPL-3.0 document management for scanning, indexing, and retrieving paper. OCRmyPDF with Tesseract creates an original and a PDF/A copy with a hidden text layer; search runs on that layer.

## Why Deploy Paperless-ngx OCR, the Expensify alternative on Railway (Railway Free Trial)

Paperless-ngx gives you the receipt archive without closed SaaS.

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 Paperless-ngx OCR 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.

### Railway vs Other Hosting Providers and VPS for Paperless-ngx OCR self hosting

Railway keeps managed Postgres, Redis, and volume close to Paperless, so you don't maintain three VPS services. A raw VPS works, but OCR batches spike CPU, and Railway scales vertically when you dump a year of receipts in.

| Provider | Setup shape | Paperless-ngx fit |
|---|---|---|
| DigitalOcean | Droplet with Docker Compose or managed Postgres | Workable; you manage updates, backups, Redis, and OCR on droplet CPU |
| AWS | EC2, ECS, or Lightsail plus RDS and ElastiCache | Flexible and more complex; persistent storage and IAM add overhead for a personal archive |
| Hetzner | Dedicated or cloud VPS with volume storage | Cheap and capable, but you still patch OS, Docker, and Paperless yourself |

## Common Use Cases for hosted Paperless-ngx OCR

- Filing tax-season receipts into one searchable archive, then exporting a saved view for your accountant.
- Matching emailed invoices to a `Receipts` tag with an IMAP mail rule that pulls attachments into Paperless-ngx.
- Tracking warranty receipts by adding a `Warranty Until` date field and a scheduled workflow warning before coverage ends.
- Keeping household bills searchable by vendor, year, and amount without a manual Drive folder tree.
- Running a freelancer expense archive where every PDF has an original scan, a PDF/A copy, and a custom field for the exact total.

## Dependencies for Paperless-ngx OCR Docker hosted on Railway

The template depends on three services and their env vars. Paperless-ngx is public on port 8000. Postgres stores metadata, users, tags, correspondents, custom fields, and the search index.

### Deployment Dependencies for Managed Paperless-ngx OCR Service (Receipt Management)

Railway includes `paperless-ngx` using `ghcr.io/paperless-ngx/paperless-ngx:3.3.0`, port 8000, volume `/usr/src/paperless/data`. Postgres and Redis attach internally.

### Implementation Details for Paperless-ngx OCR (Using Paperless-ngx official docker image)

The template sets `PAPERLESS_SECRET_KEY`, `PAPERLESS_ADMIN_USER=admin`, a generated `PAPERLESS_ADMIN_PASSWORD`, `PAPERLESS_ADMIN_MAIL`, and `PAPERLESS_URL` to the public HTTPS domain.

## How does Paperless-ngx OCR compare against other receipt and document management tools

### Paperless-ngx vs Expensify

- **Model:** Expensify is closed SaaS for reimbursement; Paperless-ngx is free self-hosted archive.
- **Receipt OCR:** Both OCR, but Expensify extracts totals. Paperless-ngx does not; you fill custom fields or enable Paperless AI with `PAPERLESS_AI_ENABLED`.
- **Control:** Paperless-ngx keeps originals and PDF/A archives on your volume with no per-user subscription.
- **Fit:** Use Expensify for employee reimbursement; use Paperless-ngx for personal, freelance, or tax archives.

### Paperless-ngx vs Google Drive

- **Search model:** Drive finds text in PDFs and images; Paperless-ngx exposes custom field queries like `custom_fields.value:1312`.
- **Receipt structure:** Drive has folders and files; Paperless-ngx adds correspondents, types, tags, storage paths, and fields.
- **Automation:** Paperless-ngx mail rules and workflows file invoices automatically. Drive lacks a receipt-first workflow layer.
- **Export:** Paperless-ngx bulk zips originals or PDF/A archives with permissions, handy at tax time.

### Paperless-ngx vs Docspell

- **Stack:** Docspell is AGPL-3.0 in Scala; Paperless-ngx is GPL-3.0 in Python/Django.
- **Automation style:** Docspell leans into processing pipelines; Paperless-ngx has workflows, mail rules, and fields in a friendlier UI.
- **OCR path:** Both use Tesseract, but Paperless-ngx uses OCRmyPDF and stores PDF/A by default.
- **Community:** Paperless-ngx has a larger user base and more community mobile apps for photographing receipts.

### Paperless-ngx vs Evernote

- **OCR scope:** Evernote offers OCR search inside notes; Paperless-ngx treats each receipt as a document with an archived PDF/A and searchable text layer.
- **Data model:** Evernote is notebook-centric; Paperless-ngx is document-centric with tags, correspondents, types, and fields.
- **Cost:** Evernote is a closed SaaS subscription; Paperless-ngx is free software you host.
- **Receipt workflows:** Evernote lacks scheduled warranty reminders or ISO 4217 monetary custom fields.

## How to use Paperless-ngx OCR (the OSS receipt and invoice archive)?

Add custom fields: `Total` as Monetary with a currency code and amount like `USD12.30`, `Invoice Number` Text, `Date Paid` Date, and `Payment Method` or `Tax Category` Select.

Under `/settings/mail`, add a mail account, create a `Paperless` folder, and move emailed receipts there.

Build a workflow triggered on Document Added with content matching `receipt|invoice`. Use Assignment to add the `Receipts` tag and an empty `Total` field. Add a Scheduled trigger on `Warranty Until` minus 30 days to send a webhook.

Make a saved view named `Receipts 2026` filtered by tag, date range, and custom field queries. Show `Total`, `Date Paid`, and `Invoice Number` columns. Bulk select documents to download a zip of originals or archived PDFs.

## How to self host Paperless-ngx OCR on other VPS Services (Paperless-ngx self hosting guide)

The official project recommends Docker Compose. The same env vars apply, but you manage volume, Postgres, Redis, and TLS.

### Clone the Repository

Clone the Paperless-ngx repo from GitHub and inspect `docker/compose`. Use the official `ghcr.io/paperless-ngx/paperless-ngx:3.3.0` image; no build is needed for a basic VPS setup.

### Install Dependencies

Install Docker Engine and the Compose plugin. Create a persistent data directory for `data`, `media`, and `consume`. Set up Postgres and Redis as containers in the same compose file or as managed services.

### Configure Environment Variables

Create a `.env` file with `PAPERLESS_SECRET_KEY`, `PAPERLESS_URL`, `PAPERLESS_DBENGINE=postgresql`, the database host, port, name, user, and password, plus `PAPERLESS_REDIS`.

### Start the Paperless-ngx OCR Application

Run `docker compose up -d` and open the public URL. Create the admin user, then repeat the custom fields, correspondents, mail rules, workflows, and saved views above.

## Official Pricing of Paperless-ngx OCR (Paperless-ngx pricing)

Paperless-ngx OCR is free under GPL-3.0. There is no official paid cloud and no per-document fee. You pay only for infrastructure, such as a small Railway service, Postgres, Redis, and volume.

## Paperless-ngx OCR cloud vs self hosted comparison (Pricing, features, costs, and more)

A cloud SaaS receipt scanner usually charges per user per month and stores documents on someone else's system. Self-hosted Paperless-ngx keeps originals and PDF/A archives on your own volume with no subscription tied to users or documents.

### Monthly cost of self hosting Paperless-ngx OCR on Railway

A small personal archive typically costs about $5 to $15 per month on Railway, depending on service size and volume storage. OCR bursts can push CPU, so size for the largest batch, not average idle load.

### System Requirements for Hosting Paperless-ngx OCR on a VPS

Paperless-ngx runs even on a Raspberry Pi, but Tesseract OCR is slow on weak CPUs. A comfortable minimum is 2 GB of RAM, more for large batches or parallel OCR through Celery.

## Frequently Asked Questions (FAQs)

### Does Paperless-ngx OCR read receipt totals automatically?

No. The OCR text layer makes the receipt searchable, but Paperless-ngx does not extract totals or line items on its own.

### How do I handle faded thermal receipts?

Photograph them early in good light; OCR quality depends on the image. Keep `PAPERLESS_OCR_LANGUAGE=eng` for English receipts, and use `PAPERLESS_OCR_LANGUAGES` only if you need a language pack not bundled.

### How do I fix US dates landing in the wrong month?

Set `PAPERLESS_DATE_ORDER=MDY` in Railway variables. Paperless-ngx guesses the document date from content, and the default order is DMY. Receipts written as `MM/DD/YYYY` will otherwise parse as day-month-year and land in the wrong month.

### How do emailed invoices get into Paperless-ngx?

Define a mail account and mail rules under `/settings/mail`. Rules filter by folder, sender, subject, body, attachment filename pattern, and max age.

### How do I find all receipts for a tax year?

Create a saved view filtered by tag, correspondent, date range, and custom field queries. For example, search `custom_fields.name:"Invoice Number" custom_fields.value:1312` to match an invoice number.

### Can my accountant see the receipts without a full account?

Yes. Each document has an owner, and you can share with another user or group through permissions. Only owners can create share links.


## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.

Open this page in a browser: https://railway.com/deploy/deploy-paperless-ngx-ocr-on-railway
