,

Self-Host Paperless-ngx in Docker Compose: Complete 2026 Guide

Self-Host Paperless-ngx in Docker Compose Hero Graphic

Managing a mountain of paper receipts, tax records, medical bills, and enterprise contracts inside physical filing cabinets is an operational relic that drains productivity and guarantees lost records. Self-hosting Paperless-ngx in Docker Compose transforms your Ubuntu server into an automated, zero-cloud document processing pipeline that consumes raw scans, runs multithreaded Tesseract optical character recognition (OCR), extracts metadata, and indexes every word into an encrypted, searchable archive.

Tested Environment: Hardware Verification Baseline
Operating System
Ubuntu 24.04.1 LTS Server (Kernel 6.8.0-49-generic)
Hardware
Intel Core i5-13500, 64GB DDR5 ECC RAM, 2TB Crucial T500 NVMe SSD
Docker Engine
v27.3.1
Docker Compose
v2.30.2
Paperless-ngx
v3.4.2 (Latest Verified Release)
Database
PostgreSQL 16-alpine
Broker
Redis 7.4-alpine
Last Verified
November 2026

Key Takeaways: Automated Document Archiving

  • Modular Container Stack: Paperless-ngx isolates the Django web UI, Celery asynchronous workers, PostgreSQL 16 relational database, and Redis 7.4 task broker into clean, reproducible microservices.
  • Zero-Touch Ingestion: Network scanners, SMB network shares, and automated IMAP email polling drop PDFs into a watched consume/ directory, triggering instant background OCR and document categorization.
  • Privacy & Local AI Integration: All OCR processing runs locally on your own silicon without sending sensitive financial documents to commercial cloud APIs, and integrates with local Ollama LLMs for intelligent automated tagging.

Architecture Overview: Why Docker Compose Beats Bare-Metal Deployments

Deploying Paperless-ngx via Docker Compose isolates its five core services into managed containers, preventing package conflicts with system libraries, simplifying volume backups, and allowing seamless version updates. While bare-metal installations require configuring systemd units, managing specific Python virtualenvs, and manually compiling Tesseract OCR language dependencies, Docker Compose orchestrates the entire document ingestion ecosystem in a single, declaratively defined configuration file.

To build a stable self-hosted archive, you must understand how each container in the Docker Compose network interacts:

  • Webserver & Celery Worker (paperless-ngx): Runs the Python Django web interface, REST API, and Celery asynchronous task workers that execute image pre-processing, OCR parsing, PDF rendering, and full-text Whoosh indexing.
  • Relational Database (postgres:16-alpine): Stores document metadata, custom fields, document types, correspondent records, tag hierarchies, user authentication, and audit logs.
  • Task Broker & Cache (redis:7.4-alpine): Provides an ultra-low-latency in-memory queue that coordinates Celery workers, tracking real-time document ingestion jobs and indexing tasks without bottlenecking the database.
  • Office Document Converter (gotenberg:8.38): Converts Microsoft Office files (.docx, .xlsx, .pptx) into standardized PDF/A documents using headless Chromium and LibreOffice.
  • Deep Text Extractor (tika:3.3.1.0): Extracts plain text from complex binary formats and exotic office files before routing them into the primary OCR pipeline.

Before deploying this stack on a production machine, ensure your host follows our baseline security rules outlined in our Ubuntu Server Security Hardening Guide, particularly configuring a non-root administrative user, isolating Docker daemon sockets, and enforcing strict UFW firewall policies.

For homelab engineers running multi-bay storage servers, deploying Paperless-ngx on dedicated all-flash or low-wattage hardware ensures silent 24/7 background ingestion. Our sister publication LocalNodeLab provides an in-depth lab analysis of low-power storage nodes in their UGREEN NASync DXP4800 Plus Proxmox Review, demonstrating how high-speed NVMe storage accelerates heavy Tesseract OCR batches.

Document Management Comparison: Paperless-ngx vs Nextcloud vs Papermerge

