paperless-ngx

by ScriptonBasestar

Helm chartv0.4.0App 2.19.6BSD-3-Clause

A powerful open-source document management system with OCR, full-text search, and modern web UI

About this chart

Paperless-ngx Helm Chart

A powerful document management system with OCR, full-text search, and modern web UI for Kubernetes.

Features

  • 📄 Document Management: Scan, index, and archive documents with OCR
  • 🔍 Full-Text Search: Find documents instantly with powerful search
  • 🏷️ Smart Tagging: Auto-tag documents with machine learning
  • 📧 Email Integration: Import documents from email
  • 📱 Mobile Apps: iOS and Android support
  • 🔐 Multi-User: User management with permissions
  • 🌍 Multi-Language OCR: Support for 100+ languages

Prerequisites

Deployment Scenarios

This chart includes three pre-configured deployment scenarios optimized for different use cases:

Home Server (values-home-single.yaml)

Minimal resources for personal servers, home labs, Raspberry Pi, or Intel NUC:

helm install paperless-home charts/paperless-ngx \
  -f charts/paperless-ngx/values-home-single.yaml \
  --set postgresql.external.password=your-db-password \
  --set postgresql.external.host=postgres.default.svc.cluster.local

Resource allocation: 100-500m CPU, 256-512Mi RAM, 15Gi total storage (4 PVCs)

Startup Environment (values-startup-single.yaml)

Balanced configuration for small teams, startups, and development environments:

helm install paperless-startup charts/paperless-ngx \
  -f charts/paperless-ngx/values-startup-single.yaml \
  --set postgresql.external.password=your-db-password \
  --set postgresql.external.host=postgres.default.svc.cluster.local

Resource allocation: 250m-1000m CPU, 512Mi-1Gi RAM, 50Gi total storage (4 PVCs)

Production HA (values-prod-master-replica.yaml)

High availability deployment with monitoring and enhanced storage:

helm install paperless-prod charts/paperless-ngx \
  -f charts/paperless-ngx/values-prod-master-replica.yaml \
  --set postgresql.external.password=your-db-password \
  --set postgresql.external.host=postgres.default.svc.cluster.local

Features: PodDisruptionBudget, NetworkPolicy, ServiceMonitor, enhanced OCR resources

Resource allocation: 500m-2000m CPU, 1-2Gi RAM, 200Gi total storage (4 PVCs)

For detailed comparison and configuration examples, see the Scenario Values Guide.

  • Kubernetes 1.22+
  • Helm 3.0+
  • External PostgreSQL 13+ (required)
  • External Redis 6+ (required)
  • PersistentVolume provisioner

Quick Start

1. Prepare External Services

# Install PostgreSQL (example using sb-helm-charts)
helm install postgres ./charts/postgresql \
  --set auth.database=paperless \
  --set auth.username=paperless \
  --set auth.password=paperless123

# Install Redis
helm install redis ./charts/redis

2. Generate Secret Key

openssl rand -base64 32
# Save this for values.yaml

3. Install Paperless-ngx

Create my-values.yaml:

paperless:
  adminUser: "admin"
  adminPassword: "changeme123"
  adminEmail: "[email protected]"
  secretKey: "YOUR_GENERATED_SECRET_KEY"  # From step 2
  url: "http://paperless.local"

postgresql:
  external:
    enabled: true
    host: "postgres-postgresql"
    password: "paperless123"

redis:
  external:
    enabled: true
    host: "redis"

Install the chart:

helm install paperless ./charts/paperless-ngx -f my-values.yaml

4. Access Paperless-ngx

kubectl port-forward svc/paperless-paperless-ngx 8000:8000
# Visit http://localhost:8000
# Login: admin / changeme123

Configuration

Required Settings

ParameterDescriptionExample
paperless.adminPasswordAdmin user password"changeme123"
paperless.secretKeySecret key for encryptionGenerated with openssl
postgresql.external.hostPostgreSQL host"postgres-postgresql"
postgresql.external.passwordDatabase password"dbpass123"
redis.external.hostRedis host"redis"

OCR Configuration

paperless:
  ocr:
    language: "eng+deu+fra"  # English, German, French
    mode: "skip"  # skip, redo, force

Available Languages: eng, deu, fra, spa, ita, nld, por, pol, rus, chi-sim, chi-tra, jpn, kor, ara

Persistence Configuration

persistence:
  enabled: true
  consume:
    size: 10Gi  # Incoming documents
  data:
    size: 10Gi  # Application data
  media:
    size: 50Gi  # Processed documents
  export:
    size: 10Gi  # Exports and backups

