Papra
Self-hosted document archiving with email ingestion, OCR full-text search, and pluggable storage — store once, find anything.
Papra is a self-hosted document management and archiving platform built for individuals and small teams who need a reliable, privacy-respecting place to store important documents for the long term. Think receipts, warranties, scanned contracts, tax documents — anything you need to store now and retrieve years later. Its minimalist philosophy means it stays out of your way while giving you powerful tools to stay organised.
Documents reach Papra in multiple ways: drag-and-drop uploads through the web interface, forwarding email attachments to a unique generated address, or dropping files into a monitored folder on your server. Once ingested, Papra’s built-in OCR engine (powered by the project’s own @papra/lecture package) extracts readable text from PDFs, images, and scanned documents, making every page searchable through a custom query language that supports filters, boolean operators, and tag-based qualifiers.
The backend is built on HonoJS and Drizzle ORM with SQLite (or LibSQL/Turso for production), with CadenceMQ — a job queue built by the Papra team specifically for self-hosted scenarios — handling background ingestion tasks without requiring Redis or RabbitMQ. Storage is pluggable across local filesystem, S3-compatible object stores, and Azure Blob Storage, with optional per-document AES encryption using key-encryption-key (KEK) rotation built directly into the storage layer.
Team and household use is covered through organisations: create a shared workspace, invite members with role-based access, and apply automated tagging rules that categorise documents based on their content, filename, or source. The project ships REST API endpoints, an official CLI, a JavaScript SDK, and webhook support, making it straightforward to integrate Papra into existing automation workflows.
What You Get
- Email ingestion - Every organisation gets a unique generated email address; forward receipts, attach files, and they land automatically in your archive with correct MIME-type detection even for mis-declared attachments.
- Folder ingestion - Mount a local or network directory and Papra watches it continuously, importing any new file automatically — including Synology-specific file exclusions to avoid noise.
- OCR and content extraction - The built-in
@papra/lecturepackage extracts text from PDFs, RTF, DOCX, XLSX, PPTX, ODF formats, and rasterised images via Tesseract, making every page fully searchable. - Advanced search syntax - A custom query language with boolean operators (
AND,OR,NOT), field filters (tag:invoice,has:tags,date:>2024-01-01), and phrase matching powers the search experience across all ingested content. - Automated tagging rules - Define per-organisation rules that inspect document fields and automatically apply tags when content matches, eliminating manual categorisation for recurring document types.
- Pluggable encrypted storage - Store files on the local filesystem, any S3-compatible service, or Azure Blob; wrap storage in transparent per-document AES encryption with KEK rotation without changing the rest of the application.
- Organisations and roles - Create shared workspaces with user invitations, role-based access, and configurable per-organisation limits on tags and storage, supporting households and small teams.
- Document sharing - Share individual documents with external users via time-limited links that optionally require a password, without granting them access to the broader archive.
- Custom properties - Define per-organisation metadata fields and attach structured additional information to any document, extending the data model without schema migrations.
- API, SDK, CLI, and webhooks - A full REST API, official JavaScript SDK, command-line tool, and webhook system let you automate ingestion, trigger external workflows on new documents, and build custom integrations.
Common Use Cases
- Household receipt and warranty archive - A family forwards email receipts and purchase confirmations to their Papra address and drops scanned warranty cards via the mobile browser upload, then searches by product name or store years later when a device needs a claim.
- Freelancer tax document management - A self-employed designer saves every invoice and expense receipt via email ingestion, applies tagging rules to auto-label by client or tax year, and exports batches at filing time using the API.
- Small business contract retention - A small firm’s administrator drops scanned contracts into a watched network folder; Papra extracts text via OCR, auto-tags by client name using content rules, and team members retrieve specific clauses through full-text search.
- Personal finance document centralisation - A user routes bank statements and insurance policies from multiple email providers to Papra’s unique address, keeps them searchable without a cloud subscription, and shares individual policy documents with a partner via expiring links.
Under The Hood
Architecture Papra is structured as a pnpm monorepo with a clean split between two deployed applications and a set of independently versioned packages. The server follows a domain-driven use-case pattern: every feature area owns its repository, use-cases, routes, and type definitions, with no cross-domain direct imports. Service dependencies are passed via functional factory injection rather than class constructors or a DI container, making each module straightforwardly unit-testable. The storage layer, search layer, and encryption layer each implement a provider registry pattern — storage drivers for filesystem, S3, and Azure Blob are interchangeable, the search provider is currently SQLite FTS5, and encryption wraps any driver transparently as a decorator without leaking into the rest of the codebase. This means adding a new storage backend or search engine requires no changes to document use-cases.
Tech Stack
The backend runs on Node.js with HonoJS for HTTP routing, Drizzle ORM against LibSQL (a SQLite-compatible fork), and Better Auth for user authentication including two-factor authentication and SSO provider support. Background ingestion jobs run through CadenceMQ, a job queue the Papra team built and open-sourced specifically to avoid requiring Redis or RabbitMQ in self-hosted deployments. Document text extraction uses the project’s own @papra/lecture library, which dispatches across ten document types including Tesseract-powered OCR for images. The frontend is SolidJS with TanStack Query, UnoCSS atomic styling with Tabler Icons, and a custom query parser (@papra/search-parser) that tokenises, builds an AST, and optimises search expressions before sending them to the server. The monorepo also ships an official CLI, a typed JavaScript SDK, and a webhooks package.
Code Quality
The codebase has comprehensive test coverage with close to 200 test files spanning unit tests and integration tests, the latter using containerised dependencies for realistic scenarios. Every module defines typed error classes with string codes rather than swallowing exceptions or throwing generic errors, giving callers explicit error handling paths. The safely and safelySync wrappers from the project’s own utilities library enforce that asynchronous calls are either explicitly handled or propagated, eliminating silent failures. TypeScript strict mode is enforced throughout with Valibot schemas validating all API boundaries. Linting and formatting use the fast oxlint and oxfmt toolchain, and GitHub Actions runs type checking, linting, testing, and Docker builds on every pull request.
What Makes It Unique
Papra is unusual in the self-hosted document management space for building its own infrastructure rather than depending on heavy external services. CadenceMQ eliminates the Redis/job-queue complexity that tools like Paperless-ngx require. The @papra/search-parser package implements a genuine query language with an AST optimizer — not just keyword matching — enabling case-insensitive tag filters, presence queries, and boolean expressions at the database layer. Per-document encryption with KEK rotation is implemented as a transparent stream transformer layered on top of the storage driver, meaning encryption adds no complexity to document use-cases while remaining configurable and rotatable. These choices reflect a deliberate philosophy of making self-hosting as operationally simple as possible without sacrificing capability.
Self-Hosting
Papra is licensed under the GNU Affero General Public License version 3 (AGPL-3.0). This is a copyleft licence that grants anyone the right to use, modify, and distribute the software freely, including for commercial purposes. The critical implication of AGPL over the standard GPL is the network provision: if you run a modified version of Papra as a service for others — even internally within an organisation — you are required to make your modifications available under the same licence. For most self-hosters running Papra for their own use or their own team without distributing a modified service externally, the AGPL imposes no practical restrictions.
Running Papra yourself is intentionally low-overhead. The entire application ships as a single Docker container with a docker run one-liner requiring only an AUTH_SECRET environment variable to start. SQLite (via LibSQL) is the default database, so there is no separate database service to manage. Document storage defaults to the local filesystem and can be switched to S3 or Azure Blob via environment variables. Background job processing uses the bundled CadenceMQ driver with an in-memory or LibSQL backend, removing any dependency on Redis or RabbitMQ. The main operational responsibilities are securing the instance, setting up regular backups of the SQLite database file and storage volume, and applying updates — a frequent cadence given the project releases roughly weekly.
Papra does not currently offer a paid managed hosting tier. There is an active roadmap for a cloud product and a demo instance at demo.papra.app, but self-hosting is the only production path available today. This means you own the full operational burden: uptime, backups, SSL termination, and monitoring are entirely your responsibility. The trade-off is complete control over your data with no third-party access, no usage-based pricing, and the ability to deploy on any infrastructure that can run Docker — from a home server to a cloud VM.
Related Apps
Paperless-ngx
Bookmarks Archiving
Turn your paper pile into a searchable digital archive with OCR, AI classification, and automated workflows — all running on your own server.
Paperless-ngx
GPL 3.0ArchiveBox
Bookmarks Archiving
Self-hosted web archiving that saves HTML, PDFs, screenshots, media, and code in open formats you own forever
ArchiveBox
MITKarakeep
Bookmarks Archiving
Self-hosted bookmark manager that captures links, notes, images, and PDFs with AI tagging, full-text search, and automatic archiving.