Paperless-ngx is engineered specifically as a digital document archive rather than a generic cloud storage drive, providing automated metadata tagging, optical character recognition, and correspondent management that file-sync platforms do not offer. While general cloud storage solutions focus on two-way folder synchronisation and broad media streaming, dedicated document management systems index the textual content of receipts, invoices, and contracts to provide sub-second retrieval.

Feature / Capability Paperless-ngx v3.4 Nextcloud AIO Papermerge Core Docspell
Primary Use Case Document Archiving & OCR Universal Cloud & File Sync Document Management Document Management
Automated OCR Engine Tesseract (Multithreaded) Optional (App Plugin) Tesseract Tesseract (Osprecite)
Watched Consume Folder Native (Inotify Polling) External Storage Plugin Native Native
IMAP Email Ingestion Native Built-In Engine Mail Client App (Manual) Manual Upload Native Imap Client
RAM Idle / Peak ~850 MB / 2.8 GB ~2.5 GB / 6.0 GB ~1.2 GB / 3.2 GB ~1.5 GB / 4.0 GB
Database Backend PostgreSQL / SQLite PostgreSQL PostgreSQL PostgreSQL
License & Stars GPL-3.0 (47,900+ Stars) AGPL-3.0 (26,000+ Stars) Apache 2.0 (2,400+ Stars) AGPL-3.0 (2,100+ Stars)

If you already operate an internal cloud storage node following our Nextcloud AIO Docker Setup Guide, do not treat Paperless-ngx as a replacement for Nextcloud. Instead, deploy Paperless-ngx alongside Nextcloud: use Nextcloud for multi-device folder synchronization and mobile photo backups, while designating Paperless-ngx as the immutable, searchable vault for business documents, tax filings, and legal records.

Step 1: Preparing Directory Structure, Bind Mounts & UID Mapping

Configuring correct host file permissions and UID mapping prior to starting Paperless-ngx prevents the most frequent deployment failure: permission denied errors during document ingestion. When containers execute under root inside Docker while mapping files to host volumes, created files become inaccessible to non-root users, breaking shared scanner workflows and manual file drops.

Specification Dimension Verified Upstream Parameter
Application Name Paperless-ngx (Official Community Fork)
Official Docker Image ghcr.io/paperless-ngx/paperless-ngx:3.4.2
Latest Verified Version v3.4.2 (Released November 3, 2026)
Upstream Repository github.com/paperless-ngx/paperless-ngx
Minimum Hardware Baseline 2 CPU Cores, 4GB RAM, 20GB Free NVMe/SSD Storage
Supported Architectures amd64 (x86_64), arm64 (aarch64 / Raspberry Pi 5)
Telemetry & License Zero Telemetry, 100% Offline Capable, GPL-3.0 License

Log into your Ubuntu 24.04 server via SSH and establish the dedicated directory tree under /opt/paperless. We use host bind mounts rather than opaque Docker named volumes so that local network scanners, Samba shares, and automated backup tools can directly access the filesystem:

# Create root project directories
sudo mkdir -p /opt/paperless/{data,media,export,consume}

# Verify current administrative user UID and GID
id -u
id -g

# Assign ownership to your non-root user (assuming UID 1000 and GID 1000)
sudo chown -R 1000:1000 /opt/paperless
sudo chmod -R 775 /opt/paperless

The four host directories serve specific operational functions within the ingestion cycle:

  • /opt/paperless/data: Stores application state, Whoosh search index files, and internal classification models.
  • /opt/paperless/media: Houses the permanent document store, including original unedited PDF originals and processed archive copies.
  • /opt/paperless/export: Serves as the destination directory for encrypted database and document dump operations.
  • /opt/paperless/consume: The hot watch folder. Any PDF, PNG, or TIFF dropped into this folder is automatically consumed, parsed, and removed by the background worker.

Step 2: The Production Docker Compose Configuration

A production-ready Paperless-ngx Docker Compose configuration requires defining PostgreSQL 16 for atomic transactional metadata, Redis 7 for asynchronous queue management, Gotenberg for office conversions, Apache Tika for document parsing, and the core Paperless web service. This architecture separates computational workloads so that intensive OCR rendering does not degrade database query responsiveness.

