---
title: Deploy Paperless-ngx with AI on Blossom
url: "/deploy/paperless-ngx/"
canonical_url: https://blossom88.com/deploy/paperless-ngx/
markdown_url: https://blossom88.com/deploy/paperless-ngx.md
summary: Deploy Paperless-ngx with AI on Blossom. Turn scanned PDFs into searchable
  documents with OCR, managed PostgreSQL and Redis, and persistent file storage.
categories:
- deployment
- productivity
stack:
- Python
- Django
- Angular
- PostgreSQL
- Redis
---

# Deploy Paperless-ngx with AI on Blossom

[Paperless-ngx](https://docs.paperless-ngx.com/) turns scanned paperwork into a
searchable document library. Upload a scan, let OCR read its text, and find it
later without remembering the filename.

## Ask Your Agent

> **Ask your AI agent:** Deploy Paperless-ngx on Blossom with managed Postgres. Help me turn scanned PDFs into searchable documents.
>
> Follow this guide: https://blossom88.com/deploy/paperless-ngx/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and [choose a Location in your cloud account](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#connect-your-provider).

## Your Document Library Setup

| Part | Purpose |
|---|---|
| Persistent Paperless-ngx Service | Dashboard, OCR workers, originals, and searchable archives |
| Managed PostgreSQL | Accounts, document records, and extracted text |
| Managed Redis | Background processing coordination |

A [Persistent Service](/docs/apps/persistent-services/) keeps
originals and searchable archives. PostgreSQL stores records and extracted
text; Redis coordinates processing. Keep one application Container, protected
by Blossom Account access and Paperless sign-in.

![Paperless-ngx displaying a scanned sample invoice and its extracted text.](/deploy/assets/images/paperless-ngx/document.png)

<details class="optional-reading" markdown="1">
<summary>Deployment setup and commands</summary>

Upstream requirements: [deployment requirements](https://docs.paperless-ngx.com/setup/).

Keep the dashboard behind **Blossom Account access** and Paperless sign-in.
Create the owner privately and keep the application secret stable.

[Source code](https://github.com/paperless-ngx/paperless-ngx).

Create a prebuilt-image Environment, managed PostgreSQL and Redis, then connect
and configure the Service:

    blossom app:create --data app.yml
    blossom environment:create --data environment.yml
    blossom database_instance:create --data postgres.yml --follow
    blossom cache_instance:create --data redis.yml --follow
    blossom environment_link:create --data database-link.yml
    blossom environment_link:create --data redis-link.yml
    blossom env_var:push --environment environment-100 --file .env.production
    blossom service:create --data paperless-service.yml
    blossom environment:deploy --id environment-100 --follow

Use a stable `PAPERLESS_SECRET_KEY`, a private initial administrator password,
and the generated public URL for `PAPERLESS_URL`. Map the linked database URL
to Paperless's `PAPERLESS_DB*` settings and use the linked Redis URL for
`PAPERLESS_REDIS`.

Mount a Volume at `/usr/src/paperless/data`. Set `PAPERLESS_MEDIA_ROOT` and
`PAPERLESS_CONSUMPTION_DIR` to subdirectories of that mount so originals,
archives, and consumed files survive replacement. Keep
`PAPERLESS_DATA_DIR` on the same Volume. Review any additional export or
custom-script paths against the selected release's storage requirements.

Start the image through its supported `/init` entrypoint, which prepares the
application and starts its processes. Give initialization and OCR enough
memory and startup time. Use Python's HTTP client for the readiness command;
request `http://localhost:8000/` so the probe uses a hostname the application
allows. The image does not need curl for that check.

Keep one Container attached to this Volume. For updates, stop it before
starting its replacement:

    blossom service:scale --id service-100 --desired-size 0 --follow
    blossom environment:deploy --id environment-100 --follow
    blossom service:scale --id service-100 --desired-size 1 --follow

</details>

## Turn a Scan Into a Searchable Document

Upload a PDF or image and wait for OCR. Search for a word printed on the page,
then download the original and searchable archive. The archive adds a text
layer you can search in a PDF reader.

<details class="optional-reading" markdown="1">
<summary>Updates and storage</summary>

Preserve the Volume, PostgreSQL, Redis, and application secret. After the
replacement starts, sign in again, search for a saved document, and download
both versions. Upload another scan to check that the new OCR worker can
process documents too.

</details>

## What You Get

- A private, searchable document library
- OCR for scanned PDFs and images
- Original files and searchable archives on a persistent Volume
- Managed PostgreSQL and Redis, with documents that survive Container replacement