S3 Object Storage

Paperless-ngx can store documents in S3-compatible object storage instead of local PVCs, significantly reducing storage requirements.

Quick Configuration

paperless:
  extraEnv:
    - name: PAPERLESS_STORAGE_TYPE
      value: "s3"
    - name: PAPERLESS_AWS_ACCESS_KEY_ID
      valueFrom:
        secretKeyRef:
          name: paperless-s3-credentials
          key: access-key-id
    - name: PAPERLESS_AWS_SECRET_ACCESS_KEY
      valueFrom:
        secretKeyRef:
          name: paperless-s3-credentials
          key: secret-access-key
    - name: PAPERLESS_AWS_STORAGE_BUCKET_NAME
      value: "paperless-documents"
    - name: PAPERLESS_AWS_S3_ENDPOINT_URL
      value: "http://minio.default.svc.cluster.local:9000"
    - name: PAPERLESS_AWS_S3_REGION_NAME
      value: "us-east-1"

Create S3 credentials secret:

kubectl create secret generic paperless-s3-credentials \
  --from-literal=access-key-id=paperless-user \
  --from-literal=secret-access-key=paperless-secure-password

Reduced PVC Sizes with S3

When using S3 storage, reduce PVC sizes significantly:

persistence:
  data:
    size: 5Gi      # Reduced from 50Gi (only for thumbnails/cache)
  media:
    size: 2Gi      # Reduced from 10Gi (temp files only)
  consume:
    size: 2Gi      # Inbox for new documents
  export:
    size: 2Gi      # Export destination

Benefits:

  • Massive storage cost reduction (documents stored in S3, not PVCs)
  • Scalable storage independent of Kubernetes volumes
  • Simplified backup and disaster recovery
  • Multi-region replication support

For complete S3 integration guide including MinIO setup, bucket creation, and security best practices, see the S3 Integration Guide.

Email Integration

paperless:
  email:
    enabled: true
    host: "smtp.gmail.com"
    port: 587
    username: "[email protected]"
    password: "your-app-password"
    from: "[email protected]"
    useTLS: true

Document Upload Methods

1. Web UI

Visit http://your-server:8000/upload/

2. File System

Copy files to the consume directory:

kubectl cp document.pdf paperless-paperless-ngx-0:/usr/src/paperless/consume/

3. Email

Configure email settings and send documents as attachments.

4. Mobile Apps

  • iOS: Paperless Mobile
  • Android: Paperless Mobile

Production Features

High Availability

replicaCount: 2

podDisruptionBudget:
  enabled: true
  minAvailable: 1

Ingress

ingress:
  enabled: true
  className: "nginx"
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
  hosts:
    - host: paperless.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: paperless-tls
      hosts:
        - paperless.example.com

Network Security

networkPolicy:
  enabled: true
  ingress:
    - from:
        - namespaceSelector:
            matchLabels:
              name: production
      ports:
        - protocol: TCP
          port: 8000

Storage Directories

DirectoryPurposeDefault Size
/consumeIncoming documents for processing10Gi
/dataApplication data and search index10Gi
/mediaProcessed documents (PDF, thumbnails)50Gi
/exportDocument exports and backups10Gi

Operational Commands

This chart includes a comprehensive Makefile for day-2 operations:

# View logs and access shell
make -f make/ops/paperless-ngx.mk paperless-logs
make -f make/ops/paperless-ngx.mk paperless-shell

# Port forward to localhost:8000
make -f make/ops/paperless-ngx.mk paperless-port-forward

# Health checks
make -f make/ops/paperless-ngx.mk paperless-check-db
make -f make/ops/paperless-ngx.mk paperless-check-redis
make -f make/ops/paperless-ngx.mk paperless-check-storage

# Database management
make -f make/ops/paperless-ngx.mk paperless-migrate
make -f make/ops/paperless-ngx.mk paperless-create-superuser

# Document operations
make -f make/ops/paperless-ngx.mk paperless-document-exporter
make -f make/ops/paperless-ngx.mk paperless-consume-list
make -f make/ops/paperless-ngx.mk paperless-process-status

# Restart deployment
make -f make/ops/paperless-ngx.mk paperless-restart

# Full help
make -f make/ops/paperless-ngx.mk help

Troubleshooting

OCR Not Working

Check OCR language installation:

kubectl exec deployment/paperless-paperless-ngx -- tesseract --list-langs

Install additional languages:

extraEnv:
  - name: PAPERLESS_OCR_LANGUAGES
    value: "eng deu fra spa"

High Memory Usage

Adjust resource limits:

