shrirambo.github.io/home/blog

Paperless-ngx setup


Paperless-ngx is a fork of paperless-ng which is in turn a fork of paperless. This is a server app to manage documents, tag, organize and even perform OCR on documents. Here is my docker-compose setup for paperless-ngx.

Redis broker

version: "3.4"
services:
  broker:
    image: redis:6.0
    name: paperless-redis-broker
    restart: unless-stopped
    volumes:
      - /mnt/local/appdata/paperless-ngx/redisdata:/data

Postgres database

db:
  image: postgres:13
  name: paperless-db
  restart: unless-stopped
  volumes:
    - /mnt/local/appdata/paperless-ngx/pgdata:/var/lib/postgresql/data
  environment:
    POSTGRES_DB: paperless
    POSTGRES_USER: paperless
    POSTGRES_PASSWORD: paperless

Paperless-ngx websever. This is the frontend where I can access the app from my pc or mobile phone.

webserver:
  image: ghcr.io/paperless-ngx/paperless-ngx:latest
  name: paperless-webserver
  restart: unless-stopped
  depends_on:
    - db
    - broker
  ports:
    - 49160:8000
  healthcheck:
    test: ["CMD", "curl", "-fs", "-S", "--max-time", "2", "http://localhost:8000"]
    interval: 30s
    timeout: 10s
    retries: 5
  volumes:
    - /mnt/local/appdata/paperless-ngx/data:/usr/src/paperless/data
    - /mnt/local/appdata/paperless-ngx/media:/usr/src/paperless/media
    - /mnt/local/appdata/paperless-ngx/export:/usr/src/paperless/export
    - /mnt/local/appdata/paperless-ngx/inbox:/usr/src/paperless/consume
  #env_file: docker-compose.env
  environment:
    PAPERLESS_REDIS: redis://broker:6379
    PAPERLESS_DBHOST: db
    COMPOSE_PROJECT_NAME: paperless
    PAPERLESS_ADMIN_USER: admin
    PAPERLESS_ADMIN_PASSWORD: admin

Refrences