Deploy lacuna
Turn scanned PDFs into a searchable archive and reader site, with OCR
Just deployed
/var/lib/postgresql/data
lacuna
Just deployed
bucket
Bucket
Just deployed
Deploy and Host lacuna on Railway
lacuna turns scanned magazines, journals, and other PDFs into a searchable archive with its own reader site. Upload files in the built-in console and lacuna splits them into pages, runs OCR, embeds the text and images, and serves full-text and semantic search across every issue.
About Hosting lacuna
This template runs lacuna as a single server node next to Postgres and a Railway storage bucket. The node is built from deploys/Dockerfile.server-node, which bakes the OCR and embedding model weights into the image. Postgres holds the corpus, pipeline state, and search vectors; the bucket stores uploaded PDFs and page images. A background worker processes new uploads on its own. After the first deploy, open /edit on your domain and set a publish password: the first password sent claims the node. You can add a separate site password later to make the reader private. Search is served from Postgres by default, with Turbopuffer as an option.
Common Use Cases
- Publishing a searchable archive of a magazine's or journal's back issues
- Making a private collection of scanned documents searchable by text and by meaning
- Hosting a password-protected reader for research material
Dependencies for lacuna Hosting
- PostgreSQL (included in this template)
- S3-compatible object storage (included as a Railway bucket)
- Optional: a Turbopuffer API key, to serve search from a Turbopuffer index
Implementation Details
The service listens on port 8080 and exposes a health check at /health. Database and bucket credentials are wired in automatically through reference variables (DATABASE_URL, AWS_ENDPOINT_URL, AWS_S3_BUCKET_NAME, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY). Set QUERY_PROVIDER=turbopuffer and TURBOPUFFER_API_KEY to search from Turbopuffer instead of Postgres.
Why Deploy lacuna 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 lacuna 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