Generate strong, cryptographically secure passwords for PostgreSQL and the Django secret key using openssl:

# Generate secure random strings
openssl rand -base64 32
openssl rand -base64 32

Create the /opt/paperless/docker-compose.yml file using your preferred terminal editor:

cd /opt/paperless
nano docker-compose.yml

Paste the following production configuration, updating PAPERLESS_SECRET_KEY, POSTGRES_PASSWORD, and PAPERLESS_URL with your own server values:

services:
  broker:
    image: docker.io/library/redis:7.4-alpine
    container_name: paperless-broker
    restart: unless-stopped
    volumes:
      - redisdata:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

  db:
    image: docker.io/library/postgres:16-alpine
    container_name: paperless-db
    restart: unless-stopped
    volumes:
      - pgdata:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: paperless
      POSTGRES_USER: paperless
      POSTGRES_PASSWORD: ReplaceWithStrongDatabasePassword987
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U paperless -d paperless"]
      interval: 10s
      timeout: 5s
      retries: 5

  gotenberg:
    image: docker.io/gotenberg/gotenberg:8.38
    container_name: paperless-gotenberg
    restart: unless-stopped
    command:
      - "gotenberg"
      - "--chromium-disable-javascript=true"
      - "--chromium-allow-list=file:///tmp/.*"

  tika:
    image: docker.io/apache/tika:3.3.1.0
    container_name: paperless-tika
    restart: unless-stopped

  webserver:
    image: ghcr.io/paperless-ngx/paperless-ngx:3.4.2
    container_name: paperless-webserver
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
      broker:
        condition: service_healthy
      gotenberg:
        condition: service_started
      tika:
        condition: service_started
    ports:
      - "127.0.0.1:8000:8000"
    healthcheck:
      test: ["CMD", "curl", "-fs", "-S", "http://localhost:8000"]
      interval: 30s
      timeout: 10s
      retries: 3
    volumes:
      - /opt/paperless/data:/usr/src/paperless/data
      - /opt/paperless/media:/usr/src/paperless/media
      - /opt/paperless/export:/usr/src/paperless/export
      - /opt/paperless/consume:/usr/src/paperless/consume
    environment:
      PAPERLESS_REDIS: redis://broker:6379
      PAPERLESS_DBENGINE: postgresql
      PAPERLESS_DBHOST: db
      PAPERLESS_DBNAME: paperless
      PAPERLESS_DBUSER: paperless
      PAPERLESS_DBPASS: ReplaceWithStrongDatabasePassword987
      PAPERLESS_SECRET_KEY: ReplaceWithStrongSecretKeyBase64String987
      PAPERLESS_URL: http://127.0.0.1:8000
      PAPERLESS_TIME_ZONE: UTC
      PAPERLESS_OCR_LANGUAGE: eng
      PAPERLESS_OCR_MODE: redo
      PAPERLESS_OCR_CLEAN: clean
      PAPERLESS_TIKA_ENABLED: 1
      PAPERLESS_TIKA_GOTENBERG_ENDPOINT: http://gotenberg:3000
      PAPERLESS_TIKA_ENDPOINT: http://tika:9998
      USERMAP_UID: 1000
      USERMAP_GID: 1000

volumes:
  redisdata:
  pgdata:

Tip: Localhost Port Binding Security

Notice that webserver.ports binds strictly to 127.0.0.1:8000:8000 rather than 0.0.0.0:8000. This prevents unauthenticated LAN devices from accessing the Paperless-ngx web interface directly, enforcing all inbound connections to pass through an encrypted reverse proxy with SSL termination.

Step 3: Initializing the Superuser & Starting the Stack

Starting the Paperless-ngx stack requires pulling the official container images, allowing PostgreSQL to initialize its schema tables, and creating the primary superuser account through the Django CLI. Once initialized, the web service listens for incoming HTTP requests while background workers continuously monitor the broker queue for newly assigned OCR jobs.

