Blog / Tutorials

Self-Host Paperless-ngx on a VPS — A Searchable Archive of Every Document

By the NoctHost TeamAugust 10, 20263 min read

Paperless-ngx scans, OCRs, tags and indexes every document you feed it — invoices, contracts, letters, receipts — into a fast, full-text-searchable archive. Instead of a folder of unnamed PDFs, you get a system where "that insurance letter from March" is one search away, on a server only you can reach.

This guide runs Paperless-ngx on a VPS with HTTPS, and covers the sizing question most tutorials skip.

What You Need

  • A VPS with 2 GB RAM (4 GB if you will OCR large batches)
  • Ubuntu 22.04 or 24.04 with SSH
  • A domain or subdomain pointed at the server

OCR is the one heavy step — it uses CPU while processing a document, then goes quiet. For a steady trickle of documents a small server is fine; for importing years of paperwork at once, more cores just means it finishes sooner.

Step 1: Install Docker

curl -fsSL https://get.docker.com | sh

Step 2: Compose (Paperless + Postgres + Redis + Caddy)

Paperless needs a database and a broker. Save as docker-compose.yml:

services:
  broker:
    image: redis:7-alpine
    restart: always

  db:
    image: postgres:16-alpine
    restart: always
    environment:
      POSTGRES_DB: paperless
      POSTGRES_USER: paperless
      POSTGRES_PASSWORD: change-this-password
    volumes:
      - pgdata:/var/lib/postgresql/data

  webserver:
    image: ghcr.io/paperless-ngx/paperless-ngx:latest
    restart: always
    depends_on:
      - db
      - broker
    environment:
      PAPERLESS_REDIS: redis://broker:6379
      PAPERLESS_DBHOST: db
      PAPERLESS_DBPASS: change-this-password
      PAPERLESS_URL: https://docs.example.com
      PAPERLESS_OCR_LANGUAGE: eng
    volumes:
      - data:/usr/src/paperless/data
      - media:/usr/src/paperless/media
      - ./consume:/usr/src/paperless/consume

  caddy:
    image: caddy:2-alpine
    restart: always
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
    depends_on:
      - webserver

volumes:
  pgdata:
  data:
  media:
  caddy_data:

Step 3: The Caddyfile

docs.example.com {
  reverse_proxy webserver:8000
}

Bring it up and create the admin user:

docker compose up -d
docker compose run --rm webserver createsuperuser

Open https://docs.example.com and log in.

Step 4: Ingest Documents

Anything you drop into the consume folder on the host is automatically OCR'd, indexed and filed. Copy documents in over SSH:

rsync -avP ~/Documents/scans/ root@your-server-ip:/root/paperless/consume/

Paperless watches the folder, processes each file, and then you search and tag from the web UI. Set up mail rules or a scanner that drops PDFs into that folder and the archive fills itself.

Tip — Keep the raw originals somewhere too. Paperless stores your documents, but a separate off-site backup of the media volume means an OCR archive is never your only copy of an important paper.

Step 5: Back It Up

Two volumes hold everything — the database and the media. A nightly job to off-site storage:

docker compose exec -T db pg_dump -U paperless paperless | gzip > /root/pl-db.sql.gz
docker run --rm -v paperless_media:/data -v /root:/backup alpine tar czf /backup/pl-media.tar.gz -C /data .
rclone copy /root/pl-db.sql.gz remote:paperless
rclone copy /root/pl-media.tar.gz remote:paperless

What It Costs

Paperless idles cheaply and only spikes CPU during OCR, so the Standard plan (2 vCPU, 4 GB) suits most people; storage grows with your archive, not with traffic. On NoctHost you pay hourly from a prepaid balance topped up with crypto — no card, no KYC — which fits keeping your most sensitive paperwork on a server no one else can index.

Spin one up in about a minute

Email signup, pay with crypto, hourly billing. Trying a box costs cents — destroy it when you are done.

Deploy a server

Frequently asked

How much server does Paperless-ngx need?
2 GB RAM works; 4 GB helps when OCR'ing large batches. CPU matters only during processing. Storage is what grows over time, so size the disk for your archive.
Is my paperwork private on a self-hosted Paperless?
Yes — documents live on your server and are not sent anywhere or indexed by a third party. As always, keep it updated, use HTTPS, and back it up off-site.
Can it OCR non-English documents?
Yes. Set PAPERLESS_OCR_LANGUAGE to your language code (or several), and Paperless installs the matching OCR data. It handles most languages Tesseract supports.
What is the difference from just using Nextcloud?
Nextcloud stores files; Paperless-ngx understands them — OCR, auto-tagging, correspondents and full-text search built for documents. Many people run both, with Paperless as the searchable archive.

Keep reading