Smart Document Management on a QNAP NAS with Paperless, GPT & Docker

Build an AI-powered document management system on your QNAP NAS using Paperless, GPT, and Docker Compose.

Managing paperwork can be a nightmare. Bills, contracts, receipts, forms—they pile up fast. That’s why I wanted a solution that not only digitizes my documents but makes them searchable, categorized, and even summarized with a bit of AI help. In this post, I’ll walk you through how I built a smart, AI-powered document management system on my QNAP NAS using Docker Compose. The backbone? Paperless-ngx, boosted with GPT capabilities, running entirely on local hardware.

Let’s dive in!

🧱 Tech Stack Overview

Here’s a quick breakdown of the components in this setup:

  • Paperless-ngx: The main DMS—scans, OCRs, tags, and archives your documents.
  • PostgreSQL: Stores metadata and app data for Paperless.
  • Redis: Speeds up Paperless by caching and brokering background tasks.
  • Apache Tika: Extracts text from PDFs and other file formats.
  • Gotenberg: Converts office docs (Word, Excel, etc.) to PDF.
  • Paperless-GPT: Adds intelligent tagging, summarization, and question answering with LLMs, the used model is mistral-small3.2.
  • Ollama: Local LLM runner for Paperless-GPT (supports LLaMA 3 and Minicpm-v).
  • Paperless-AI: Adds AI-based document classification and OCR improvements using the llama3.3:latest model.
  • phpPgAdmin: Optional GUI to view/manage the PostgreSQL database.

🛠️ System Architecture Walkthrough

At the core is the docker-compose.yml file that spins up everything in one go. Here’s the high-level structure:

  • paperless-ngx connects to postgres and redis
  • Tika and Gotenberg are added as external services for document parsing
  • ollama runs locally and serves the LLaMA 3 + Minicpm-v models
  • paperless-gpt sits between Paperless and Ollama for smart features
  • paperless-ai uses the llama3.3:latest model for AI classification and document understanding
  • All services use shared volumes for easy data access and persistence


👉 Full Compose File: See full docker-compose.yml on GitHub Gist

🧠 Paperless-GPT + Paperless-AI + Ollama: AI That Works for You

Paperless-GPT

Paperless-GPT enables:

  • OCR with LLM Model: mistral-small3.2
  • AI-generated tags and categories

It connects to Ollama, which runs models like LLaMA 3 and Minicpm-v locally—so no cloud dependency, no data leaving your NAS.

Paperless-AI

This component enhances document classification and tagging. It uses:

  • LLM Model: llama3.3:latest

Together, these models boost accuracy, detect layout structures, and offer smarter classification than basic OCR.

🛠️ Deployment Tips for QNAP NAS Users

Running Docker on QNAP is straightforward, but there are some things to watch out for:

  • Use Container Station or SSH: Either use QNAP’s Container Station GUI or SSH into your NAS for full control.
  • Volume mounts: Map your document folders like /share/Container/paperless/data, /media, and /consume to make documents available.
  • Port mapping: Avoid conflicts with existing NAS services—adjust ports: in Compose if needed.
  • Model downloads: LLaMA 3 and Minicpm-v are large. You may want to download them on a PC and copy them to your NAS.
  • Memory matters: Ensure your NAS has enough RAM—8GB minimum recommended.

📄 Real-World Use Cases

This setup isn’t just for nerds like me. It can serve real needs:

  • Personal Archiving: Digitize and search old letters, bills, medical records.
  • Home Office: Store tax documents, invoices, contracts.
  • Legal Practices: Use AI to summarize case files, find key points fast.
  • Medical Offices: OCR for patient records, searchable notes.

It’s a system that grows with your needs and adapts with smarter AI features.

🔮 What’s Next?

Here are a few improvements I’m planning:

  • Voice command integration ("Scan and tag this receipt")
  • Multi-user support with permission roles
  • Backup to cloud (encrypted!)
  • Better mobile interface or integration with Nextcloud

🏁 Final Thoughts

Setting up a smart document system with AI on a QNAP NAS isn’t just possible—it’s powerful. With the combo of Paperless-ngx, Paperless-GPT, Paperless-AI, and Ollama, your documents are not just stored, they’re alive, searchable, and smart.

If you’re into self-hosting and want control and privacy over your data, this setup is totally worth it.

Happy scanning! 🧾️🤖