---
title: "Deploy lacuna"
description: "Turn scanned PDFs into a searchable archive and reader site, with OCR"
category: "AI/ML"
url: https://railway.com/deploy/lacuna
---

# Deploy lacuna

Turn scanned PDFs into a searchable archive and reader site, with OCR

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

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

- **Creator:** Lucas Gelfond's Projects
- **Category:** AI/ML
- **Total deploys:** 5

## Template content

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

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

### lacuna

- **Source:** https://github.com/eveningsoftware/lacuna
- **Health check:** /health
- **Public domain:** Yes

## Buckets

- **bucket**

## Documentation

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


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

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