resources:
  limits:
    memory: 4Gi
  requests:
    memory: 1Gi

Slow Document Processing

Increase worker resources or add more replicas:

replicaCount: 3

resources:
  requests:
    cpu: 1000m

Values

KeyTypeDefaultDescription
paperless.adminPasswordstring""Admin password (required)
paperless.secretKeystring""Secret key (required)
paperless.urlstring"http://localhost:8000"Public URL
paperless.ocr.languagestring"eng"OCR language code
postgresql.external.hoststring""PostgreSQL host (required)
redis.external.hoststring""Redis host (required)
persistence.media.sizestring"50Gi"Media storage size

For full configuration options, see values.yaml.

Backup & Recovery

Comprehensive backup procedures ensure document safety and system recoverability.

Backup Strategy

4-Layer Backup Approach:

  1. Documents - PDF files, images, OCR data (PVCs: consume, data, media, export)
  2. Database - PostgreSQL (document metadata, tags, correspondents, custom fields)
  3. Redis - Task queue state (optional, can be rebuilt)
  4. Configuration - Kubernetes manifests, Helm values, PVC snapshots

RTO/RPO Targets:

  • RTO (Recovery Time Objective): < 2 hours
  • RPO (Recovery Point Objective): 24 hours (daily backups)

Quick Backup Commands

# Full backup (all components)
make -f make/ops/paperless-ngx.mk paperless-full-backup

# Component-specific backups
make -f make/ops/paperless-ngx.mk paperless-backup-documents
make -f make/ops/paperless-ngx.mk paperless-backup-database
make -f make/ops/paperless-ngx.mk paperless-backup-helm-values

# Create PVC snapshots (requires VolumeSnapshot CRD)
make -f make/ops/paperless-ngx.mk paperless-create-pvc-snapshots

# Incremental document backup (rsync)
make -f make/ops/paperless-ngx.mk paperless-backup-documents-incremental

# Backup to S3/MinIO
make -f make/ops/paperless-ngx.mk paperless-backup-documents-s3

Recovery Procedures

# Restore documents from backup
make -f make/ops/paperless-ngx.mk paperless-restore-documents BACKUP_DATE=20241208_100000

# Restore database from backup
make -f make/ops/paperless-ngx.mk paperless-restore-database BACKUP_DATE=20241208_100000

# Restore Helm configuration
make -f make/ops/paperless-ngx.mk paperless-restore-helm-values BACKUP_DATE=20241208_100000

# Full disaster recovery (complete system rebuild)
make -f make/ops/paperless-ngx.mk paperless-full-recovery BACKUP_DATE=20241208_100000

Document Backup Components

ComponentPathPurposeBackup Method
Consume/usr/src/paperless/consumeIncoming documentstar/rsync + PVC snapshot
Data/usr/src/paperless/dataApp data, search indextar/rsync + PVC snapshot
Media/usr/src/paperless/mediaProcessed docs, OCRtar/rsync + PVC snapshot
Export/usr/src/paperless/exportDocument exportstar/rsync + PVC snapshot

Database Backup

PostgreSQL backup via pg_dump:

# Custom format (recommended for recovery)
make -f make/ops/paperless-ngx.mk paperless-backup-database

# Plain SQL format (for version control)
make -f make/ops/paperless-ngx.mk paperless-backup-database-sql

# Schema only (for testing)
make -f make/ops/paperless-ngx.mk paperless-backup-database-schema

Key database tables:

  • documents_document - Document metadata
  • documents_tag - Tags
  • documents_correspondent - Correspondents
  • documents_documenttype - Document types
  • documents_customfield - Custom fields
  • auth_user - User accounts and permissions

Redis Backup (Optional)

Redis stores task queue state and caching data. Can be rebuilt from database if lost.

# Trigger Redis BGSAVE
make -f make/ops/paperless-ngx.mk paperless-backup-redis

PVC Snapshots (VolumeSnapshot API)

Requirements:

  • CSI driver with snapshot support
  • VolumeSnapshotClass configured
# Create snapshots for all PVCs
make -f make/ops/paperless-ngx.mk paperless-create-pvc-snapshots

# List existing snapshots
kubectl get volumesnapshot -n default

# Restore from snapshot (disaster recovery)
# See full procedure in backup guide

Backup Best Practices

  1. Daily Backups: Automate daily backups at low-traffic periods
  2. Off-Cluster Storage: Store backups in S3/MinIO/NFS (not same cluster)
  3. **3-2-1 R

Deploy paperless-ngx with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has paperless-ngx on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpaperless-ngx is pinned at v0.4.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply