I’m trialing two self-hosted document managers side by side, and I don’t have a winner. The trial is ongoing. What I do have is a build that works, a few lessons about AI-assisted filing, and a failure that taught me something about how Linux treats dependencies.

Why two

A law office is a paper-and-PDF factory. I want scans and incoming documents to land somewhere, get OCR’d, get titled and tagged, and be searchable later, without paying a monthly fee to a cloud vendor who then holds my files.

Paperless-ngx is the established answer. It’s mature, it has a deep feature set, and it’s heavy — the application, a PostgreSQL database, and a Valkey broker. Papra is the newcomer. It’s lighter, with a SQLite database and one container. I didn’t want to pick on reputation, so I put both on one machine and I’m feeding them the same kind of documents.

The setup

Both run in Docker Compose inside a single unprivileged Debian LXC container on one of my Proxmox nodes. The container has 4 cores and 6 GB of RAM. After the first migrations, the two stacks together used about 1.1 GB.

The one design decision I’d repeat: each application gets its own ZFS dataset, mounted into the container. That means each gets independent snapshots and backup policy, and the loser can be deleted without touching the winner. I almost blew this early — my first plan was a single shared /apps dataset, and I caught that it contradicted the per-application layout I’d stated. Cheap to fix on paper, annoying to fix after documents are in.

Neither app is exposed directly. A reverse proxy in front of them handles HTTPS with real certificates.

The failure: a container that quit after exactly 10 minutes

My first design had an intake folder on a separate network storage box. The nodes mounted that share on demand, and the container’s scanned-document lane pointed into it.

Then the container started shutting itself down. Gracefully, politely, and about 10 minutes after every start. No crash, no out-of-memory kill, and no matching shutdown task in Proxmox. The guest’s own log said only that systemd had received an external halt signal.

The cause took a while to see. The on-demand mount was a systemd automount with a 10-minute idle timeout. And the Proxmox unit that runs the container had been told it requires that mount path. So when the idle timer expired and systemd went to unmount the share, it first stopped everything that required it — including the container.

An ingestion convenience had become an availability dependency. A scanner folder could take down the whole document system, on a timer.

Here’s the pattern to look for if you ever see something similar:

# which units require a given mount path?
systemctl list-dependencies --reverse your-mount.mount

# what idle timeout does the automount have?
systemctl cat your-mount.automount | grep -i timeout

The first command shows what systemd will stop when that mount goes away. The second shows the timer that eventually makes it go away. If a service you care about appears in the first list, you’ve found your culprit. I did this diagnosis by reading unit files on the Proxmox host; those two commands are the generic version of that, and I haven’t run them against that setup.

The fix: rebuild, and remove the dependency

I could have patched the dependency out. Instead I used the occasion to simplify, since the trial library was nearly empty and I was happy to discard it.

I moved the intake folders onto the same node, in a small dedicated file-sharing container with its own capped dataset. The share is authenticated, and documents dropped into it from a desktop are bind-mounted straight into the document container. There’s no network mount in the chain, no automount, and no systemd dependency from the container to anything remote. Rebooting the file-sharing container no longer disturbs either application. I tested it: upload a PDF over SMB, watch Paperless consume it, delete the test record, reboot things, confirm nothing noticed.

I then destroyed and recreated the document container and both datasets, with fresh secrets and empty databases. One snag on the way back up: PostgreSQL 18 insisted that its data directory be owned by a specific user, and my first guess at ownership was wrong. The first start showed it. I removed the empty partial database, fixed ownership, and restarted.

One rule I’m keeping: the intake folders aren’t backed up. They’re a handoff lane, not storage. The applications’ own datasets get daily snapshots and are replicated to another machine.

What the trial has shown so far

Both apps can watch an intake folder. Paperless polls every few seconds and removes files after storing originals; Papra can move processed files aside. I keep the two lanes separate because both consumers post-process what they find.

I’ve also pointed both at a local language model for auto-tagging, which is where the interesting lessons are, mostly about Paperless:

  • A fresh taxonomy gives bad results. With no existing tags, the model guessed. Drawings with almost no OCR text got invented titles. Junk tags it created then became candidates for unrelated documents.
  • Tags spread by similarity. Paperless only offers the model tags already attached to similar documents. An unused starter tag is never suggested. So you seed tags by filing real documents, and prune one-offs quickly.
  • A runaway request can wedge the queue. One request reasoned until the task limit killed it 30 minutes later, blocking the single worker. The configured timeout never fired. Capping the model’s thinking budget fixed it; requests now take roughly a minute.
  • Check authorship before bulk-deleting. When I pruned AI-created junk tags, I also deleted one I’d made by hand. I recreated it, but couldn’t tell whether it had been on any document, because the audit log doesn’t record tag assignments.

On Papra, I’ve configured the same model but have less to report; its auto-tagging is opt-in per organization and I haven’t yet judged it on real documents. I won’t pretend otherwise.

What I’d tell another lawyer

If you self-host, keep your document system independent of anything optional. Intake conveniences — network shares, scanner folders — should be able to fail without taking the application down.

Keep each trial candidate on its own dataset so one can be thrown away cleanly. Don’t let AI filing run unattended until you’ve watched it on real documents. And don’t take a vendor’s word, or mine, on which of these two is better. I’m still deciding.