---
title: Deploy Docspell with AI on Blossom
url: "/deploy/docspell/"
canonical_url: https://blossom88.com/deploy/docspell/
markdown_url: https://blossom88.com/deploy/docspell.md
summary: Run a private document archive, upload a PDF, and find it again by tag.
categories:
- deployment
- documents
stack:
- Scala
- Elm
- PostgreSQL
---

# Deploy Docspell with AI on Blossom

[Docspell](https://docspell.org/) is an open-source archive for PDFs and
other documents. Start with one upload and a tag you can use to find it
again.

## Ask Your Agent

> **Ask your AI agent:** Deploy Docspell on Blossom with managed PostgreSQL. Help me upload a sample PDF and find it by tag.
>
> Follow this guide: https://blossom88.com/deploy/docspell/

[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).

## Have Ready

- **x86 Location** (Required): The two pinned Docspell images use x86.
- **Managed PostgreSQL** (Required): Link one empty database to the web and worker Services at initial setup.

## How It Runs

| Part | Role | Where |
|---|---|---|
| Docspell REST server | Serve the document archive and upload form | Web Service with Blossom Account access |
| joex | Process the uploaded documents | Private worker Service |
| PostgreSQL | Keep accounts, document records, tags, and original files | Blossom Managed Data |

## Deploy Docspell

Run the REST server and the joex worker as separate Services. Link both
to managed PostgreSQL. Enable Blossom Account access for the web Service.

<details class="optional-reading" markdown="1">
<summary>Notes for your agent</summary>

Use the [Docspell 0.43.0 images](https://github.com/eikek/docspell/releases/tag/v0.43.0)
on x86. The tested REST and joex image references are pinned below.

| Service | Image | Port |
| --- | --- | ---: |
| REST | `ghcr.io/docspell/restserver@sha256:bc8f0c0e072726aca121f07b9f4519ea8360ee3e0a6464f4cd960d3260093826` | 7880 |
| joex | `ghcr.io/docspell/joex@sha256:19c8daf22de5ff7625c16abb319c6bcb1354ada0782bd546d91b2be72acbb34f` | 7878 |

Set
`DOCSPELL_SERVER_INTERNAL__URL` and `DOCSPELL_JOEX_BASE__URL` to the
corresponding private Service URLs. Keep joex private. Start the REST
Service first so it can prepare the database, then scale joex to one
Container.

Link PostgreSQL as `DOCSPELL_DATABASE_URL`. Run the
[startup wrapper](/deploy/recipes/docspell/launcher-runtime.py) using
`python3`, with `rest` or `joex` for each Service. It reads the Link
for JDBC and sets the REST server's external base URL from the generated
HTTPS address. Keep the REST server's auth secret and invite password in
protected Environment variables. Set signup mode to `invite` for the
sample account.

Give joex at least a medium Container for this workflow. The sample
worker uses `-Xmx825m`. The
[database file backend](https://docspell.org/docs/configure/file-backends/)
keeps originals in PostgreSQL with the document records.

</details>

<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom app_plan:preview --data docspell-plan.yml
    blossom database_instance:create --data docspell-postgres.yml
    blossom app:create --data docspell-app.yml
    blossom environment:create --data docspell-environment.yml
    blossom environment_link:create --data docspell-postgres-link.yml
    blossom service:create --data docspell-rest.yml
    blossom service:create --data docspell-joex.yml
    blossom env_var:push --environment environment-100 --file docspell.env
    blossom environment:deploy --id environment-100 --follow
    blossom service:scale --id service-joex --desired-size 1 --follow

</details>

## Create an Invited Account

Create one Docspell invitation and use it to register a sample workspace.
Sign in through the private HTTPS address.

> **Ask your AI agent:** Create an invitation for my sample Docspell workspace and help me sign in.

> Follow this guide: https://blossom88.com/deploy/docspell/



## Find a PDF by Its Tag

Upload a sample PDF and wait for it to appear in the archive. Give it the
tag **harbor-intake**, search for `tag:harbor-intake`, and open the result.

![Find the sample PDF in Docspell search.](/deploy/assets/images/docspell/docspell-tagged-results.webp)

> **Ask your AI agent:** Upload a sample PDF to Docspell, tag it harbor-intake, and open the matching search result.

> Follow this guide: https://blossom88.com/deploy/docspell/



## Keep It Running

Keep the PostgreSQL Link and auth secret across updates. In the test
Environment, replace both Containers, sign in, and download the original
PDF from the same tagged item.

![Reopen the tagged item and its attachment controls.](/deploy/assets/images/docspell/docspell-original-pdf.webp)


> **Ask your AI agent:** Replace the Docspell demo Containers and reopen the same tagged item and its original PDF.

> Follow this guide: https://blossom88.com/deploy/docspell/



## What You Get

- A document archive protected by Blossom Account access
- A sample PDF processed by the worker
- A tag you can use to find the original document
- A document you can reopen after replacing the app Containers

Tested on Blossom: The original tagged PDF reopened after replacing both Docspell Containers, and its downloaded bytes matched the upload.