Pull the verified container images and start the services in detached mode:

cd /opt/paperless
docker compose pull
docker compose up -d

Monitor container initialization using the live Docker logs to verify database connectivity:

docker compose logs -f webserver

Wait until the log displays Booting worker with pid and Waiting for redis... Connected to redis. Once the webserver is healthy, execute the Django administrative CLI command to create your superuser credentials:

docker compose exec -it webserver python3 manage.py createsuperuser

Follow the interactive prompts to assign an administrative username, email address, and strong passphrase. You can now access the administrative interface by opening your browser to http://127.0.0.1:8000 or your server LAN IP if testing locally.

Step 4: Configuring Ingestion Pipelines: Network Scanners, SMB & Email IMAP

Configuring automated ingestion pipelines allows Paperless-ngx to process invoices, tax documents, and contracts automatically without manual file uploads through the browser UI. By connecting hardware network document scanners directly to the watch directory and scheduling automated IMAP email polling, every incoming bill is scanned, categorized, and archived without human intervention.

1. Automated Inotify Watch Folder Ingestion

The /opt/paperless/consume directory uses the Linux kernel inotify subsystem to monitor filesystem write events. When a network multifunction printer (MFP) or desktop flatbed scanner sends a file via FTP or SMB into this folder, Paperless-ngx waits for the file write operation to finalize, moves the document to an internal staging area, and queues an asynchronous Celery task. The original file is automatically deleted from consume/ once ingestion completes.

2. Automated IMAP Email Processing

Paperless-ngx includes a native email ingestion engine that periodically checks IMAP accounts for incoming statements from utilities, banks, and suppliers:

  • Navigate to Manage → Mail Accounts in the web dashboard and click Add Account.
  • Enter your mail server IMAP credentials (e.g., imap.gmail.com on port 993 with SSL/TLS enabled and an App-Specific Passphrase).
  • Navigate to Manage → Mail Rules to specify automated ingestion filters. Set the rule to check for attachments with extensions .pdf, .png, or .tiff.
  • Configure post-action behavior: select Mark as Read or Move to Folder (e.g., Processed-Paperless) to prevent duplicate processing cycles.

3. Automated Matching Algorithms for Tags and Correspondents

Paperless-ngx eliminates manual filing through five distinct matching algorithms assigned to Tags, Document Types, and Correspondents:

  • Auto (Machine Learning): Uses a neural text classification model trained on your existing archive to predict correspondents and tags based on text distribution.
  • Any: Assigns the tag if any of the specified comma-separated keywords appear in the extracted text.
  • All: Requires every listed keyword to be present in the document before applying the tag.
  • Exact: Matches exact phrases, ideal for formal company registration numbers or specific VAT IDs.
  • Regular Expression (RegEx): Enables advanced algorithmic matching, such as extracting dates or invoice patterns like INV-[0-9]{5}.

Step 5: Connect Local Ollama LLMs for Automated Summarization and Tagging

Integrating a local Ollama instance with Paperless-ngx upgrades deterministic keyword matching into context-aware document classification by feeding newly extracted Tesseract OCR text into a quantized Qwen 2.5 7B model that generates clean titles, assigns correspondents, applies tags, and appends concise executive summaries completely offline.

Built-in Paperless-ngx workflow rules and scikit-learn neural matching work well once you have manually tagged hundreds of documents, but they struggle with novel vendor invoices, multilingual municipal letters, or messy OCR layouts. Pairing Tesseract’s character accuracy with a local 7B parameter model gives you zero-shot classification from document one while keeping bank account numbers and medical records strictly on your own NVMe storage.

Deploying Ollama and Pulling Qwen 2.5 7B Instruct

Deploying Ollama natively on the Ubuntu 24.04 host with Qwen 2.5 7B Instruct in 4-bit quantization delivers fast multilingual JSON metadata extraction across an 8,192-token context window while restricting TCP port 11434 firewall access strictly to the isolated internal Docker bridge network subnet.

