Log inSign up

Paperless-ngx: a searchable archive for scanned paperwork

Download the official PostgreSQL Compose files from the Paperless-ngx repository, set PAPERLESS_URL, a secret key, the time zone and the OCR languages, bind the web port to 127.0.0.1:8000 and run docker compose up -d. Create the first admin with docker compose run --rm webserver createsuperuser, then put Caddy in front for HTTPS.

Topic: Self-hosted apps · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

How large a server does Paperless-ngx need?

Plan on at least 2 GB of memory, because OCR with Tesseract and the background workers are the heavy part. With the optional Tika and Gotenberg containers, which convert Office files and emails, 4 GB is the realistic minimum. Disk matters as much as memory: every document is kept as an original plus an archived PDF/A copy and a thumbnail, so budget roughly double the size of what you scan.

Use Ubuntu 24.04, Ubuntu 22.04, Debian 12 or Debian 13 with Docker Engine and the Compose plugin installed; the Docker Engine tutorial walks through it. Create a DNS record such as paper.example.net before you start.

How do you download the official Compose files?

The project keeps ready-made Compose files in its repository. The PostgreSQL variant is a good default.

mkdir -p ~/paperless && cd ~/paperless
base=https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/docker/compose
curl -fsSL -o docker-compose.yml $base/docker-compose.postgres.yml
curl -fsSL -o docker-compose.env $base/docker-compose.env
curl -fsSL -o .env $base/.env
ls -la

For Office documents and .eml files, pick docker-compose.postgres-tika.yml instead; it adds the converter containers. The project also offers an interactive install script that writes these files for you, but downloading them directly shows exactly what will run.

Which settings should you change?

Edit docker-compose.env and set at least these values:

PAPERLESS_URL=https://paper.example.net
PAPERLESS_SECRET_KEY=paste-output-of-openssl-rand-hex-40
PAPERLESS_TIME_ZONE=Europe/Amsterdam
PAPERLESS_OCR_LANGUAGE=eng
PAPERLESS_OCR_LANGUAGES=deu fra
USERMAP_UID=1000
USERMAP_GID=1000

PAPERLESS_OCR_LANGUAGE is the language Tesseract reads by default (combine several with a plus sign, such as eng+deu), while PAPERLESS_OCR_LANGUAGES installs extra language packs at container start. Match USERMAP_UID to the output of id -u so files in the consume and export folders belong to you.

Next, open docker-compose.yml and change the web port mapping so it listens only locally:

    ports:
      - "127.0.0.1:8000:8000"

Docker-published ports bypass UFW, so a loopback binding is what actually keeps the app private until the proxy is ready.

How do you start it and create the admin user?

Pull, start, then add a superuser.

docker compose pull
docker compose up -d
docker compose ps
docker compose run --rm webserver createsuperuser
docker compose logs -f webserver

The first start takes a minute while migrations run. A quick check from the server itself:

curl -sI http://127.0.0.1:8000 | head -n 1

The version appears in the web interface under the help or about menu after you sign in.

How do you add HTTPS with Caddy?

Install Caddy from its official repository as shown in Caddy HTTPS, then add this block to /etc/caddy/Caddyfile:

paper.example.net {
    reverse_proxy 127.0.0.1:8000
}
sudo systemctl reload caddy
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

Caddy has no small default upload limit and passes the WebSocket connection that drives the live upload status bar. If you run Nginx instead, raise client_max_body_size and forward the upgrade headers; the reverse proxy guide has the pattern.

How do documents get into Paperless-ngx?

There are several intake paths, and you can mix them:

  • Web upload: drag files onto the dashboard.
  • Consume folder: anything placed in ~/paperless/consume is imported and then removed. Combine this with an SFTP account or a sync tool so a scanner or laptop can drop files there.
  • Mail fetching: under Mail in the settings you can add an IMAP account and rules that import attachments from matching messages.
  • Mobile apps: community apps talk to the REST API with a token from your profile.

Tags, correspondents and document types can be assigned automatically. Start with the automatic matching algorithm and correct a few documents by hand; Paperless-ngx learns from those corrections.

How do you configure outgoing mail?

Outgoing mail is used for password resets and for sending documents by email from the interface. Port 25 should not be part of the plan (ask support with a ticket before relying on it); send through an authenticated relay on port 587 instead, as set out in the SMTP relay guide.

PAPERLESS_EMAIL_HOST=smtp.relay.example.net
PAPERLESS_EMAIL_PORT=587
PAPERLESS_EMAIL_HOST_USER=paper@example.net
PAPERLESS_EMAIL_HOST_PASSWORD=relay-password
PAPERLESS_EMAIL_USE_TLS=true
PAPERLESS_EMAIL_FROM=paper@example.net

Add these to docker-compose.env and recreate the containers with docker compose up -d.

How do you back up and upgrade?

The built-in exporter writes every document plus a manifest of tags and metadata into the mounted export folder, which is the format the project recommends for backups and migrations.

cd ~/paperless
docker compose exec -T webserver document_exporter ../export
ls export | head

Schedule it nightly with cron and copy the folder off the server, for example with rclone. To restore on a fresh install, use document_importer on the same folder.

Upgrades are a pull and restart:

docker compose pull
docker compose up -d
docker image prune -f

Read the changelog before each jump; database migrations run on start, and a major PostgreSQL upgrade needs a dump and restore of its own.

Why is a document stuck or unreadable?

  • Nothing happens after upload: check docker compose logs webserver; the consumer runs in the same container and reports OCR errors there.
  • Poor OCR results: scan at 300 dpi and make sure the correct language pack is listed in PAPERLESS_OCR_LANGUAGE.
  • Consume folder ignored: the files belong to another user, so the container cannot read or delete them. Fix ownership or USERMAP_UID.
  • CSRF error at login: PAPERLESS_URL does not match the address in the browser.
  • Out of memory: lower PAPERLESS_TASK_WORKERS to 1 or move to a larger plan.

More self-hosted ideas live on the self-hosting page.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A2-4personal archive with OCR2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months
A4-8Office file conversion or a shared household or office archive4 vCPU, 8 GB RAM, 180 GB NVMe$28.80/mo$86.40 for 3 months

Questions about Paperless-ngx documents

Is Paperless-ngx the same as Paperless?

It is the community-maintained continuation of the original Paperless and Paperless-ng projects, and it can import their data.

Can it read Word and Excel files?

Yes, when you use the Compose variant with Tika and Gotenberg. Plan for 4 GB of memory with those containers.

Where are my documents stored?

In Docker volumes for media and data, with originals and archived PDFs side by side. The exporter gives you a plain folder copy that does not depend on Docker.

Can several people share one instance?

Yes. Create users and groups in the admin area and set owners and permissions per document or by rule.

Does it need a GPU for OCR?

No. Tesseract runs on the CPU. More vCPUs simply shorten the time per page when you import a large batch.