Paperless-ngx auto tagging with Ollama: step-by-step
Paperless-ngx already has built-in auto matching: it learns from the tags you assign by hand and suggests them for new documents. That works well once you have a few hundred tagged documents. A local LLM helps when you are starting out, or when you also want good titles, correspondents and dates read from the text itself.
This guide uses paperless-gpt, an open-source companion app that talks to Paperless-ngx through its API and to Ollama on your own machine. Recent Paperless-ngx releases also ship optional built-in AI suggestions that can use Ollama, and Paperless-AI is another add-on; both are covered at the end.
1. Pull a model in Ollama
paperless-gpt's README uses qwen3:8b as its Ollama example. On smaller GPUs, try a 4B model first. Pull it before you start the container.
ollama pull qwen3:8b2. Create a Paperless-ngx API token
In Paperless-ngx, open your user profile and generate an API token. paperless-gpt needs it to read documents and write tags.
3. Add paperless-gpt to your docker-compose.yml
These variable names come from the paperless-gpt README. OLLAMA_HOST must be reachable from inside the container; host.docker.internal works on Docker Desktop, on Linux use the host's IP or put Ollama in the same compose file.
paperless-gpt:
image: icereed/paperless-gpt:latest
environment:
PAPERLESS_BASE_URL: "http://paperless-ngx:8000"
PAPERLESS_API_TOKEN: "your_paperless_api_token"
LLM_PROVIDER: "ollama"
LLM_MODEL: "qwen3:8b"
OLLAMA_HOST: "http://host.docker.internal:11434"
OLLAMA_CONTEXT_LENGTH: "8192"
TOKEN_LIMIT: "2000"
LLM_LANGUAGE: "English"
volumes:
- ./prompts:/app/prompts
- ./config:/app/config
ports:
- "127.0.0.1:8080:8080"
depends_on:
- paperless-ngxDocs: paperless-gpt README
4. Tag documents to process them
paperless-gpt watches for two tags. Add paperless-gpt to a document to review suggestions in its web UI on port 8080 before applying them. Add paperless-gpt-auto to apply titles and tags automatically; it then adds paperless-gpt-auto-complete when done. To tag every new upload, create a Paperless-ngx workflow that assigns paperless-gpt-auto on consumption.
By default the model only picks from tags that already exist. Set CREATE_NEW_TAGS to true if you want it to create new ones, but expect tag sprawl.
5. Tune it for a small local model
Keep TOKEN_LIMIT low (1000 to 2000) so long documents are cut before they overflow the model, and set OLLAMA_CONTEXT_LENGTH to a context size your GPU can hold. Edit the tag prompt in the Settings page to list the tags you really use. Start with the manual tag on 20 documents and check the results before turning on auto.
6. Keep it private
paperless-gpt has no login of its own. Its README warns that anyone who can reach the port can change your documents, so bind it to 127.0.0.1 as above, or put it behind a reverse proxy with authentication.
Alternative: Paperless-ngx's built-in AI suggestions
Newer Paperless-ngx versions include optional AI features, off by default. Set PAPERLESS_AI_ENABLED, PAPERLESS_AI_LLM_BACKEND to ollama, PAPERLESS_AI_LLM_MODEL, and PAPERLESS_AI_LLM_ENDPOINT to your Ollama server. You then get AI suggestions for title, tags, correspondent and dates via the Suggest button on a document, rather than fully automatic tagging. Check that your version has these settings before relying on them.
Alternative: Paperless-AI
Paperless-AI also tags documents with Ollama and adds a chat over your archive. Its README now says the repo is not currently maintained, so check its status before relying on it.
Docs: Paperless-AI on GitHub · Paperless-ngx matching and AI docs
Real setups on LocalUseCases
People running this today:
- Auto-tagging documents in Paperless-ngx with Ollama
- Paperless AI on an 8 GB RTX 3060 Ti shared with Frigate
- PaperCortex: Local AI Receipt Extraction and Bank Matching
More guides
- How to Run an LLM Locally (Ollama, LM Studio, llama.cpp)
- Local LLMs for Writing: 21 Real Private Setups
- Ollama use cases: 27 real local AI setups that work
- Ollama vs LM Studio: Which Should You Run Locally?
- Frigate Ollama setup: search camera footage in plain words
- MCP Use Cases: Practical Local AI Workflows