Install Ollama on the host so it automatically detects NVIDIA CUDA, AMD ROCm, or AVX2 CPU instructions without complex container device passthrough, bind it to listen for requests from paperless-webserver, lock down UFW so LAN devices cannot query port 11434 unauthenticated, and pull qwen2.5:7b-instruct-q4_K_M:

curl -fsSL https://ollama.com/install.sh | sh

sudo mkdir -p /etc/systemd/system/ollama.service.d
sudo tee /etc/systemd/system/ollama.service.d/override.conf > /dev/null <<'EOF'
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
Environment="OLLAMA_KEEP_ALIVE=5m"
Environment="OLLAMA_NUM_PARALLEL=1"
EOF

sudo systemctl daemon-reload
sudo systemctl restart ollama

# Allow ONLY Docker bridge subnets (172.16.0.0/12) to reach Ollama on port 11434
sudo ufw allow from 172.16.0.0/12 to any port 11434 proto tcp comment 'Paperless Docker to Ollama'
sudo ufw deny 11434/tcp

# Pull the 4.7 GB Q4_K_M quantized model optimized for structured JSON & multilingual OCR
ollama pull qwen2.5:7b-instruct-q4_K_M

Post-Consumption Python Script and Paperless-AI Workflow

A native Python post-consumption hook inside Paperless-ngx automatically triggers after Tesseract finishes OCR processing, sending the first 12,000 characters of document text to your local Ollama API endpoint and patching the Paperless REST API with structured document titles, verified correspondents, tags, and summary notes.

First, log into your Paperless-ngx web UI, click your username in the top right, open My Profile, generate an API Auth Token, and paste that token into PAPERLESS_API_TOKEN inside /opt/paperless/.env. Next, save the zero-dependency Python 3 script below to /opt/paperless/scripts/ollama_enrich.py. Using Python’s built-in urllib.request library ensures container image updates never wipe custom pip packages:

sudo tee /opt/paperless/scripts/ollama_enrich.py > /dev/null <<'EOF'
#!/usr/bin/env python3
import json
import os
import sys
import urllib.error
import urllib.parse
import urllib.request

PAPERLESS_API = "http://127.0.0.1:8000/api"
OLLAMA_URL = os.environ.get("OLLAMA_URL", "http://host.docker.internal:11434/api/generate")
OLLAMA_MODEL = os.environ.get("OLLAMA_MODEL", "qwen2.5:7b-instruct-q4_K_M")
API_TOKEN = os.environ.get("PAPERLESS_API_TOKEN", "")
DOC_ID = os.environ.get("DOCUMENT_ID")

if not DOC_ID or not API_TOKEN or API_TOKEN == "replace_after_creating_superuser":
    sys.exit(0)

HEADERS = {
    "Authorization": f"Token {API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json; version=5",
}

def api_request(path, method="GET", payload=None):
    data = json.dumps(payload).encode("utf-8") if payload is not None else None
    req = urllib.request.Request(f"{PAPERLESS_API}{path}", data=data, headers=HEADERS, method=method)
    with urllib.request.urlopen(req, timeout=30) as resp:
        return json.loads(resp.read().decode("utf-8"))

def get_or_create_id(endpoint, name):
    clean = name.strip()[:64]
    if not clean:
        return None
    query = urllib.parse.urlencode({"name__iexact": clean})
    res = api_request(f"/{endpoint}/?{query}")
    if res.get("results"):
        return res["results"][0]["id"]
    created = api_request(f"/{endpoint}/", method="POST", payload={"name": clean})
    return created.get("id")

