Deploy Paperless-ngx | (Just Updated) Document Management With OCR That Boots
Boots on first deploy, seeds your admin, and OCRs at your real CPU count
paperless
Just deployed
/data
redis
Just deployed
/data
postgres
Just deployed
/var/lib/postgresql
Deploy and Host Paperless-ngx on Railway
Paperless-ngx is an open-source document management system. It ingests scans, PDFs and photographs, runs OCR over them, extracts dates, correspondents and tags, and gives you a full-text-searchable archive of everything you would otherwise keep in a filing cabinet.
This template runs Paperless-ngx 3.1.1 as three services: the application on a persistent volume, PostgreSQL, and Redis.
About Hosting Paperless-ngx
Paperless-ngx is a Django application with a Celery worker, and it needs three things to be usable on a platform like Railway: a reachable Redis broker, a persistent volume for the documents, and an administrator account. It has no signup page, and its password reset is an emailed link, so an instance that boots without an account is an instance nobody can ever log into. It also derives its OCR thread pool from the number of CPU cores it can see, which inside a container is the host's core count rather than the plan's quota.
This template handles all four points: Redis is deployed with a working configuration and a generated password, the data directory, media and consume folders all live under one volume, the administrator is seeded before the port opens and re-applied on every boot, and the OCR thread pool is sized from the container's actual CPU quota.
Why Deploy Paperless-ngx 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 Paperless-ngx 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.
A document archive is a long-lived, always-on workload: the consumer watches for new files, the worker OCRs them, and the index has to stay warm for search. Railway's usage-based billing suits that better than a fixed instance, and the volume keeps every document across redeploys.
Common Use Cases
- A searchable personal or household archive of bills, contracts, receipts and letters.
- A small business's document store, with tags and correspondents replacing folder trees.
- An OCR pipeline for scanned paperwork, feeding a full-text search index and a REST API.
- Long-term retention of records that need to be found again years later.
Dependencies for Paperless-ngx
- PostgreSQL, for documents' metadata, tags, correspondents and users.
- Redis, as the Celery broker for the consumer and OCR tasks.
- A Railway volume mounted at
/datafor the data directory, media and consume folders.
Deployment Dependencies
- Paperless-ngx source and documentation: https://github.com/paperless-ngx/paperless-ngx
- Upstream is licensed GPL-3.0.
Implementation Details
Every variable carries a working default, so the deploy form asks for nothing:
PAPERLESS_ADMIN_PASSWORD— generated per deploy. Change it in the Railway variables panel and redeploy; the new password is applied on the next boot, which is the only recovery path an instance with no SMTP has.PAPERLESS_SECRET_KEY— generated per deploy and stable across redeploys.PAPERLESS_URL— your public Railway domain.- The database and Redis credentials are wired between the services for you.
Log in at your public URL as admin with the generated password. Drop files into the consume
directory, or upload them through the web UI, and Paperless-ngx will OCR, tag and index them.
Template Content
PAPERLESS_DBNAME
PAPERLESS_DBPORT
PAPERLESS_DBUSER
PAPERLESS_DBENGINE
redis
redis:8.2.1-alpinepostgres
postgres:17.10-alpinePOSTGRES_DB
POSTGRES_USER