Paperless-ngx 3 Removed Encryption and Added AI. Read the Migration Guide Before You Pull.
Paperless-ngx holds the most sensitive files a self-hoster keeps: tax returns, ID scans, medical letters. Version 3 changes how those files are protected and where their contents can go.
Most self-hosted apps hold things you'd be annoyed to lose. A document archive holds things you'd be harmed to leak. Scanned passports, tax filings, bank statements, medical letters, the lease with your signature on it. If you run Paperless-ngx, that folder is probably the most sensitive data on your server, and it's fully text-searchable, which is the point of the software and also what makes it valuable to anyone who gets in.
So a major version that changes how those documents are protected deserves more than docker compose pull. Paperless-ngx 3 is that version. The 3.x line is at 3.4.2 as of November 14, 2026, and its migration guide has more security-relevant changes than most point releases have in total.
What Changed in Paperless-ngx 3
The short list, from the project's v3 migration guide and changelog:
| Change | What it means | Action needed |
|---|---|---|
| Secret key required | Paperless refuses to start without PAPERLESS_SECRET_KEY |
Set one |
| Document encryption removed | The built-in passphrase feature is gone | Decrypt before upgrading |
| AI features added | Optional; sends document text to an LLM backend | Decide where that backend lives |
| Remote OCR added | Optional; sends documents to Azure AI | Leave off unless you mean it |
| Login rate limiting behind a proxy | Client-IP detection changed | Set trusted-proxy options |
| Upgrade path | Only from 2.20.15 | Upgrade to that first |
| Database engine | PAPERLESS_DBENGINE now required for PostgreSQL and MariaDB |
Add one line |
The Secret Key Is No Longer Optional
Paperless is a Django application, and Django signs things: session cookies, tokens, anything it needs to trust when it comes back. The signing key is the secret key. Earlier versions shipped with a built-in default, which means every installation that never set its own was signing with the same publicly known value.
Version 3 ends that. From the configuration docs: "Paperless will refuse to start if this is not set." The changelog has a matching entry, "Don't allow the example secret key as a secret key," so copying the sample value from the docs doesn't work either.
The guide gives the command to generate one, and it works as written:
python3 -c "import secrets; print(secrets.token_urlsafe(64))"
On my machine that produces an 86-character string. Put it in PAPERLESS_SECRET_KEY.
If you were on the old default, the guide offers two choices. Set the variable to the previous value and keep existing sessions alive, or set a new random value and invalidate them. Take the second. Logging everyone out once is a small cost for no longer signing with a key printed in a public repository.
A related change is easy to miss in the changelog: "Sign the Celery pickled tasks." Paperless queues background work through a message broker, and the tasks are serialized with Python's pickle format, which can execute code when it's loaded. Signing them means a task that didn't come from Paperless is rejected before it's unpickled. If your Redis is reachable by anything other than Paperless, this closes a real path. Your Redis still shouldn't be reachable by anything else.
Document Encryption Is Gone
The line in the guide is short: "Document and thumbnail encryption is no longer supported." It adds that the feature has been deprecated since paperless-ng 0.9.3, which is years ago, and that "Users must decrypt their document using the decrypt_documents command before upgrading."
That ordering matters. Decrypt first, on the old version, then upgrade. Per the guide, v3 no longer supports those files, so check your backups before you start.
Whether this is a loss depends on what you thought the feature did. It encrypted files on disk with a passphrase that the running application also had to hold, so anyone who compromised the app got both. It protected against someone walking off with the disk and little else. Full-disk or volume encryption does that job better and covers the database and search index too, which the old feature never did. If you were relying on the passphrase as your at-rest protection, replace it with disk encryption under the data directory and encrypted backups before you upgrade.
We recommend reading The Complete Self-Hosted Productivity Stack: Nextcloud, Vaultwarden, Immich, Jellyfin, and Paperless in 2026 to continue reading our selection of content. It covers how Paperless fits beside the rest of a self-hosted stack, which is the setup this upgrade lands in.
The Complete Self-Hosted Productivity Stack: Nextcloud, Vaultwarden, Immich, Jellyfin, and Paperless in 2026 Replace Google Drive, Google Photos, 1Password, Plex, and your document scanner with a self-hosted stack that runs on your hardware. SudoSecurity · Santhdium
AI Features: Off by Default, and Honest About the Cost
Version 3 adds an AI layer: LLM-based suggestions and a retrieval index for asking questions of your documents. Two facts about it matter most.
It's off by default. PAPERLESS_AI_ENABLED defaults to false, and no backend is configured until you set one.
Turning it on sends your documents somewhere. The project says so plainly, in three separate places in its docs. The clearest version:
Enabling these features sends document content (and metadata) to the LLM backend you configure. If that backend is a remote/hosted provider, your documents leave your server and may incur usage charges.
Where "somewhere" is depends on one setting:
PAPERLESS_AI_LLM_BACKEND |
Where document text goes |
|---|---|
ollama |
A model on your own machine |
openai-like |
Whatever OpenAI-compatible endpoint you configure, including OpenAI itself |
The same split applies to embeddings, which have their own backend setting: openai-like, huggingface, or ollama. It's possible to run the chat model locally and still ship every document's text to a hosted embeddings API, so check both.
For an archive of tax returns and ID scans, the local option is the one that keeps the reason you self-hosted intact. The docs make the same recommendation: "prefer a local backend (Ollama, or a self-hosted OpenAI-compatible gateway) if that matters to you."
Workflows multiply the exposure. The docs warn that with an AI action in a workflow, "Every matching document results in a query to the AI service." A broad trigger on a remote backend sends your whole inbox.
Remote OCR Sends Everything by Default
Separate from the LLM features, v3 can hand OCR to Azure AI. It's disabled unless you set PAPERLESS_REMOTE_OCR_ENGINE. Once you do, look at the mode:
PAPERLESS_REMOTE_OCR_MODE |
What gets sent |
|---|---|
always (the default) |
Every document of a supported type |
workflow_only |
Only documents a workflow explicitly marks |
If you want cloud OCR for the occasional bad scan and local OCR for everything else, the default is the wrong one. Set workflow_only.
Four Settings That Let the Server Reach Inward
Several features make Paperless connect to a URL or host that a user supplies: webhooks, incoming mail accounts, the AI endpoint, the remote OCR endpoint. Any feature like that can be pointed at something internal, such as a metadata service, an admin panel on localhost, or another container on the same Docker network. That's server-side request forgery, and v3 adds a switch for each:
| Setting | Default | Blocks when false |
|---|---|---|
PAPERLESS_WEBHOOKS_ALLOW_INTERNAL_REQUESTS |
true | Webhooks to internal URLs |
PAPERLESS_EMAIL_ALLOW_INTERNAL_HOSTS |
true | IMAP hosts that resolve to private addresses |
PAPERLESS_AI_LLM_ALLOW_INTERNAL_ENDPOINTS |
true | AI endpoints that resolve to private addresses |
PAPERLESS_REMOTE_OCR_ALLOW_INTERNAL_ENDPOINTS |
true | Remote OCR endpoints that resolve to private addresses |
All four default to allowing internal targets, so the protection is opt-in. On a single-user install where you're the only one who can configure a webhook, that's reasonable. On an instance with several users who can create mail accounts or workflows, it isn't. This is my suggested starting point for a shared instance, using the documented setting names:
PAPERLESS_WEBHOOKS_ALLOW_INTERNAL_REQUESTS=false
PAPERLESS_EMAIL_ALLOW_INTERNAL_HOSTS=false
PAPERLESS_REMOTE_OCR_ALLOW_INTERNAL_ENDPOINTS=false
I left the AI one out on purpose. If your LLM is Ollama on the same host, which is the setup I just recommended, its endpoint is an internal address and blocking internal endpoints would cut it off. Same for a mail server on your own LAN. Set each one according to what you run.
Behind a Reverse Proxy, Check Login Rate Limiting
Paperless uses django-allauth for login, and allauth changed how it works out the client's IP address for rate limiting. Behind a reverse proxy, every request arrives from the proxy's address. If Paperless doesn't know which proxy to trust, it either can't tell clients apart or rejects logins. The guide's symptom is 403 Forbidden on login.
The fix is some combination of PAPERLESS_TRUSTED_PROXIES, PAPERLESS_ALLAUTH_TRUSTED_PROXY_COUNT, and PAPERLESS_ALLAUTH_TRUSTED_CLIENT_IP_HEADER. One detail in the guide saves an hour of confusion: the proxy count "is the number of proxy hops in X-Forwarded-For, which may differ from the number of configured proxy IP addresses."
Get it right instead of loosening it until it works. Trust too many hops and a client can forge its own address in the header, which defeats the rate limit.
We recommend reading Zero-Trust Access for Homelabbers: Teleport vs. Tailscale vs. WireGuard vs. Cloudflare Tunnel to continue reading our selection of content. A document archive is the service least worth exposing to the open internet, and that piece compares the ways to reach it without doing so.
Zero-Trust Access for Homelabbers: Teleport vs. Tailscale vs. WireGuard vs. Cloudflare Tunnel Teleport, Tailscale, WireGuard, and Cloudflare Tunnel solve different remote-access problems. Here's which to run, and where each one breaks. SudoSecurity · Astramew
The Rest of the Breaking Changes
These don't affect security, but each one can stop an upgrade:
| Change | What to do |
|---|---|
| Upgrade only from 2.20.15 | Move to 2.20.15 first |
PAPERLESS_DBENGINE required |
PostgreSQL and MariaDB users add it; SQLite users don't |
| Consume scripts lose positional arguments | Read environment variables instead of $1, $2 |
| Search moved from Whoosh to Tantivy | Nothing; the index rebuilds on first start |
| Task history | Cleared during the upgrade |
| pyzbar barcode reader removed | Remove CONSUMER_BARCODE_SCANNER |
OIDC login fails with invalid_client |
Add token_auth_method to the provider settings |
Older CPUs crash with SIGILL |
See below |
The database line, from the guide:
# v2 (PostgreSQL inferred from PAPERLESS_DBHOST)
PAPERLESS_DBHOST: postgres
# v3 (engine must be explicit)
PAPERLESS_DBENGINE: postgresql
PAPERLESS_DBHOST: postgres
And a post-consume script, before and after:
#!/usr/bin/env bash
DOCUMENT_ID=$1
CORRESPONDENT=$7
TAGS=$8
#!/usr/bin/env bash
# Use environment variables directly
echo "Document ${DOCUMENT_ID} from ${DOCUMENT_CORRESPONDENT} tagged: ${DOCUMENT_TAGS}"
The CPU one matters for homelabs on old hardware. NumPy's official wheels now require x86-64-v2, and Paperless's document classifier depends on NumPy, so a CPU without SSE4.2 crashes the worker with an illegal-instruction error whenever the classifier loads. The guide's check:
grep -o -m1 sse4_2 /proc/cpuinfo
It printed sse4_2 on my machine. "If this prints nothing, your CPU is affected," and the guide's workaround is PAPERLESS_TRAIN_TASK_CRON=disable, which turns the classifier off.
What This Doesn't Cover
This is a security read of the v3 migration guide, the configuration reference, and the changelog. I did not run a v2-to-v3 upgrade. The two shell commands were run on my own machine. Every statement about v3 behavior comes from the project's documentation.
It doesn't give release dates. The changelog doesn't carry them, and I couldn't reach the release pages to confirm them. The version figure, 3.4.2, is from the project's pyproject.toml on the main branch.
It isn't a full upgrade walkthrough. The guide has more detail on OCR and archive settings, consumer options, and search syntax than I've repeated here. Read it in full, and take a backup you have tested restoring.
It also doesn't evaluate the AI features themselves, only where they send data.
The Actual Point
Version 3 moves Paperless-ngx toward doing less security work itself and making you be explicit. It no longer ships a default secret key or a passphrase feature that looked like more protection than it was. Remote AI and remote OCR are opt-in, with warnings in the docs. In exchange, the things it used to paper over are now your job: disk encryption, a real secret, a correct proxy configuration.
Before you pull the image: upgrade to 2.20.15, run decrypt_documents if you ever set a passphrase, generate a secret key, and add PAPERLESS_DBENGINE. After: decide on purpose where AI and OCR requests go, and turn off the internal-request settings you don't need.
The secret-key and CPU-check commands and the YAML and shell examples are reproduced from the Paperless-ngx v3 migration guide; the two commands were also run locally. The three-line environment block is my own configuration, using setting names and defaults from the project's configuration reference. Quoted warnings are from that reference and the usage docs, and security entries are from the changelog, all as of November 14, 2026.
$ tail -f /forums
Discussion
Comments live on the community forums — sign in there to reply.