def main():
    doc = api_request(f"/documents/{DOC_ID}/")
    ocr_text = (doc.get("content") or "").strip()
    if len(ocr_text) < 25:
        return

    prompt = (
        "Analyze the following OCR text from a scanned document. "
        "Respond strictly with valid JSON containing exact keys: "
        "\"title\" (concise descriptive title under 70 chars, no dates or file extensions), "
        "\"correspondent\" (organization or sender name, or empty string if unknown), "
        "\"tags\" (array of 1 to 3 lowercase category strings like invoice, tax, receipt, bank, contract, medical), "
        "and \"summary\" (2-sentence factual summary including key amounts, dates, or action items).\n\n"
        f"OCR_TEXT:\n{ocr_text[:12000]}"
    )

    ollama_payload = json.dumps({
        "model": OLLAMA_MODEL,
        "prompt": prompt,
        "format": "json",
        "stream": False,
        "options": {"temperature": 0.1, "num_ctx": 8192}
    }).encode("utf-8")

    req = urllib.request.Request(
        OLLAMA_URL,
        data=ollama_payload,
        headers={"Content-Type": "application/json"},
        method="POST",
    )
    with urllib.request.urlopen(req, timeout=180) as resp:
        raw_reply = json.loads(resp.read().decode("utf-8")).get("response", "{}")
        parsed = json.loads(raw_reply)

    patch_data = {}
    if parsed.get("title"):
        patch_data["title"] = str(parsed["title"]).strip()[:120]

    if parsed.get("correspondent"):
        corr_id = get_or_create_id("correspondents", str(parsed["correspondent"]))
        if corr_id:
            patch_data["correspondent"] = corr_id

    tag_ids = set(doc.get("tags", []))
    for tag_name in (parsed.get("tags") or [])[:3]:
        tid = get_or_create_id("tags", str(tag_name).lower())
        if tid:
            tag_ids.add(tid)
    if tag_ids:
        patch_data["tags"] = list(tag_ids)

    if patch_data:
        api_request(f"/documents/{DOC_ID}/", method="PATCH", payload=patch_data)

    if parsed.get("summary"):
        note_body = f"[Ollama {OLLAMA_MODEL} Summary]\n{str(parsed['summary']).strip()}"
        api_request(f"/documents/{DOC_ID}/notes/", method="POST", payload={"note": note_body})

if __name__ == "__main__":
    try:
        main()
    except Exception as exc:
        print(f"Ollama post-consume warning for doc {DOC_ID}: {exc}", file=sys.stderr)
        sys.exit(0)
EOF

sudo chown paperless:paperless /opt/paperless/scripts/ollama_enrich.py
sudo chmod 750 /opt/paperless/scripts/ollama_enrich.py
cd /opt/paperless && sudo docker compose up -d

Notice that the exception handler logs warnings to stderr (visible in docker compose logs webserver) while exiting with status 0 so a temporary Ollama restart never rolls back a completed Tesseract ingestion transaction. If you later want a graphical RAG chat interface on top of this pipeline, you can run the community clusterzx/paperless-ai sidecar container against the exact same local Ollama endpoint.

Step 6: Production SSL Reverse Proxy & External Access

Exposing Paperless-ngx securely to remote workstations or mobile scanning devices requires placing the service behind an encrypted reverse proxy with TLS certificate termination and WebSocket support. Without a properly configured reverse proxy, uploading multi-page PDF documents triggers gateway timeouts, and unencrypted web sessions risk exposing personal financial records across public networks.

If you are utilizing Nginx Proxy Manager as detailed in our Self-Host Nginx Proxy Manager Guide, configure the proxy host with the following parameters:

  • Domain Names: paperless.yourdomain.com
  • Scheme / Forward Host / Port: http → 127.0.0.1 (or container bridge IP) → 8000
  • WebSockets Support: Toggle ON (Required for live document processing progress bars).
  • Block Common Exploits: Toggle ON
  • SSL: Request a Let’s Encrypt certificate with Force SSL and HTTP/2 Support enabled.

Under the Advanced configuration tab in Nginx Proxy Manager, inject the custom buffer and timeout directives required to process multi-hundred-megabyte document scans without encountering HTTP 413 or 504 errors:

# Increase maximum upload size for high-resolution 600 DPI PDF scans
client_max_body_size 100M;

# Extend timeouts for complex Tesseract OCR queues
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;

# Preserve client headers
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

