Paperless-ngx, Ollama and vision OCR: Docker setup

Set up Paperless-ngx in Docker, add optional Ollama metadata processing, and compare baseline OCR with MiniCPM-V on sample documents.

Player not loading? Watch on YouTube

This tutorial builds a self-hosted Paperless-ngx document stack with Docker Compose, then adds optional local AI. Paperless-ngx handles document storage, indexing and basic OCR on its own. The demonstrated stack uses PostgreSQL alongside Redis, Gotenberg and Tika, with separate environment files for service secrets.

The setup covers admin accounts, a Paperless API token and model downloads through Open WebUI. Ollama runs the models locally. Paperless-AI uses document text to suggest titles, tags, correspondents and document types. The speaker also demonstrates document questions and RAG chat after indexing a collection of generated sample files.

The distinction between metadata and OCR matters here: Paperless-AI adds labels but leaves the existing extracted text unchanged. Paperless-GPT supplies the vision OCR step, using the 8-billion-parameter MiniCPM-V model. In the speaker's examples, it recovers a camera serial number that baseline OCR missed and converts a sample tax document into Markdown with a table and watermark text.

The final workflow assigns tags when documents arrive so Paperless-GPT can process them automatically. Results still need review: the examples include an unexplained Amazon correspondent and an incorrect description of shapes in a diagram. The demonstrated improvements apply to these samples, rather than establishing accuracy across all documents.