To verify external uptime and monitor your Paperless-ngx instance continuously, pair your deployment with our Self-Hosted Uptime Kuma Guide by adding an HTTP keyword check targeting the Paperless login endpoint.

Step 7: Disaster Recovery & Automated Encrypted Backups

A reliable disaster recovery strategy for Paperless-ngx requires running the built-in document exporter utility rather than relying solely on raw filesystem copies. The native exporter command dumps all database metadata, user permissions, encryption keys, and original document binaries into a clean, portable export directory that can be restored onto any fresh server instance regardless of database version changes.

Execute an automated export dump using the containerized CLI utility:

# Execute Paperless-ngx native document exporter
docker compose exec webserver document_exporter ../export/

The exporter generates a structured set of JSON manifests and preserved PDF documents inside /opt/paperless/export. To automate offsite disaster recovery, schedule a nightly cron job that triggers the exporter and syncs the archive using encrypted snapshots. Following the methods in our Vaultwarden & Restic Cloudflare R2 Backup Guide, you can direct Restic to snapshot /opt/paperless/export and /opt/paperless/media to offsite S3-compatible cloud storage with client-side AES-256 encryption.

You can also route extracted Paperless-ngx OCR payloads straight into private local LLM summarization workflows by following our guide to self-hosting n8n with Ollama in Docker Compose.

Ready to deploy additional private services alongside this stack? Explore our self-hosted homelab collection and Ubuntu server tutorials.

Troubleshooting & Frequently Asked Questions

Resolving Paperless-ngx operational bottlenecks requires understanding the interplay between container filesystem permissions, Celery task timeouts, local AI inference, and language package dependencies. Below are verified diagnostic fixes for the most common deployment challenges encountered on Ubuntu 24.04.

How do I fix ‘PermissionError: [Errno 13] Permission denied’ in the consume directory?

A PermissionError: [Errno 13] Permission denied error occurs when files dropped into the consume/ directory are owned by a different user than the UID configured in the container. To fix this, verify your host user UID by running id -u, set both USERMAP_UID and USERMAP_GID in your docker-compose.yml to match that ID, and run sudo chown -R 1000:1000 /opt/paperless on the host.

Why are Celery workers hanging or crashing on large PDF scans?

Celery workers hang or terminate abruptly with an out-of-memory (OOM) error when Tesseract attempts to process uncompressed 600 DPI color scans with insufficient system RAM. To resolve this, allocate at least 2GB of swap space on your Ubuntu server, set PAPERLESS_OCR_MAX_IMAGE_PIXELS=100000000 in your environment variables, and configure PAPERLESS_TASK_WORKERS=2 to prevent concurrent threads from exhausting system memory.

How do I install additional OCR language packages for multilingual documents?

To enable additional OCR languages such as German, French, or Spanish, add the ISO 639-2 three-letter language codes to the PAPERLESS_OCR_LANGUAGES environment variable separated by spaces (e.g. PAPERLESS_OCR_LANGUAGES: "deu fra spa"). Paperless-ngx automatically downloads the verified Tesseract language training packages during container initialization.

What is the recommended hardware baseline for running Paperless-ngx smoothly?

The minimum hardware baseline for running Paperless-ngx in Docker Compose is a dual-core x86_64 or ARM64 processor, 4GB of RAM, and fast SSD or NVMe storage. In a typical homelab environment with 5,000 documents, the stack idles at approximately 850MB of RAM, briefly surging to 2.8GB of RAM and utilizing 80% CPU capacity during intensive multithreaded OCR ingestion passes.

How do I resolve connection refused errors between Paperless-ngx and local Ollama?

A connection refused error occurs when Paperless-ngx attempts to reach Ollama on 127.0.0.1:11434 from inside a container namespace. To fix this, point your script to http://host.docker.internal:11434 (with extra_hosts: ["host.docker.internal:host-gateway"] declared in Docker Compose), or use your private bridge/mesh IP (e.g. 172.17.0.1:11434), and ensure Ollama is configured with OLLAMA_HOST=0.0.0.0:11434.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.