Guide¶
How Paperless Sync works, what it needs, how to install and set it up, what it does, how to use it, and what each part of its configuration means.
How it works¶
At the configured interval, Nextcloud's cron starts a run of the app inside Nextcloud. It reads the finished documents of Paperless and writes each one into the archive in the files of the configured Nextcloud target user, at the path that the path template builds from its metadata; other users see the archive when that user shares it with them. When the metadata changes in Paperless, the file moves; when a document goes to the Paperless trash, its copy goes to _Deleted. Files that someone puts into Inbox go the other way, to Paperless.
Requirements¶
- Nextcloud 33–35, with the system cron for its background jobs, as Nextcloud recommends: Administration settings → Basic settings → Background jobs → Cron. Every run of the app is one of these jobs. Nextcloud keeps the tables of the app in SQLite, MySQL or MariaDB, or PostgreSQL; Oracle can't hold them, as it stores an empty text as no value.
- PHP 8.2+ on the Nextcloud server.
- Paperless-ngx 2.16 or newer, 3.x included. Every request of the app asks for version 9 of the Paperless API, which these versions serve, so that a new default of Paperless can't change the answers that the app reads; the settings page names the version of Paperless that the last run reached. Paperless needs an address that the Nextcloud server reaches over HTTP or HTTPS; for an address of your local network, such as
http://paperless:8000in Docker orhttp://192.168.1.20:8000, turn on the setting Paperless runs in my local network. Paperless-ngx 3.5 and newer answer only under the host names ofPAPERLESS_ALLOWED_HOSTSoncePAPERLESS_URLis set: add the host name of the address that the app uses, such aspaperless, as Messages and their fixes says. - A Paperless account for the app, with an API token, that isn't a superuser. It needs to view and download the documents to mirror, to view their correspondents, document types, storage paths and tags, and to add documents for the inbox; owning the documents lets it mirror the Paperless trash right away. Paperless connection lists the exact permissions, and Test connection checks them.
- Room in the files of the target user, the Nextcloud user who owns the archive: the archive counts against the quota of that user.
| Tested with | Versions | How |
|---|---|---|
| Nextcloud | 33–35, the current release of each | the end-to-end tests in Docker, every night and in every change of the app, on SQLite, PostgreSQL, MariaDB and S3 object storage, and the update from the last release on PostgreSQL and MariaDB |
| Paperless-ngx | 2.20, the last release of 2.x, and the current release of 3.x | the contract tests against a real Paperless in Docker, every week and in every change of how the app talks to Paperless |
Quick start¶
- Install Paperless Sync from the Nextcloud App Store under Apps, or with
occ app:install paperless_sync. Nextcloud's system cron must run. - In Nextcloud, open Administration settings → Paperless Sync. Enter the Paperless URL, pick the Nextcloud user who owns the archive from the users that the field offers, and turn on the modules that you want, such as the inbox. For a Paperless at an address of your network, such as
http://paperless:8000, turn on Paperless runs in my local network. Leave synchronization disabled. - Open Create an account for the app in Paperless, enter the API token of a Paperless superuser, from My Profile in its menu, and click Create the account and save. The app creates the user
nextcloud-sync, no superuser, with only the permissions that your modules need and a random password, saves the settings with the token of that user, never with yours, and shows the connection checklist. Then make the account the owner of the documents to mirror, so that their trash reaches the archive right away, as the checklist says. To keep the token of your superuser out of Nextcloud, create the account by hand, as The account of the app under Configuration describes, enter its token in Paperless API token and click Test connection instead. - Start a dry run and read its summary: it lists what a run would change, without changing anything.
- Enable synchronization and save. Nextcloud's cron runs it at the configured interval, and the documents appear in
Documents/Paperless/Archiveof that user.
Getting started in the settings¶
Until the first run has succeeded, the settings open with Getting started, the steps of the quick start in their safe order: connect to Paperless, with the account of the app or a token of your own, until no line of the connection checklist fails, choose who gets the documents, try a dry-run, turn on scheduled synchronization, and wait for the first run. Each step says in words whether it is Done, Next or To do, from what Nextcloud stores rather than from what the page remembers, and its button leads to its place on the page, such as the setup of the account of the app while no token is saved, Test connection while a line of the checklist fails, or Run dry-run. A screen reader hears when a step is done and which one comes next. After a dry-run, the last step estimates how long the first synchronization takes, from the documents that the dry-run found, the batch size and the interval, as the FAQ explains. Once the first run has succeeded, the list hides, and Show getting started at the top of the settings brings it back. While the settings lack the URL of Paperless, its token or the target user, Administration → Overview says that Paperless Sync is installed but not set up yet, with a link to its settings.
The dry-run and the first synchronization of the quick start:
Features¶
Archive¶
- A folder tree in the files of the configured Nextcloud user, or of each user, with the documents that they own in Paperless and, if you choose, those that it shares with them, by correspondent, document type and year, from a path template that you can change, with base, archive, inbox, error and deleted folders of your choice
- Tags that a user may see: the administrator gives some users only the documents with their tags of Paperless, in an archive of their own, also when the target user gets every document, and Paperless Unified Search shows them the same
- Variables with the names that Paperless-ngx uses for its own file names, such as the archive serial number, the owner, the tags, the name of the month and custom fields, and a preview under the template that shows where the newest documents go while you type, before you save
- Optionally, each document goes where its storage path files it in Paperless, so the folders of your storage paths are those of the archive too
- The archive PDF of each document, or its original file
- Renames and moves when the metadata changes in Paperless, and no empty folders left behind
- Each copy stays the same file in Nextcloud: a new content of its document, such as a new archive version, updates it in place, so its shares, public links, comments, tags, favorites and versions stay with it
- Documents in the Paperless inbox wait until they are finished, and a document that gets a tag you exclude, or the inbox tag again, stays out, its copy removed; or the archive mirrors only the documents with the tags that you choose, such as
Nextcloud - A stable marker such as
[P123]in every file name, which Paperless Unified Search understands - Optional metadata next to the archive: a JSON file for each document with its tags, notes, custom fields and dates, and an index of the whole archive as CSV, so that the archive describes itself also without Paperless
- Optional tags of Paperless as tags of Nextcloud on the copies, which follow every change in Paperless, so that Files filters and searches the archive by them; the tags that people make in Nextcloud stay theirs
Inbox¶
- Files in an inbox folder of Nextcloud, and in its subfolders if you like, go to Paperless as new documents
- Each file can bring its tags: one for each of its subfolders, as the consume folder of Paperless does with
PAPERLESS_CONSUMER_SUBDIRS_AS_TAGS, and tags for every import; the app creates the tags that Paperless lacks if you let it - The app follows the Paperless task of each file: after a success, it removes the file or keeps it, as you choose; after a failure, it moves the file to the error folder, next to the reason
- When Paperless can't take a file now, the upload waits and tries again, from 15 minutes up to a day
Files¶
- Send to Paperless in the menu of a file or a folder in Files: the members of a group that you choose, the administrators by default, send it with the tags of the inbox, it stays where it is, and a notification tells them when Paperless has it, with a link to the new document
- Rules of Flow that send files on their own, such as every PDF that a member of a group uploads, with tags of their own; only the administrators make them
- Open in Paperless in the menu of every copy of the archive opens its document in Paperless
- A note above the list says what a folder of the app does: that the archive is a mirror, when the inbox sends its files, and where the reasons of failed imports are; also for people who reach the folder through a share
- A file whose content Paperless has already isn't uploaded again, so Paperless-ngx 3.x makes no duplicate; the sender learns the document that has it, and a document found by its MD5 alone, as on Paperless-ngx 2.x, counts only when its original has the SHA-256 of the file
Safety¶
- Synchronization stays off until you turn it on, and a dry run lists every change that a run would make, without making it: it takes the plan of a run, change by change, in the same batch
- The Paperless trash is mirrored into a folder of its own; permanent deletion is off by default and, when on, waits for the set number of complete scans of Paperless in a row
- A conflict policy for a file in the way: replace it, or skip it and report the conflict; the app's own copies are never in the way
- No WebDAV credentials and no password of a Nextcloud user: the app writes through Nextcloud's filesystem API
- The Paperless API token stays in Nextcloud's credentials manager, never reaches the browser and goes only to the address saved with it
- A Paperless in your local network, such as
http://paperless:8000, without turning off Nextcloud's protection against server-side request forgery for the whole server, with its address in the browser for the links to Paperless
Operations¶
- Nextcloud's cron runs it at the interval that you set, and the batch size limits the changes of one run
- Changes within seconds: a workflow of Paperless calls the webhook of the app when it adds or changes a document, and its copy changes at once, without a container next to Paperless, its media folder or a password of Nextcloud
- Runs on demand and dry runs from the settings, each with a report of its changes and errors in the language of the administrator, errors first, with a filter for each kind of change, links to the files and a button that copies it for a bug report, and the status of the last run; a dry-run tries changes of the settings before you save them, and a run on demand runs as a background job, so no proxy cuts it off
- Delegate the settings to a group, for the person who runs Paperless but isn't an administrator of Nextcloud
- Pickers in the settings offer the users of Nextcloud for the target user and the tags of Paperless for the excluded tags, the tags to mirror and the tags of every import, and mark a user or a tag that doesn't exist, so that a typo shows before the first run
- The Activity stream of the target user tells what each run changed, with links to its files, and every import, with a link to the new document in Paperless
- In English, German, formal German, French, Spanish, Dutch, Simplified Chinese and Traditional Chinese: the settings, their messages, the Activity stream, the notifications and the folders that a new installation proposes follow the language of Nextcloud, the Help links open the guide in English or German, and the times follow the locale of your personal settings
- Notifications, setup checks, a health check and a status API tell the administrators when the mirror keeps failing or has stopped, also in Uptime Kuma or Home Assistant, with a token for the monitor that opens nothing else
occcommands for scripts, cron jobs and monitoring: a run or a dry-run with a batch size of its own or none, the status, and copies written again, with JSON output and exit codes- Accessible: the settings, the actions in Files and the form of the rule in Flow are checked with axe-core against WCAG 2.1 AA, with no serious or critical finding, in the light and the dark theme, on a computer and on a phone 320 pixels wide, where the settings and the form fit without scrolling sideways, and the settings work by keyboard alone, with a focus that shows and that the bar of the buttons never covers; the end-to-end tests check it in every change of the app
- Signed releases: the same package in the Nextcloud App Store and on GitHub, with an SBOM and signed build provenance
Usage¶
This part is for the administrator, and Using the archive for the people who use the archive. After installation, open Administration settings → Paperless Sync. Configure the connection while synchronization remains disabled: saving tests it when you enter the token. Run a dry-run, review the summary, and only then enable scheduled synchronization.
The default archive path template is:
{{ correspondent }}/{{ document_type }}/{{ created_year }}/{{ created }} - {{ title }} [P{{ id }}]{{ extension }}
This produces paths such as:
Documents/Paperless/Archive/Example GmbH/Invoice/2026/2026-08-26 - Example invoice [P123].pdf
Each part of the template becomes a folder. The base folder holds the inbox folder, with the files for Paperless, and the error folder, with failed imports, next to the archive; the deleted folder in the archive holds the copies of the documents in the Paperless trash:
Stable markers such as [P123] are compatible with the independent Paperless Unified Search app.
When you change the title, the tags, the correspondent or the type of a document in Paperless, its file moves to its new path and keeps its shares, comments and versions in Nextcloud, and the desktop and mobile clients only rename it. Only a change of the content, such as a new archive version after Paperless processed the document again, downloads it again, and the download goes into the same file, at its new path if it has one, so the file keeps its shares, comments and favorites; in a scheduled run, Nextcloud keeps the previous content as a version of the file. A run tells the two apart by the checksums of the file: it keeps the SHA-256 and the MD5 of every download and compares them with the checksum that Paperless reports, MD5 up to Paperless-ngx 2.x and SHA-256 since 3.0. For a file that an earlier version of the app exported, which has only its SHA-256 saved, the first change on Paperless-ngx 2.x reads the file in Nextcloud once to add its MD5, so that it moves without a download too. A download goes to Nextcloud in chunks, so a document of any size fits into the memory of PHP. A run asks Paperless only for the fields of the documents that it reads, not for their text, and for the checksum of a document once for each revision, also when the document waits for a later run; a run over an archive without changes writes nothing to the database.
Paperless-ngx 3.x keeps versions of a document: a new file that you add to it, such as a born-digital PDF for a scan, or, since 3.1, another document that you merge into it. Paperless serves the newest version, and so does the copy: it takes the content of the newest version, its archived version when it has one and its original otherwise, and the extension of that file, such as .txt for a text added to a scanned PDF. A new version is new content: the run writes it into the same file, which keeps its ID, its shares and its versions in Nextcloud, at its new name if the type changed. The fields of a document in Paperless still describe its first file, so a run reads the file of the newest version from the metadata of the document, one request for each such document in a run. A document that you merge into another is no document of its own any longer: its copy counts as missing and moves to the deleted folder after the required missing scans, while the copy of the other document gets the merged content.
Here a document of the type Letter becomes a Contract with a new title in Paperless, and the next run moves its copy into the folder of its new type and renames it:
The archive in Files, one folder per correspondent, document type and year:
Configuration¶
Paperless connection¶
Use a dedicated Paperless service account that isn't a superuser, with only the permissions of the features you use. In Paperless, they are under Users & Groups, in the permissions of the account:
| Feature | Permission in Paperless | What the app does with it |
|---|---|---|
| Always | View for Documents, and access to every document to mirror, best as its owner, as below | lists and downloads the documents |
| Archive export | View for Correspondents, Document Types, Storage Paths and Tags | builds the paths and skips the excluded tags |
| Deleted folder | ownership of the documents, as below | sees them in the trash of Paperless right away |
{{ owner_username }} in the path template |
View for Users | finds the user name of the owner of each document |
| Custom fields in the path template, or metadata next to the archive | View for Custom Fields | reads the names and the choices of the custom fields |
| Storage paths of Paperless | View for Users and for Custom Fields | finds the owner and the custom fields that the template of a storage path may use |
| Nextcloud inbox, or Send to Paperless, which is on for the administrators by default | Add for Documents, and View for Paperless Tasks | uploads the files, and learns whether Paperless imported them |
| Tags of the inbox | View for Tags, and Add for Tags with Create missing tags | finds the tags of the files of the inbox, and creates those that Paperless lacks |
| Connection checklist | View for UI Settings | reads the permissions of the account, so that Test connection can check those of the inbox and the ownership of the documents |
| Per-user ownership | View for Users, View on the documents of every user, and with the inbox Change for Documents | finds the owner of each document, mirrors the documents of every user, and gives the document of an upload the user of Paperless of its user |
| Documents that Paperless shares | what per-user ownership needs, and View for Groups | finds who may view a document through a group |
With per-user ownership, the documents belong to their users, not to the account of the app: give the account the permission View on them instead, or use a superuser, as the security design explains. Otherwise:
The Paperless trash shows an account only the documents that it owns and those without an owner: a permission granted on a document of someone else doesn't count there. Synchronization works all the same, and only deletions in Paperless arrive later, as the end of this section shows. A superuser sees the whole trash, but its token controls all of Paperless, every document and every user, so don't use one for this app. For deletions to arrive with the next run, you can make the account of the app the owner of the documents, and keep the access of the people who own them now. This is optional, and it doesn't go together with per-user ownership, which gives each document to the user who owns it. To do it:
- New documents: add a workflow in Paperless with the trigger Document Added and an action Assignment that assigns the account of the app as the owner and gives view and edit permissions to the users or groups who own the documents now.
- Existing documents: select them in the document list, choose Permissions, set the account of the app as the owner, and give view and edit permissions to the same users or groups. Leave Merge with existing permissions off: with it on, Paperless keeps the current owner and sets one only for documents without an owner. Off, the dialog replaces the permissions of the selected documents, so list everyone who should keep access.
Only the owner of a document or a superuser can change its owner. The Paperless trash then lists these documents for the account of the app and for superusers, not for the people who owned them before.
Without ownership, the trash still reaches the archive, only later: a document in the trash that the account can't see counts as missing, and its copy moves to the deleted folder after the configured number of complete scans. Keep Also delete copies of documents that disappeared without passing the Paperless trash off in that case: with it and permanent deletion both on, such a copy is deleted then, although the document can still be restored in Paperless. A dry-run shows a notice when documents go missing while the trash lists none (TRASH EMPTY on the command line), and the connection checklist counts the documents that the account sees without owning them.
The API token is stored in Nextcloud's credentials manager and never returned to the browser. It goes only to the Paperless URL that it was saved with: to connect to another URL, enter the token again. This holds also when the URL changes past the settings page, with occ or Nextcloud's provisioning API; synchronization then waits for the token. Saving the settings, Test connection, the setup of the account and disconnecting ask for your password, unless you confirmed it in the last 30 minutes.
The account of the app¶
Create an account for the app in Paperless, in the card Connection and ownership, sets up the account of the app with the API token of a Paperless superuser, which you enter once:
- The app takes the permissions that the modules of the form need from the table above, and no more, so set the modules first.
- It creates the user,
nextcloud-syncunless you choose another name, as no superuser, with exactly these permissions and a random password of 64 characters that nobody learns, asks Paperless for the token of that user, and saves the settings of the form with it, as Save saves a typed token. - It shows the connection checklist of the new account. What no permission of an account can give, the access to the documents of other owners, is up to you: make the account their owner, as below, or with per-user ownership give it View on the documents of every user.
A user of that name that exists already changes only when you agree: the page asks first, and an update gives it exactly these permissions and a new random password and takes away Admin, while its token and the permissions of its groups stay the same. A superuser is never taken over. Your token goes only to the Paperless URL of the form, for these requests: the app stores it nowhere, logs it nowhere and never sends it back to the browser, as the security design explains.
For a scripted setup, occ paperless_sync:create-account does the same with the saved settings, and prints the checklist. It takes the token of the superuser from a file, or with --admin-token-file=- from standard input, never as an argument, which the list of processes would show:
occ paperless_sync:create-account --admin-token-file=/run/secrets/paperless-admin-token
Without a token of a superuser for Nextcloud, create the account yourself: in Paperless under Users & Groups, with the permissions of the table above, then its token under My Profile while you are signed in as that user. Or run these commands on a machine of yours, after you filled in the first three lines; they create the account with the permissions of the archive and the inbox:
PAPERLESS_URL='https://paperless.example.com'
SUPERUSER_TOKEN='the API token of a superuser of Paperless'
ACCOUNT='nextcloud-sync'
PASSWORD="$(head -c 32 /dev/urandom | od -An -tx1 | tr -d ' \n')"
# The token and the password go to curl in files of a private folder, never as arguments,
# which the list of processes would show.
SECRETS="$(mktemp -d)"
printf 'Authorization: Token %s\n' "${SUPERUSER_TOKEN}" > "${SECRETS}/header"
printf '{"username": "%s", "password": "%s", "is_superuser": false, "user_permissions": ["view_document", "add_document", "view_correspondent", "view_documenttype", "view_storagepath", "view_tag", "view_paperlesstask", "view_uisettings"]}' \
"${ACCOUNT}" "${PASSWORD}" > "${SECRETS}/user.json"
printf '{"username": "%s", "password": "%s"}' "${ACCOUNT}" "${PASSWORD}" > "${SECRETS}/login.json"
if curl --fail-with-body --silent --show-error --output "${SECRETS}/answer" \
--header @"${SECRETS}/header" --header 'Content-Type: application/json' \
--data @"${SECRETS}/user.json" "${PAPERLESS_URL}/api/users/"; then
curl --fail-with-body --silent --show-error --header 'Content-Type: application/json' \
--data @"${SECRETS}/login.json" "${PAPERLESS_URL}/api/token/"
else
# Why Paperless refused the user, such as a username that it has already.
cat "${SECRETS}/answer" >&2
fi
rm -rf "${SECRETS}"
The last command prints {"token":"…"}: enter that token in Paperless API token, and click Test connection. For the other modules, add their permissions to the list, as the table above names them: "add_tag" for Create missing tags, "view_user" for per-user ownership and {{ owner_username }}, "view_group" for the documents that Paperless shares, "change_document" for per-user ownership with uploads, and "view_customfield" for custom fields.
Connection checklist¶
Test connection, below the connection settings, checks the settings of the form without saving them, and lists what it found, with what to do for every check that fails:
| Line | What it checks | When it fails |
|---|---|---|
| Paperless | Paperless answers at the URL with version 9 of its API, as Paperless-ngx 2.16 and newer do, and takes the token | not saved |
| Documents | the account may view documents, and how many it sees; none at all gets a note | not saved |
| Trash, Correspondents, Document types, Storage paths, Tags | with the archive export on: the account may view each list; the trash gets a note when the account sees documents that it doesn't own, or is a superuser | saved with the failure |
| Upload from the inbox | with the inbox on: the account has the permissions Add for Documents and View for Paperless Tasks | saved with the failure |
| Tags of the inbox | with tags for the files of the inbox: the account has the permission View for Tags, and Add for Tags with Create missing tags | saved with the failure |
| Nextcloud folder | the target user may create files in the base folder | not saved |
The note of the trash stops nothing: synchronization works, and only deletions in Paperless reach the deleted folder later, after the runs set in Required consecutive missing scans, because Paperless shows an account in its trash only its own documents and those without an owner. Making the account of the app the owner of the documents is optional, and it doesn't go together with per-user ownership.
Without View for UI Settings, Paperless doesn't tell the app the permissions of the account and its ID, so the lines of the trash, of the upload and of the tags of the inbox get a note that names this permission instead of a result. Each line has its state as a word, Passed, Note or Failed, next to its sign. A failure names the cause, such as a token that Paperless refuses, a certificate that Nextcloud doesn't trust, an address in your network, or a URL without a Paperless API, such as the login page of a proxy, and what to do. A change of the URL, the token, the target user, the base folder, the local network, the modules or the tags of the inbox takes the checklist away, until the next test.
Paperless in your local network¶
Nextcloud refuses connections to addresses of the local network, such as http://paperless:8000 in Docker, http://paperless.lan or http://192.168.1.20:8000, to protect against server-side request forgery. When Paperless runs at such an address, turn on Paperless runs in my local network and save. Nextcloud then allows a local address for the requests of Paperless Sync to the saved Paperless URL only. Every other app and request stays protected, which the system switch allow_local_remote_servers would undo for the whole server.
Without the setting, saving says what to do:
Nextcloud blocks connections to local addresses such as paperless. If Paperless runs in your network, turn on "Paperless runs in my local network" and save the settings.
The setting also helps when the name of Paperless is set only in the hosts file of the server, such as with extra_hosts in Docker: without it, Nextcloud looks names up only in the DNS, and saving says that it found no DNS record for the name.
If you turned on allow_local_remote_servers for this app before, turn on the setting, save, and then turn the switch off again with occ config:system:delete allow_local_remote_servers. The security design explains what the setting allows.
The address of Paperless in the browser¶
Every link to Paperless opens in a browser: Open in Paperless and Open Paperless in Files, the notification of a file sent from Files, the entry of an import in the Activity app, and the url of each sidecar and of each row of the index of the metadata next to the archive. When Nextcloud reaches Paperless by a name or an address that only the server knows, such as http://paperless:8000 in the network of Docker Compose, enter the address that browsers open in Address of Paperless in the browser, such as https://paperless.example.com, and save. The links then take it, while every request of Nextcloud still goes to the Paperless URL, inside the network, past the reverse proxy and its limits. Leave the field empty when browsers reach Paperless at the Paperless URL: the links take that one, as they did before the setting.
The address is an HTTP or HTTPS URL, like the Paperless URL, without credentials, a query or a fragment. Nextcloud never sends a request to it, so it needs neither the token nor Paperless runs in my local network, and a dry-run may try another one without saving it. A new address reaches the sidecars with the next run, which writes each sidecar and its row once more; a notification that was sent before keeps the address that it was sent with.
Saving, pausing and disconnecting¶
Saving checks every setting first. When scheduled synchronization is on, or when you enter a token, it also runs the connection checklist, and the button says Test connection and save. It refuses settings with which no run can work, such as a token that Paperless refuses or a base folder that the target user can't write, so that the schedule never runs with them. A permission that only one module lacks, such as the one for the tags, is saved with the settings, and the checklist names it, so that you can grant it in Paperless afterwards. With the schedule off and no new token, nothing reaches Paperless until you start a run, and the button says Save and stores the settings without the test; Test connection checks them then without saving:
To pause synchronization, such as while Paperless is down, its token is revoked or the target user is disabled, uncheck Enable scheduled synchronization and save. A save that fails while the schedule is on says so and moves the focus to that switch.
After a save, the form shows the settings as Nextcloud stored them: the URL without a slash at its end, each excluded tag and each tag to mirror once, and an empty fallback name as Unknown. While the form holds changes that aren't saved, the bar of the buttons says so, and the browser asks before you leave the page. Run dry-run then tries the changes without saving them, and its report says Dry-run of unsaved settings: a new path template, other folders or another deletion policy show what they would do before anything uses them. It keeps the saved connection to Paperless, the saved target user and who gets the documents, which only a save tests and confirms with your password: a token that you enter waits for the save, and with a new URL, local network setting, target user, Who gets the documents, table or group of users, the dry-run asks you to save first. Synchronize now uses the saved settings only, so it waits until you save.
Disconnect deletes the stored API token and turns off scheduled synchronization and Paperless runs in my local network. The other settings, the synchronized files and their state stay as they are; to connect again, enter the token, turn the local network on again if Paperless runs there, and save.
Results and errors appear in the bar of the buttons, which stays at the bottom of the window. Synchronize now doesn't wait for the run: it queues the run as a background job of Nextcloud and answers at once, the status says Queued until the next background jobs start it, within five minutes with the system cron, and the bar says how the run ended once the status shows its end. When the background jobs haven't started it after 15 minutes, while no other run holds them back, the status says Not started, and the bar says so in the color of errors, with the last run of the background jobs, which Nextcloud keeps, so that you can check that they run; the page then stops asking for the status, and occ paperless_sync:status says the same. A run can so take as long as it needs, and no proxy in front of Nextcloud cuts it off. Run dry-run answers with its report; when a proxy or the web server answers for a long dry-run instead, such as with 504 Gateway Time-out, the page asks for the status: while it shows the dry-run, the page says that it continues in the background and follows it until it ends; otherwise it names the status code of the web server, and the status shows how it ended.
Delegating the settings¶
The person who runs Paperless is not always an administrator of Nextcloud. An administrator can give them this page alone: under Administration settings → Administration privileges, add a group to Paperless Sync, or run this command, with your group in place of archive-admins:
occ admin-delegation:add 'OCA\PaperlessSync\Settings\AdminSettings' archive-admins
The members of the group have no entry Administration settings in their user menu: they open Settings there and find Paperless Sync in the part Administration of the sidebar. They can do all that the page offers, with their own password where the page asks for one, and nothing else of the administration of Nextcloud.
Delegate the page only to people whom you trust with the files of every user and the network of the server, because that is what it gives them:
- The files of every user. They choose the target user or per-user ownership, and so where the archive is written, and they can turn on permanent deletion there. They also choose the inbox folder below the base folder of that user, whose files then go to Paperless and, as the settings say, leave the folder.
- The account of the app in Paperless. Their dry-runs, runs and reports read Paperless with its token and name documents and files. They can replace the address and the token, and create the secret of the webhook.
- The network of the server. They can turn on Paperless runs in my local network and point the app at any address there, so the server sends requests to devices that they may not reach themselves, and answers can land in the archive.
- The links to Paperless. They choose the address of Paperless in the browser, which every link to a document of Paperless opens, for every user: in Files, in notifications, in the activity and in the metadata next to the archive. It is an HTTP or HTTPS address and never runs a script, but it can lead to another site.
- The names of the accounts. The fields of the target user and of the groups offer the account names and display names of every user and group of Nextcloud, without their e-mail addresses.
Everything else stays with the administrators, whatever the group: the notification of a failing mirror, unless notification_group names the group of the members, the setup checks of Administration → Overview, whose warnings the page shows them too, the status API, the rules of Flow and occ. A key of the configuration of the app can't be written past the page either, so each value passes the same checks as for an administrator. The security design has the details.
Target user and tags¶
The field Nextcloud target user ID offers the users of Nextcloud whose account name, display name or e-mail address holds what you type: pick one with the arrow keys and Enter, or with a click. It takes the account name, as Accounts in the administration lists it, not the display name, and marks a disabled account as disabled. When you leave the field with an ID that Nextcloud doesn't know, it says so at once: Nextcloud has no user with the ID …. Saving refuses an ID that Nextcloud doesn't have, and stores the account name as Nextcloud spells it, such as dennis for Dennis, so that the activity entries, the notifications and the check of the shares reach that user. Whether the target user can write the folders, saving tests only together with the connection, and it keeps a saved target user that is gone since, so that a schedule can always be paused; the field shows a typo before that.
The fields Additional excluded Paperless tags, Only mirror documents with these tags and Tags for every import offer the tags of Paperless: type a part of a name to narrow them down, and pick one. Each tag of the field has a button that removes it, and Backspace in the empty field removes the last one. A tag that Paperless doesn't have yet can be typed too, ended with Enter or a comma, and a save, a test or a dry-run takes what you typed as well. Such a name is marked not in Paperless, which also shows a typo: a run excludes the documents with that tag once Paperless has it, and gives an import that tag once Paperless has it or, with Create missing tags, creates it. A tag to mirror that Paperless doesn't have stops the export instead, as Which documents the archive mirrors explains. A run compares the names without regard to case, and so does the field: a name that you type takes the spelling of Paperless. The page reads the tags with the saved URL and token, as a run reads them, so they appear once the connection is saved, and the token stays on the server. A tag whose name holds a comma can't be in any of the lists, because commas separate the names of the setting, so the fields don't offer it.
Folder ownership¶
The configured Nextcloud target user owns the synchronized folders. The app operates through Nextcloud's internal filesystem API and therefore does not need that user's password or an app password. Other users see the archive when the target user shares its folder with them, or with a group of them; share it read-only, and share the inbox folder only with those who may send documents to Paperless.
The app remembers what it wrote for each target user. Another target user starts a new archive, which the runs write anew from Paperless, and the archive of the previous one stays as it is, no longer updated.
Per-user ownership¶
When the documents of your Paperless have owners, such as in a household or a team where everyone signs in to Paperless and to Nextcloud, each person can find their own documents in their own files: set Who gets the documents in 1 · Connection and ownership to Each user, those they own in Paperless. The default, The target user, all of them, keeps everything as described above. One administrator still connects one Paperless with the token of one account; nobody else enters a URL or a token (decision 0025).
- Who is who. A user of Paperless gets the user of Nextcloud with the same ID, whatever its case, as single sign-on such as OpenID Connect gives them, so
Alicein Paperless findsalicein Nextcloud. Paperless users with another Nextcloud ID takes the others, one on each line, such asjdoe = john.doe; a line wins over the same ID, and a save refuses two lines for one user of Paperless, or one whose user of Nextcloud doesn't exist. Only members of this group limits it to the members of one group of Nextcloud. - None is lost, nothing is guessed. The target user gets the documents without an owner and those whose owner has no user of Nextcloud or isn't in the group. A document whose owner Paperless doesn't list, whose user's folder Nextcloud can't reach, or of two users of Paperless for one user of Nextcloud, such as
Aliceandalice, which get neither, stays where its copy is until a run can tell. - The same folders for everyone. Each user gets the archive, the inbox, the error and the deleted folder below the same base folder of their own files, with the same path template, and shares, versions and search of their own.
- The inbox makes it theirs. A file in the inbox of a user goes to Paperless with the token of the app, and the document then gets the user of Paperless of that user as its owner, so that it comes back into their archive; so does a file that they send with Send to Paperless or that a rule of Flow sends. A document that Paperless had already, found by the content of a file, counts for the inbox, an upload that Paperless hasn't finished a day later, Send to Paperless and a rule of Flow only when it is the user's by its owner, or provably their own upload whose answer never came: a document of the account of the app with a higher ID than every document of that content before the first upload of the file, which then gets their user of Paperless as its owner. Any other document keeps its owner, and the file goes up as a document of its own: Paperless-ngx 3.x imports it, and 2.x refuses it as a duplicate, which sends a file of the inbox to the error folder and tells the sender of a file why, with the existing document named by its ID alone. Until the document has its owner, Paperless names the account of the app as its owner, so the app keeps a record of each upload from right before it until its document has its owner, and the runs leave the documents of the account where they are while an upload may still create its document: while Paperless lists its task unfinished, up to 30 days after the upload, and for a day after an answer that never came, during which the file waits instead of going up again, so that a second upload can't leave the document of the first with the account. The record outlives the file: a document that Paperless creates after the file has left the inbox, after an answer that never came, after a send that gave up, or more than a day late still gets its owner in the next run, which names it in the user's report, and the webhook leaves such a document to that run. Each record costs a scheduled run the question for its task while it has one, or else up to two searches by the checksums of the file, the SHA-256 first, then the MD5 for Paperless-ngx 2.x, with a read of the document that they find and at most one download of its original for a match by the MD5 alone; single ownership, and a user whose documents stay with the account, keep no record and ask nothing more. While Paperless refuses the new owner for a reason that may pass, such as an answer with 503, the upload waits for the next run; a refusal that repeats, such as 403 for an account that may not change the document or 400 for an owner that Paperless doesn't take, ends the import at once, and any other a day after the upload: the document is in Paperless, so the file counts as imported and keeps the owner that Paperless gave it, which the report of the run, or the notification of a sent file, says with the reason of Paperless.
- A copy follows its owner. When the owner of a document changes in Paperless, or the table or the group changes, the next run writes its copy into the archive of its new user and removes the old one, which goes to the trash bin of Nextcloud of the old user, as for a document with an excluded tag. Turning per-user ownership on moves the documents of the users out of the archive of the target user in the same way, within the batch size, and out of the archive of an earlier target user that a run wrote before, so run a dry-run first: it lists each change with its user.
- What each user sees. Each archive has its own batch of changes, its own entries in the Activity stream and its own notifications of failed imports. The report of a run names the user of each line and counts the changes of each user, on the settings page, with
occ paperless_sync:runand in the status API.
The connection checklist shows who gets the documents of whom, with the number of documents of each user of Paperless, warns of every user of Paperless that the target user gets for a mistake of the settings, and checks the base folder of each user. The account of the token must see the documents of every user, as a superuser, or with the permission View on them, and needs View for Users; the security design explains why and how.
Documents that Paperless shares¶
Paperless has permissions of its own: the owner of a document can let other users and groups view it, which Paperless calls Shared with me. In a household, bills, insurance and tax papers often belong to one person and are shared with the other. Each user, those they own or may view in Paperless gives each of them a copy, and does everything else as per-user ownership does (decision 0033).
- Who gets a copy. The owner, or the target user as above, and every user of Nextcloud whose user of Paperless may view the document, by itself or through a group of Paperless; whoever may change a document may view it too. The table and the group of the settings decide who that is, as for an owner. A user of Paperless without a user of Nextcloud gets no copy, and the target user gets none in their place, as they may not be allowed to see the document. A document without an owner, which Paperless shows to everyone, goes to the target user and to whom its permissions name. The account of the app gets no copy of what it may view, also when it has a user of Nextcloud, as it has that permission so that a run can read the documents; what it owns still goes to that user, so give the app an account of its own rather than the one of a person. A superuser of Paperless gets what they own and what the permissions name, not everything that Paperless lets them see.
- A copy of their own. Each copy lies at the same path of the template in the files of its user, with its own shares, versions and search, and counts against the quota of that user: a document shared with four people takes the space of four files. A change to a copy stays in that copy, as for any other copy of the archive.
- A copy follows the permission. When Paperless no longer lets a user view a document, the next run removes their copy, which goes to their trash bin, as for a document with an excluded tag; the copies of the others stay. So does choosing Each user, those they own in Paperless instead. The target user, all of them takes no copy away: each stays in the files of its user, no longer updated, also after its permission is gone. To withdraw the copies, first choose the option of the owners and let a run finish. A dry-run lists each change with its user, so run one first.
- Nothing is guessed here either. When the answer of Paperless doesn't say who may view a document, or names a group that Paperless didn't list, the owner gets the document, every copy stays where it is, and the report counts these documents as an error. A document whose owner the run can't tell stays where its copies are, whoever may view it. Without the list of the groups, a run fails before a copy changes.
- What it needs. The account of the token also needs View for Groups, and View for UI Settings, which every setup gives it and which names its ID: without either, a run fails before a copy changes. Only this option asks Paperless for the permissions of the documents, which costs Paperless more work for each document.
The connection checklist shows who also gets how many documents from the archive of whom, and who may view documents of others without getting a copy; it reads every document for that, once for each test.
Tags that a user may see¶
Not everyone in a household should see every document. With Tags that a user may see in 1 · Connection and ownership, the administrator gives some users of Nextcloud the tags of Paperless whose documents they may see, in a table with a row for each user: Add a user adds one, whose field offers the users of Nextcloud and whose tags come from Paperless, as in the other tag fields, with a tag that Paperless doesn't have marked (decision 0038). It works with every choice of Who gets the documents.
- No row, every document, as before. A user without a row, or with a row without tags, sees what they saw before, and so does the target user, who always gets every document: a save refuses a row for the target user, a user twice and a user that Nextcloud doesn't have.
- A row, only the documents with one of its tags. Such a user gets every document that has at least one of their tags, whatever the case of the names, in an archive of their own below the same base folder of their files, without an inbox, unless they also get the documents of their user of Paperless; whoever owns the document in Paperless or may view it. They get no other document: not one that their user of Paperless owns or may view without one of the tags, which the target user then takes, as one whose owner has no user of Nextcloud. The tags of the archive, Excluded tags and Only mirror documents with these tags, still leave a document out.
- A copy of their own. Each copy counts against the quota of its user, with their own shares, versions and search, as the copies of Documents that Paperless shares do.
- A copy follows the tags. A tag added to a document in Paperless gives it to the users with that tag with the next run, or within seconds with the webhook. A document that loses the last of their tags, a tag taken from their row, or their whole row takes their copy away with the next run, into their trash bin; a run keeps reaching the archive of a user whose row is gone until every copy has left, also one that only the webhook filled. Until their trash bin expires, the user can restore such a copy from it: to take it away at once, empty it with
occ trashbin:cleanup katja. - A tag that Paperless doesn't have leaves that user's archive as it is. After a typo or a rename in Paperless, a run would take away the copies of the documents that a user may see, so it leaves their archive as it is and names the tag as an error, while the target user and every other user get their documents. Test connection names such a tag too.
- A share by hand still shows everything, so the app finds it. A share of the target user that someone made in Files, of the base folder, of a folder or a file in it, or of a folder that holds it, with a user with tags, or with a group or a Team that they are in, shows them every document in it, whatever their tags: the Archive folder that you shared read-only with the family, say. A share with a conversation of Talk or a board of Deck does the same for each of its members, but Nextcloud doesn't tell the app who they are, so the app lists it as one that may reach a user with tags. The settings page lists each such share below the table, with Remove these shares, which removes exactly those after your password; the connection checklist marks them as a failure, or with a warning when every one only may reach a user with tags, and
occ paperless_sync:statusnames them. The app never removes a share by itself. Without Talk, Deck or Teams, there are none of their shares, and the check goes on without them. A link of a share names nobody, so the app can't tell who opens it, and a share with an email address or another server reaches no user of this Nextcloud: check those in Files yourself. - Paperless Unified Search shows them the same. It reads the same lines, and shows such a user only the documents with one of their tags, in the search, on the dashboard and in its notifications. Without Paperless Sync, Unified Search has no lines, and shows every user what it showed before.
A dry-run lists each change with its user, so run one after a change of the table: the dry-run of unsaved rows asks for a save first, as they decide whose archives a run reads.
Folder names¶
A new installation proposes the names of its folders, and the fallback names for metadata that a document lacks, in the default language of Nextcloud, default_language in its config.php. A Nextcloud without one, and a language that the app has no translation for yet, get the English names; a regional variant, such as de_CH, gets those of its language, and so does the formal German of de_DE, which has a catalog of its own for the Sie of its texts. Traditional Chinese gets the names of Taiwan for zh_TW, and the English ones for zh_HK of Hong Kong, which has no catalog of its own yet:
| Setting | English, and every language without a translation | German: de, de_DE and the other variants |
French: fr and its variants |
Spanish: es and its variants |
Simplified Chinese: zh_CN |
Traditional Chinese: zh_TW |
Dutch: nl and its variants |
|---|---|---|---|---|---|---|---|
| Base folder | Documents/Paperless |
Dokumente/Paperless |
Documents/Paperless |
Documentos/Paperless |
文档/Paperless |
文件/Paperless |
Documenten/Paperless |
| Archive folder | Archive |
Archiv |
Archives |
Archivo |
归档 |
封存 |
Archief |
| Inbox folder | Inbox |
Eingang |
Boîte de réception |
Bandeja de entrada |
收件箱 |
收件匣 |
Inbox |
| Error folder | Failed imports |
Fehler |
Imports échoués |
Importaciones fallidas |
导入失败 |
匯入失敗 |
Mislukte imports |
| Deleted folder | _Deleted |
_Gelöscht |
_Supprimés |
_Eliminados |
_已删除 |
_已刪除 |
_Verwijderd |
| Missing correspondent | _No correspondent |
_Ohne Korrespondent |
_Sans correspondant |
_Sin interlocutor |
_无往来方 |
_無關聯方 |
_Geen correspondent |
| Missing document type | _No document type |
_Ohne Dokumenttyp |
_Sans type de document |
_Sin tipo de documento |
_无文档类型 |
_無文件類型 |
_Geen documenttype |
| Missing date | _No date |
_Ohne Datum |
_Sans date |
_Sin fecha |
_无日期 |
_無日期 |
_Geen datum |
| Missing title | Untitled |
Ohne Titel |
Sans titre |
Sin título |
无标题 |
無標題 |
Zonder titel |
The settings page shows the proposed names before the first save, so you can change them before the first run, and saving keeps them as the page shows them. Afterwards, a name changes only when you change it: neither another default language of Nextcloud nor an update renames a folder. The first run stores the names that it uses, so this also holds for an installation set up with occ, which never saved them. The language is that of Nextcloud, not that of the administrator who opens the settings, so that every administrator and every scheduled run see the same names. For the German names on a Nextcloud without a default language, set it before you save, with occ config:system:set default_language --value=de, or type them.
An installation in use on a French, Spanish, Dutch or Chinese Nextcloud keeps the English names that it has from the versions before these languages, also when it updates straight from a version before French and Spanish. Earlier versions still proposed the German names in every language. An installation that one of them set up, with a target user or with a run that left copies or imports behind, keeps them with the update, also those that it never saved, such as after a setup with occ, so that its archive stays where it is:
Renaming the base folder or the archive folder of an archive in use moves its files in the next runs, within the batch size, as a new path template does.
Conflict policy¶
The File conflict policy decides what a run does when a file other than its own copy is at the path of a document, such as a file that someone put there, or a copy that someone edited in Nextcloud. The copy that the app wrote is never in the way: a new content of its document goes into the same file.
- Replace synchronized file, the default: the run writes the document from Paperless into the file that is there, which stays the same file with its shares. Nextcloud keeps the previous content, such as an edit, as a version of the file in a scheduled run, and in a run started with Synchronize now only when the administrator who starts it is the target user. A file in the way of a copy that moves to a new path is deleted instead, and goes where the deletions of the run go.
- Skip and report conflict: the run leaves a file of someone else as it is, and a copy that someone edited when its document gets a new content, and reports
Nextcloud file conflict at …as an error of the document, in every run until the file is gone, and doesn't write or move the document there. The copy of the app, which still has the content of its last download, is no conflict: the run updates it. That holds as well for a copy that a run wrote or moved before it stopped, such as at a restart of the server, without saving its path: when the copy that the app knows of is gone, a file at the path with the content of the app's copy or of the document, by the checksum of Paperless, is the app's own.
Warning
The files of the archive are a mirror of Paperless, and they are read-only by intent: nothing goes back from them to Paperless. The next run writes a copy that you deleted or renamed anew at its path, and when its document changes in Paperless, a run may write its new content over a copy that you edited, or report a conflict for it when conflicts are skipped. Edit documents in Paperless, and copy a file out of the archive to keep a version of your own.
Path template variables¶
The variables have the names that Paperless-ngx uses for its own file names, PAPERLESS_FILENAME_FORMAT, and for its storage paths, so such a template works here once {{ id }} is added, unless it uses logic of Jinja, a filter other than get_cf_value of the custom fields, or a variable that the table below doesn't list; a document can also follow its storage path itself. For a document created on 26 August 2026 and added on 1 September:
| Variable | Value | Example |
|---|---|---|
{{ id }} |
The ID of the document in Paperless | 123 |
{{ doc_pk }} |
Its ID in seven digits, as Paperless writes it | 0000123 |
{{ title }} |
Its title | Electricity bill |
{{ correspondent }} |
The name of its correspondent | City Utilities |
{{ document_type }} |
The name of its document type | Invoice |
{{ storage_path }} |
The name of its storage path in Paperless | Household |
{{ owner_username }} |
The user name of its owner in Paperless | dennis |
{{ tag_list }} |
The names of its tags, sorted and separated by commas | Energy,Taxes |
{{ asn }} |
Its archive serial number | 1042 |
{{ page_count }} |
The number of its pages | 2 |
{{ created }} |
The date of the document | 2026-08-26 |
{{ created_year }}, {{ created_year_short }} |
Its year, in four or two digits | 2026, 26 |
{{ created_month }}, {{ created_month_name }}, {{ created_month_name_short }} |
Its month, as a number, by its name or by its short name in the language of Nextcloud | 08, August, Aug |
{{ created_day }} |
Its day | 26 |
{{ added }} |
The date when it was added to Paperless | 2026-09-01 |
{{ added_year }}, {{ added_year_short }}, {{ added_month }}, {{ added_month_name }}, {{ added_month_name_short }}, {{ added_day }} |
The year, month and day of that date, as those of {{ created }} |
2026, 26, 09, September, Sep, 01 |
{{ original_filename }}, {{ original_name }} |
The name of the uploaded file, without its extension; on Paperless-ngx 3.x, that of its newest version | scan |
{{ extension }} |
The extension of the exported version, with its dot | .pdf |
{{ custom_fields.<name> }} |
The value of the custom field of that name | {{ custom_fields.Invoice number }}: INV-2026-08 |
The template must contain {{ id }}. A variable may be written with or without spaces, such as {{id}}, and is saved as {{ id }}. Every value goes into the path as plain text, so a $1 or a {{ title }} in a title stays as it is.
A custom field may also be written as Paperless writes it, {{ custom_fields|get_cf_value("Invoice number") }}, with the value of {{ custom_fields.Invoice number }}. A second text is the default for a document without a value: {{ custom_fields|get_cf_value("Invoice number", "none") }} gives none for a document that doesn't have the field or has no value in it; an empty text stays empty, as in Paperless. The name and the default are in double or single quotes and may hold any character but {, }, / and their quote. A template with another filter of Jinja, such as {{ title|upper }}, isn't saved, and the settings name the filter.
A value that a document lacks is empty, such as an owner, tags, an archive serial number or a custom field, and a folder that only such a value would name is called Folder; a missing correspondent, document type, date or title takes its fallback name from Advanced fallback names. The name of a custom field is written as in Paperless, with its spaces and capitals, and may hold any character but {, } and /. A select field gives the label of its choice, a document link the IDs of the documents, a yes or no field true or false, and a monetary field its amount as Paperless writes it, such as EUR12.30. {{ created_month_name }} and the other names of a month name it in the language that Nextcloud forces or has as its default, force_language or default_language in its config.php, and in English without either: never in the language of the administrator who starts a run, so the paths are the same in every run. The short names are those of that language, such as Mär in German, without a dot at their end, and in every English, such as British English, the first three letters, as Paperless writes them. A change of that language moves the files, like a change of the template. The names in the language of Nextcloud need PHP's intl extension; without it they are English, so installing or removing intl also moves the files of such a template.
The users and the custom fields of Paperless are read only for a template that uses them, and the users in every run of per-user ownership. For {{ owner_username }}, the account of the app needs the permission to view users in Paperless, and for a custom field the permission to view custom fields; without it, the run fails before a file moves and names the permission. A custom field that Paperless doesn't have, such as one with a typo or one that was renamed, stops the run too, because its value would be empty in the path of every document.
Under the template, the settings show where the five newest documents of Paperless would go with the template that you type, a moment after you stop, before you save, with the fallback names and the switches of the page and a note for a document that a run skips. The buttons under the field put a variable in at the cursor. An invalid template says why there, as saving would:
Every file name keeps the marker [P{{ id }}] and ends with {{ extension }}: when the last part of the template leaves them out, the app adds them at its end. The marker keeps the paths of two documents apart and ties each file to its document.
Each part of the path is cleaned for Nextcloud, macOS and Windows: control characters and < > : " / \ | ? * become _, runs of spaces become one, spaces and dots at the ends go, and the names of Windows devices, such as CON, COM1 or LPT¹, get a leading _.
Nextcloud accepts names of up to 250 bytes, and a character of Cyrillic takes two bytes, of Chinese three and an emoji four. So a folder name has at most 200 bytes and a file name at most 217, which leaves room for the temporary name of a write. A name that would be longer is shortened in its free text alone: the title, the correspondent, the document type, the storage path and the original file name, the longest first. The text of the template, the dates, the marker and the extension stay whole:
Storage paths of Paperless¶
With Use the storage path of a document in Paperless in 3 · Structured archive, a document with a storage path in Paperless goes where Paperless files it: below the archive folder, to the path of the template of its storage path. Every other document follows the path template. So the layout of your storage paths, such as one for each kind of document, or {{ owner_username }} first for a tree of each user, is the layout of the archive too, without a path template that repeats it. The switch is off by default.
The template of a storage path follows the rules of the path template, with the same variables, and its last part is the name of the file: the app adds the marker [P{{ id }}] and the extension there, as Paperless adds the extension, so the template needn't name {{ id }}. The storage path {{ created_year }}/{{ correspondent }}/{{ title }} puts an electricity bill at 2026/City Utilities/Electricity bill [P123].pdf in the archive folder. Empty parts, such as the one in Taxes//{{ title }}, are left out.
A storage path whose template the app can't render as Paperless does leaves its documents with the path template: one with logic of Jinja, such as {% if %}, a filter other than get_cf_value, a variable that the table of the path template doesn't list, such as {{ tags }}, a placeholder of older versions of Paperless, such as {created_year}, or a custom field that Paperless doesn't have. The report of each run and of each dry-run names such storage paths once, as STORAGE PATHS NOT FOLLOWED on the command line, and the preview under the path template names those of the newest documents:
The account of the app sees only the storage paths without an owner, its own, and those shared with it. Paperless makes the person who creates a storage path its owner, so share each storage path with the account (or remove its owner) before you turn the switch on: the documents of a storage path that the account doesn't see follow the path template, and the report and the preview name it by its ID, such as #9.
The preview and a dry-run take the switch of the page before you save. Turning it on or off moves the copies as a new path template does, in the runs that follow and within the batch size: each copy stays the same file, with its shares, comments and tags. A storage path that uses {{ owner_username }} or a custom field makes a run read the users or the custom fields of Paperless, which the account of the app needs the permission to view; without it, the run fails before a file moves and names the permission.
Which documents the archive mirrors¶
The archive mirrors every document that the account of the token may view in Paperless, but two kinds, which 3 · Structured archive leaves out:
- Documents in the inbox of Paperless, those with one of its inbox tags, not the files of the Nextcloud inbox, while Skip Paperless inbox documents is on, as it is by default, so that a document waits until it is finished.
- Documents with an excluded tag, one of Additional excluded Paperless tags, such as
Private.
Only mirror documents with these tags turns this around, for an archive of a part of Paperless, such as the documents that a family shares: with tags in the list, such as Nextcloud, the archive mirrors only the documents that have at least one of them, and leaves the others in Paperless alone. An excluded tag and the inbox still win, so a document tagged both Nextcloud and Private stays out. Empty, as it is by default, the list mirrors every document.
A document that leaves the archive, because it lost its last tag to mirror or got an excluded tag, loses its copy in the next run, which the report lists as Excluded: the copy goes as the deletion safety describes, with the folders that it empties, within the batch size. When the document gets its tag again, the next run exports it again. A dry-run shows which copies a new list would remove before you save it, and the preview under the path template marks the newest documents that a run skips.
A run compares the names without regard to case, as for the excluded tags, and the field takes the spelling of Paperless. Every tag to mirror must be a tag of Paperless: a name with a typo, or one renamed in Paperless, would otherwise remove the copies of every document that should stay. So the export stops before a file changes, with Paperless has no tag named "…", which "Only mirror documents with these tags" names, and the preview under the path template says the same while you type; the inbox goes on sending its files.
Archive version or original: with Prefer Paperless archive versions on, as it is by default, the copy of a document is its archive version, the PDF that Paperless makes of it, with the text that its recognition read as a layer that can be searched and copied. Turned off, the copies are the originals as they came to Paperless: in their own types, such as images or office documents, and a scan without a layer of text. A document without an archive version comes as its original either way.
Metadata next to the archive¶
With Write metadata next to the archive in 3 · Structured archive, which is off by default, every run writes what Paperless knows of each document into the folder .paperless of the archive folder. The archive then describes itself also without Paperless: when you move to another system, keep a backup of Nextcloud alone, or hand the archive to someone without an account in Paperless. Files shows the folder once Show hidden files is on in its settings.
Important
The notes and the custom fields of the documents, such as a private remark, an IBAN or a contract number, stayed in Paperless until now. With the setting on, everyone who can open the archive folder can read them in .paperless, also through a share or a public link of the archive folder or of a folder above it. Check the shares before you turn it on.
- A sidecar for each copy,
.paperless/P123.jsonfor the document 123: its title, its correspondent, document type and storage path by their names, its tags, when it was created, added and last changed, its archive serial number, original file name, MIME type and number of pages, its notes with their authors, its custom fields by their names, a select field with the label of its choice, whether the copy is the original or the archive version, with its SHA-256, and the address of the document in Paperless. - One index of the archive,
.paperless/index.csv, with a row for each sidecar: the ID, the title, the correspondent, the document type, the tags and the dates, the path of the copy below the archive folder, the state of the document,active,trashormissing, the SHA-256 of the copy, the address in Paperless and the SHA-256 of the sidecar. It is CSV after RFC 4180, in UTF-8 with a byte order mark, with commas between the values: LibreOffice Calc opens it with a double-click, and Excel, whose double-click splits a CSV by the separator of its language, such as the semicolon in German, with Data → From Text/CSV, which finds the comma and UTF-8 by itself. A value that a spreadsheet would take for a formula, one that starts with=,+,-or@, starts with an apostrophe in the index, and the sidecar has it as it is.
The sidecar of a document, here with the archive version of its copy:
{
"version": 1,
"id": 123,
"title": "Monthly invoice",
"correspondent": "Example GmbH",
"document_type": "Invoice",
"storage_path": null,
"tags": [
"Electricity",
"Paid"
],
"created": "2026-08-26",
"added": "2026-08-26T10:00:00+02:00",
"modified": "2026-09-01T09:00:00+02:00",
"archive_serial_number": 42,
"original_file_name": "scan.pdf",
"mime_type": "application/pdf",
"page_count": 2,
"notes": [
{
"note": "Paid on 1 September.",
"created": "2026-09-01T09:00:00+02:00",
"user": "anna"
}
],
"custom_fields": [
{
"name": "Invoice number",
"type": "string",
"value": "INV-2026-08"
}
],
"file": {
"version": "archive",
"sha256": "9fae5fe3947195044d068993bb1c63bd15029aab64fdc4827ee6d9e08b304d84"
},
"url": "https://paperless.example.com/documents/123/details"
}
And its row in the index, below the names of the columns, with the checksums shortened here:
id,title,correspondent,document_type,tags,created,added,modified,archive_serial_number,path,state,sha256,url,metadata_sha256
123,Monthly invoice,Example GmbH,Invoice,"Electricity, Paid",2026-08-26,2026-08-26T10:00:00+02:00,2026-09-01T09:00:00+02:00,42,Example GmbH/Invoice/2026/2026-08-26 - Monthly invoice [P123].pdf,active,9fae5fe3…,https://paperless.example.com/documents/123/details,5d41402a…
A run writes a sidecar only when its content changes, such as after a change of the document in Paperless or of the name of its correspondent: the index keeps the SHA-256 of every sidecar, so a run reads one file for all of them. A copy in the deleted folder keeps its sidecar, and its row names its path there and the state of its document. A sidecar goes with its copy, under the same rules of deletion safety: when a run deletes the copy of a document that Paperless deleted, or removes the copy of a document with an excluded tag.
A dry-run writes no metadata, and a call of the webhook writes the sidecar and the row of its document at once. Paperless sends the notes of the documents only while the setting is on, and the account of the app needs the permission to view custom fields: without it, the runs export the documents, write no metadata and report an error, Metadata: Paperless did not list its custom fields …. A run writes at most as many sidecars as Maximum changes per module and run allows, so the first run after you turn the setting on writes the sidecars of that many documents, and the next runs write the rest. When Nextcloud can't write a sidecar, such as one that is locked, the report shows an error, Metadata P123: …, and the next run tries it again. When it can't write any, such as with a full quota, the run reports it once and writes no further sidecar, keeps the rows of those it wrote, and the next run catches up; Metadata index: … is an error of the index. Delete index.csv to have the next run write every sidecar again. Turning the setting off leaves the folder as it is.
Tags in Nextcloud¶
With Show Paperless tags as Nextcloud tags in 3 · Structured archive, which is off by default, every run gives each copy the tags of its document as collaborative tags of Nextcloud. Files then filters the archive by them, in its view Tags and with the filter of a folder, and the search of Nextcloud finds the copies by them, without a visit to Paperless.
- One tag of the app for each tag of Paperless, of the same name: every user sees it, and only administrators can assign it, so that it stays in step with Paperless. A run makes a tag the first time that a copy needs it, and the app keeps the IDs of its tags, so it finds them also after an administrator renamed one. The names of these tags are visible to every user of the instance, in Files and its tag picker, also to users who can't open the archive; the files themselves stay as private as their folder. Turn the setting on only when the names of your Paperless tags may be seen by everyone on your Nextcloud.
- They follow Paperless: each run compares the tags of every copy that it exports, moves or finds unchanged with those of its document, adds the new ones and removes those that the document lost, also when the copy itself stays as it is. A tag that you rename in Paperless becomes a tag of its new name, and the tag of the old name, like that of a tag that you delete in Paperless, goes at the end of a run of the whole archive, once no file has it. A copy in the deleted folder keeps the tags that it had.
- The tags of others stay theirs: a run never assigns, removes, renames or deletes a tag that someone else made, also none that a user put on a copy. Nextcloud keeps one tag of a name, whatever its case, so when someone made a tag with the name of a tag of Paperless already, such as
Invoice, the copies go without it, and the report says so: Nextcloud has a tag named Invoice that Paperless Sync did not make. Rename the tag in Nextcloud or in Paperless, and the next run gives the copies theirs.
The report lists each copy whose tags change, such as TAGS P123: +Tax 2026 -Inbox, and a dry-run shows the same before you save. A run changes the tags of at most as many copies as Maximum changes per module and run allows, so the first run after you turn the setting on tags that many copies, and the next runs tag the rest. The Activity stream of everyone who can open a copy shows each tag that a run adds or removes, as Nextcloud shows every change of a tag; System tags for a file have been modified in the personal settings of Activity turns these entries off.
Nextcloud lets only users and the command line create tags: the background jobs by cron and occ paperless_sync:run create them, a call of the webhook and background jobs by AJAX or Webcron can't. Such a run gives the copies the tags that exist already, and the report names those that wait for the next run by cron: Nextcloud lets only users and the command line create tags. Turning the setting off leaves the tags of the copies as they are; an administrator deletes the tags of the app, and with them their places on the copies, under Administration settings → Basic settings → Collaborative tags.
Nextcloud inbox¶
Files in the inbox folder, and in its subfolders when Scan inbox subfolders is on, go to Paperless, at most as many in one run as the batch size allows. A file stays in the inbox until its Paperless task reports success:
Two scans in the inbox: Paperless imports the first, and the second, which it couldn't import, waits in the error folder next to its reason:
A failed file keeps its subfolder below the error folder, but not a marker such as [P123] in its name: Scan [P123].pdf becomes Scan.pdf, and its .error.txt says what it was called. A failed file never replaces another one there, whatever the conflict policy, which is for the copies of the archive: the files of the error folder are originals that Paperless has no document of. So when a name is taken, such as the scan.pdf of a scanner that names every scan the same, the file takes the next free number, scan (2).pdf, and its .error.txt goes next to it. Whoever may write into the inbox chooses the name of a file, and for those who may only read the error folder, Paperless Unified Search would take a file with a marker for the copy of that document. Its .error.txt has the reason that Paperless gave, such as a file type that it doesn't take, or It is a duplicate of document #123 on Paperless-ngx 2.x and on 3.x with PAPERLESS_CONSUMER_DELETE_DUPLICATES, and the ID of the Paperless task, by which the task list of Paperless shows more. Paperless-ngx 2.x marks a failed import first without its reason, so the app waits for the reason before it moves the file. A task that Paperless cancelled, REVOKED in its task list, moves the file there too. A file that someone replaced in the inbox after its upload, such as a repaired scan saved under the same name, stays in the inbox when the import of its former content failed: the report names that failure, and the next run sends the new content. The report of a run names the document that a successful import created: the settings page shows the file as Imported, with Paperless imported it as document P456, and the command line prints IMPORT SUCCESS: Documents/Paperless/Inbox/police.pdf -> P456.
When Paperless has not finished the task of a file a day after the upload, the run first looks for a document with the content of the file, by its checksum. If Paperless has one, the import counts as a success, with a document found by its MD5 alone only once its original has the SHA-256 of the file, as below; a document whose original Paperless doesn't have confirms nothing, and while the download of the original fails for another reason, the file waits for the next run. If Paperless still lists the task, as pending or started, its worker may be down or its queue long, so the document may still appear: the file moves to the error folder, with a note that says so, and the Nextcloud log has a warning. It isn't uploaded again, because Paperless-ngx 3.x imports a duplicate as a second document. In per-user ownership, the record of the upload follows the task for 30 days after the upload: once Paperless creates the document, the next run gives it its owner and names it in the user's report, and the file in the error folder can go. If Paperless doesn't list the task at all, its queue lost it, as after a restart of Redis: the run reports an error, the Nextcloud log has a warning, and the file is uploaded again after 15 minutes, as after a failed upload.
A file of the inbox whose content Paperless has already is never uploaded a second time, whatever its path. Before each upload, also the next attempt after a failed one, the run asks Paperless for a document with the checksum of the file, as Send to Paperless does: when Paperless has one, as after an upload that Paperless received although its answer never came, the file counts as imported, leaves the inbox or stays there as configured, and the report names the document (IMPORT SUCCESS: Documents/Paperless/Inbox/police.pdf -> P456), while the document keeps its owner. Paperless-ngx 2.x knows each original only by its MD5, and 3.x still does for a document whose original was missing when it computed the SHA-256 or that came from an export of 2.x, while two different files can have the same MD5: a document that the MD5 alone finds counts only when one download of its original, not of the archive version, has the SHA-256 of the file. Otherwise the file goes up as one that Paperless doesn't have, and the refusal of Paperless-ngx 2.x as a duplicate moves it to the error folder, with its reason. A document whose original Paperless doesn't have, which it answers with 404, confirms nothing, so the file goes up the same way; while the download of the original fails for another reason, the file waits, and nothing is uploaded or deleted. In per-user ownership, a document counts only when it is the inbox's user's by its owner, or provably their own upload whose answer never came: a document that the account of the app still owns, with a higher ID than every document of that content before the first upload of the file, which the record of the upload keeps, and which then gets that user as its owner. Paperless numbers its documents in ascending order and gives no number twice, so the ID proves the upload without the clocks of Nextcloud and Paperless. The account sees the documents of every user, so a file with the content of any other document goes up as a document of its own, and never leaves the inbox for a document that isn't its user's; while an upload of another user waits for its owner, a document of the account counts for nobody, and the file waits for a later run. A file that already waited for its next upload before the update that brought this rule has no record of its upload, so it goes up again. A file that is renamed or moved inside the inbox, or whose folder is renamed, keeps its upload by its file ID: a pending upload goes on at the new path, a kept file stays imported, and a file that waits for its next attempt keeps waiting. Only a file that Paperless refused gets a new chance with its new name, as a name may be what Paperless refused. A file that comes from another storage, such as an external one, has a new file ID; the checksum still keeps it from becoming a second document, once Paperless has imported the first upload.
Videos, programs and archives never go to Paperless, which can't use them as documents: mp4, mov or mkv, exe, msi, dmg or apk, zip, 7z, rar, tar.gz or iso, and the like, by the extension of the name, whatever its case. Such a file stays where it is, takes no place in the batch and isn't a failure. The report of every run, and of every dry-run, names it for as long as it stays: on the settings page as Set aside, with a notice that counts all of them and names the first five, and in the status and on the command line as IMPORT SET ASIDE: Documents/Paperless/Inbox/holiday.mp4: video and SET ASIDE: …. It reaches neither the activity stream nor the notifications, as every run would repeat it; move it out of the inbox or delete it, and the next report leaves it out. The number of files decides nothing: a scan batch of a thousand pages goes to Paperless as one page does, at most as many in one run as the batch size allows. An upload of such a file that Paperless already has still ends as before, and a file that Paperless imported stays as it is.
Paperless may refuse a file right away: one of a type it doesn't take, an empty one, or one too large for a proxy in front of it, such as the 100 MB of the free plan of Cloudflare. The report of that run lists the file once as Refused, with the reason that Paperless gave (IMPORT REJECTED on the command line), and the Nextcloud log records it as a warning. The runs after it leave the file in the inbox and skip it until it changes; save it anew, rename or replace it to submit it again.
When Paperless can't be reached, or fails with a server error such as 502 Bad Gateway, the run uploads no further files and tries this one again later: after 15 minutes, then after twice as long each time, at most once a day. The other files follow in the next runs.
Tags of the inbox¶
A file can bring its tags to Paperless, as the consume folder of Paperless does with PAPERLESS_CONSUMER_SUBDIRS_AS_TAGS. With Subfolders become tags, a file in Inbox/Taxes/2026 gets the tags Taxes and 2026, and Tags for every import, such as Scanned and Nextcloud, which the field offers from the tags of Paperless, go with every file. Both are off until you turn them on. A name finds the tag of Paperless with that name, whatever its case, so the folder taxes finds the tag Taxes:
- The account of the app finds only the tags it may view: those without an owner, its own, and those shared with it. Paperless makes the person who creates a tag its owner, so share an existing tag with the account (or remove its owner) before you turn the feature on; otherwise the account doesn't find it, and with Create missing tags the run makes a second tag of the same name.
- A name that the account finds no tag of doesn't stop the file: it goes without that tag, and the report of the run says so once, in a notice on the settings page (
TAGS UNKNOWN: Paperless shows the account no tag named 2026, …on the command line), with a warning in the Nextcloud log. Create the tag in Paperless or share it with the account, and the next files get it. - With Create missing tags, the run creates such a tag first, with the matching algorithm None, so that Paperless assigns it to no other document on its own, and without an owner, as the consume folder of Paperless does, so that every account that may view tags sees it, and the report shows it as New tag (
NEW TAG: 2026on the command line); the settings page shows the tags of each import below its file too. The account of the app needs the permission Add for Tags; a file whose tag Paperless doesn't create waits in the inbox and is uploaded again later, as after a failed upload. A dry-run names the tags that a run would create, and creates none. - The report names the tags of each file, such as
IMPORT: Documents/Paperless/Inbox/Taxes/2026/receipt.pdf (tags: Taxes, 2026), and Paperless adds its own inbox tags, as to every new document. - The title of the new document is the name of the file without its extension: Paperless takes it from the file, as for every upload.
Everyone who may write to the inbox folder can name its folders, so with Create missing tags they can add tags to Paperless as well. Turn it on for an inbox that only people you trust write to, and use the tags for every import for the rest.
Send from Files¶
A file needn't go through the inbox: Send to Paperless in the menu of a file or a folder in Files, or of a selection of them, sends it to Paperless, and the file stays where it is. The members of the group in Group that may send files, in 4 · Nextcloud inbox, get the action: the administrators, the group admin, by default. The uploads use the API token of the app, the account of Paperless that you set up for it, not an account of the person who sends, so choose a group of people whom you trust with that account, such as one for the people who scan the mail, and leave the field empty to turn the action off. The account needs the permissions Add for Documents and View for Paperless Tasks, which the connection checklist tests while the field names a group.
- A click answers at once, with how many files go and how many are on their way already, and the background job of the app sends them with the next run of cron, which Nextcloud starts every five minutes. A notification tells the sender how each import ended: receipt.pdf is in Paperless now, which opens the new document in Paperless, or the reason of Paperless when it didn't import the file.
- A folder sends the files below it, without hidden ones, at most as many in one click as the batch size allows; for a larger folder, send its subfolders one at a time. With Subfolders become tags, a file in
Taxes/2026below the sent folder gets the tags Taxes and 2026, and every file gets the Tags for every import, as from the inbox. A tag that Paperless lacks is left out, as from the inbox, and named: the sender gets one notification, Sent to Paperless without the tags …, which lists the files, and the Nextcloud log a warning. - Paperless gets each file once: the job first asks Paperless for a document with the content of the file, by its checksum, and when Paperless has one, found by the SHA-256 of the file or confirmed by that of its original, the notification names it instead of an upload that Paperless-ngx 3.x would import as a second document. A file that waits for its upload or its task is on its way already, and a second click doesn't send it again.
- Files of the archive stay out: a file whose name has a marker such as
[P123]is a document of Paperless already, and the files of the base folder, such as the inbox and the archive, belong to the runs, with per-user ownership those of the base folder of every user: move a file into the inbox to send it from there. The menu leaves the action out for files with a marker; a click on another file of the base folder answers that the runs look after it. Nextcloud checks every click again, together with the group and that the person may read and download each file: a share whose owner allows viewing only stays out. - When Paperless can't take a file now, the upload waits 15 minutes, then twice as long each time, and gives up after the sixth, with a notification; a file that Paperless refuses, such as one of a type that it doesn't take, isn't uploaded again. A task that Paperless has not finished a day after the upload ends the import with a notification, as Paperless may still create the document. A file that is deleted before its upload, or whose sender's account is gone, ends with a notification; when Nextcloud can't look the file up for another reason, such as while a user backend like LDAP doesn't answer, the file waits for its next attempt as after a failed upload.
Open in Paperless is in the menu of every file whose name has a marker such as [P123], such as every copy of the archive, for everyone who can see the file, also through a share: it opens the document in Paperless, at the Paperless URL of the settings, where Paperless asks for its own login and shows the document only to whom it allows. So every user of Files learns that address; the metadata next to the archive names it too.
Send by a rule of Flow¶
Files can also go to Paperless on their own: Send to Paperless is an operation of Flow, the rules of Nextcloud in Administration → Flow, so that a rule of the administrators sends every file that matches its conditions, such as every PDF that a member of the group Family uploads, or every file of a folder that has the tag To Paperless. The file goes to Paperless as one sent from Files, with the Tags for every import of the inbox and the tags of the rule, and stays where it is.
- In Administration → Flow, choose Send to Paperless among the Available flows.
- Choose when the rule runs, such as File created, and its conditions, such as File MIME type is PDF documents and Group membership is Family, or File system tag is To Paperless, which also counts for the tag of a folder above the file; Flow asks for at least one.
- Type the tags of Paperless for the files of the rule into Tags in Paperless, separated by commas, as the field suggests them from Paperless, and save the rule.
- Only administrators make such rules, as the uploads use the API token of the app, as from Files. Group that may send files is the group of the action in Files and doesn't limit a rule: its conditions choose whose files it sends. The background job sends them with the next run of cron, for the owner of each file; a file without one, as in a group folder, for the user who wrote it. While the app isn't connected to Paperless, a rule sends nothing.
- When the rule runs: File created and File updated send a new or a changed file, File renamed and File copied a file that comes to where the rule matches, and Tag assigned a file the moment that someone gives it a tag. A file that waits for its upload or for its task isn't queued again, not by a second event and not by a second rule; the tags of every rule that matches the event go with it.
- The tags of the rule follow the settings of the inbox: a tag that Paperless lacks is created with Create missing tags and else left out, and the owner of the files hears of it in one notification that names the tags and the files, with a warning in the Nextcloud log, as the inbox reports it. Flow refuses to save a name with a comma or a line break, which separate the names, or one longer than the 128 characters that Paperless keeps.
- Files of the archive stay out, as from Files: the files of the base folder, with per-user ownership of every user's, which the runs write, such as the copies of the archive and the files of the inbox, and every file whose name has a marker such as
[P123], so that a rule for every new PDF doesn't send the archive back to Paperless. A file whose content Paperless has already, by its checksum, isn't uploaded again. - The owner hears of what needs them: a notification for an import that Paperless refused or that failed, after the same retries as from Files. A rule may send many files, so an import that worked, a content that Paperless had and a file that its owner deleted before its upload go into the log of Nextcloud alone, at the level info.
Deletion safety¶
Moving Paperless documents to its trash can be mirrored into the configured _Deleted folder, below the date on which the document went to the trash, in the time zone of the target user from the personal settings of Nextcloud, or else in that of Nextcloud, such as _Deleted/2026-08-27/Example GmbH/Invoice/2026/…; when the trash behavior keeps archive files in place, the copy stays where it is. Deleting the copy of a document that Paperless deleted is disabled by default: the switch Delete the Nextcloud copy after Paperless deletes the document for good. When enabled, a document must be absent from both the active Paperless API and its trash for the configured number of consecutive complete scans.
A copy that a run deletes goes to the trash bin of the target user, Deleted files in Files, as do the folders that it empties: Nextcloud keeps them there for the retention of its trash bin, and the target user can restore them. With per-user ownership (folder ownership), the copies of each user go to the trash bin of that user. That holds for every run, whoever or whatever starts it: a scheduled run, a run of Synchronize now, a run of occ paperless_sync:run and the run of the webhook, also in a process that set up the files of another user first, such as of the administrator who asked or of another app. The same holds for the copy that an excluded tag or a lost tag to mirror removes, for an inbox file after its import and for a file in the way of a copy that moves, which the conflict policy Replace synchronized file deletes. A copy whose document gets a new content stays the same file instead, and its previous content becomes a version of it, not a file in the trash bin. Without the app Deleted files of Nextcloud, every deletion is for good.
A bill goes to the trash of Paperless and comes back:
N is the number of Required consecutive missing scans, three by default. With the trash behavior Keep archive file in place, the copy stays in the archive instead of moving to _Deleted, and it is deleted from there when the rules allow it. A document that Paperless restores, or lists again, keeps that copy without a download.
Which settings of Trash and deletion safety you need, question by question:
The copy of a document that disappears from Paperless without passing through its trash moves to the deleted folder after the same number of scans. It stays in place when the trash behavior keeps archive files in place, and it is deleted when direct deletion is allowed as well.
Only a copy that is still there is moved or deleted: a document whose copy is already gone, or that was never exported, is only marked as trashed or missing. Moves to the deleted folder and deletions count against the batch size like every other change, also when they fail: what does not fit into a run waits for the next one. A copy that cannot be moved or deleted is reported as an error of its document, and the run carries on with the others.
Only a complete scan counts. Paperless lists its documents page by page, and a page may come back short or empty, from a proxy in front of Paperless or a glitch of its permissions, or a document may be added or deleted while the run reads the pages. Then documents that still exist would look deleted. So a scan counts only when every page came back full, with the same count of Paperless, and the run received every document that Paperless listed; the run reads the documents in the order of their IDs, so that a new one joins the last page. After an incomplete scan of the documents or of the trash, the report shows a notice that the list of Paperless came back incomplete (SCAN INCOMPLETE on the command line), the Nextcloud log has a warning, and the run counts no document as missing; the next complete scan carries on. A document that a scan lists again starts its count of missing scans anew. The lists of tags, correspondents, document types and storage paths are checked the same way: when one of them comes back incomplete, the run fails before it changes anything in the archive, so that a document is never exported for want of its excluded tag, and never moves for want of its correspondent.
A complete scan is still no proof: when one document is deleted and another one is added while the run reads the pages, the count of Paperless stays the same, and the pages can shift so that a document that still exists is left out without a sign. So before a scan counts a document as missing, the run asks Paperless for that document alone. When Paperless has no such document (404), the missing scan counts. When Paperless still has it, its copy stays, and its count of missing scans starts anew, as if the scan had listed it. Any other answer, such as an error of Paperless or a timeout, counts nothing for the document in this run, and the report names it as an error. So a copy moves or is deleted only after Paperless has confirmed its document gone, also with one required missing scan. The run asks only for the documents that a scan would count: one that doesn't fit into the run, or that a run has marked missing already, costs no question, until a deletion would remove its copy or forget it. A run asks at most twice as many questions as Maximum changes per module and run allows, one share for copies to move or delete and one for states alone, and none after the first that fails; the other documents count nothing in that run and wait for the next.
Batch size¶
The batch size limits the changes of one run: exports, moves, removals of excluded copies, moves to the deleted folder and deletions. A change that fails takes its place as well, so a run that can't write, such as one against a full quota or a file name that Nextcloud refuses, downloads no more documents than the batch size allows. An export that fails takes its place only among the exports, though, so documents whose export keeps failing never hold up the moves of trashed or missing documents. What doesn't fit into a run waits for the next one, and the report counts it as skipped. Uploads from the inbox have a batch of the same size of their own, so a run uploads at most that many files to Paperless as well. So do the sidecars of the metadata next to the archive: a run writes at most that many, and the tags in Nextcloud: a run changes the tags of at most that many copies.
The run takes the most recently added documents first, so a new document doesn't wait behind a backlog, such as the first export of a large archive. A document whose last export or move failed waits behind the others, the one that failed longest ago first, so documents that keep failing don't hold up the rest. When Nextcloud can't store files in the archive at all, because the quota is full or the archive is read-only or its storage unavailable, the run stops exporting and moving at the first failure and the report shows a notice that Nextcloud cannot store files in the archive (EXPORT STOPPED on the command line); the other documents follow in the next run, and removing copies, which frees space, goes on. Nextcloud applies no quota to the temporary file of a write, so the app checks the free space before every write itself. A path that Nextcloud refuses on its own, such as a forbidden file name or a read-only subfolder, concerns only its document. With the conflict policy Skip and report conflict, a file in the way is reported as a conflict before the document is downloaded, and a dry-run reports it too. The app's own copy of a document is not in the way: the state of the document records its path, and it still has the content of the last download, so it gets the new content. A copy that someone changed in Nextcloud counts as theirs and stays, also when the document gets a new path; a copy that a failed write left incomplete is still the app's own and gets the content in the next run.
Background jobs¶
The app uses Nextcloud's native cron scheduler. System cron must run reliably. The configured interval, from 5 minutes to a day, is enforced by the app; each run limits its changes in Nextcloud, and its uploads to Paperless, to the configured batch size each. Nextcloud starts the job of the app every five minutes at most, so the interval can't be shorter; an interval below five minutes that an earlier version saved acts as five minutes.
The interval counts from the start or the end of the last run, whichever is later, and only a run counts that synchronizes: a scheduled one, one of Synchronize now or one of occ paperless_sync:run. A dry-run changes nothing, so it doesn't move the next run; only while it is still running, the next run waits for it, as both need the lock of the synchronization.
Synchronize now queues a second job, OCA\PaperlessSync\Cron\ManualSyncJob, once, which the next background jobs run. To start it at once, run a worker of Nextcloud for it, such as in a service of systemd or a container of its own: occ background-job:worker 'OCA\PaperlessSync\Cron\ManualSyncJob'. For a single run, occ background-job:worker --once 'OCA\PaperlessSync\Cron\ManualSyncJob' runs the queued job and returns. Each job of the app reads the settings as they are saved when it starts, so a worker that keeps running takes a change of the settings, such as a new token or target user, with its next job, without a restart. While another run holds the lock, such as a dry-run, the job waits for the next background jobs.
A large archive takes many runs at first: about the number of documents divided by the batch size, times the interval. With the defaults, a batch of 100 and 5 minutes, 5,000 documents take 50 runs, four hours or more. A larger batch, up to 1,000, makes the first synchronization faster; every later run changes only what changed in Paperless. Or import it in one go on the command line, with occ paperless_sync:run --unlimited.
The first synchronization, from the dry-run to a complete archive:
Changes within seconds¶
A run follows the interval, 5 minutes at the shortest. A workflow of Paperless can tell the app at once instead: on Document Added and Document Updated, it calls the webhook of the app with the ID of the document, and the copy of that document is exported, moved or removed within seconds, by the same rules as in a run. Nothing runs next to Paperless for it, no container reads its media folder, and Nextcloud needs no password: Paperless sends the ID, and the app reads the document with its own token.
To set it up:
- In section 6 of the settings, Changes within seconds, choose Create secret and copy the secret: the page shows it this once, and Nextcloud keeps only its SHA-256. Copy the Webhook URL as well, such as
https://cloud.example.com/index.php/apps/paperless_sync/api/v1/webhook. - In Paperless, open Workflows and add a workflow with the triggers Document Added and Document Updated, with the filters you like.
- Add the action Webhook: the webhook URL as Webhook url, Use parameters for webhook body and Send webhook payload as JSON on, and the parameter
documentwith the value{{ doc_id }}. Paperless-ngx 2.x has no{{ doc_id }}: give it{{ doc_url }}, the address of the document, from which the app takes the ID. - Under Webhook headers, add
Authorizationwith the valueBearer, a space and the secret, and save the workflow. - Change the title of a document in Paperless: its copy moves within seconds, and section 6 shows the last call, P123 moved.
The webhook takes {"document": 123} as JSON or as a form, and the number may be text or the address of the document in Paperless. It answers:
| Answer | When |
|---|---|
200 with "result": exported, moved, removed, unchanged or excluded |
the copy of the document is current; excluded for a document that the settings leave out, such as one in the inbox of Paperless |
404 with "result": "missing" |
Paperless doesn't show the document to the account: in its trash, deleted, or new and not committed yet; Paperless tries again after about 1, 2 and 4 seconds, which catches a new document, and the scheduled runs handle the trash |
202 with "result": "queued" |
the document waits for the next background jobs: another run holds the lock, or Mirror the document during the call is off |
400 |
the call names no document |
401 |
the secret is missing or wrong |
429 |
Nextcloud refuses the address of Paperless for up to 30 minutes after more than ten calls with a wrong secret, or after more than 120 calls a minute |
409 with "result": "off" |
scheduled synchronization or the export is off, or Paperless is not connected |
500 with "result": "failed" |
the copy failed, such as for a file in the way; Paperless tries a call that failed three more times |
With Mirror the document during the call on, the default, the copy changes while Paperless waits for the answer. Paperless gives up after five seconds, as for a large download, and the run finishes all the same. Off, every document waits for the next background jobs, which system cron starts every 5 minutes, in the job OCA\PaperlessSync\Cron\DocumentSyncJob; Nextcloud queues it once for each document, however often Paperless calls, and while another run is active, it tries again a minute later. A call changes nothing while scheduled synchronization is off, as before the first dry-run was reviewed.
The trash, deleted documents and the inbox stay with the scheduled runs, which see the whole of Paperless: a document that Paperless doesn't show waits for the missing scans that deletion safety asks for, so keep scheduled synchronization on. A call of the webhook is no run of the status: the settings page, the status API and the schedule keep the last run, so that calls never hold back the scheduled run that finds trashed documents. The Activity stream of the target user, or with per-user ownership of each user, shows the changes of a call as those of a run.
The webhook is the one address of the app that answers without a login of Nextcloud. A call without the secret gets 401, and Nextcloud's brute-force protection delays the next calls of that address, up to 25 seconds, until it refuses them for up to 30 minutes after more than ten failures; while the calls are only slower, a call with the secret ends the delay, and occ security:bruteforce:reset <address> ends a refusal at once. Every address may call 120 times a minute. Create a new secret replaces the secret at once, and Turn the webhook off deletes it. Security has the details.
The settings, section by section¶
The settings are in Administration settings → Paperless Sync. Until the first run has succeeded, Getting started below the title leads through the first steps. Above the sections, the status shows how the last run ended, when it finished, the last successful run and the next scheduled run, and the errors of the last run when it had any; below them, in a bar that stays at the bottom of the window, the buttons save the settings, start a dry-run or a run, and disconnect Paperless, with the note about unsaved changes and the result of each action next to them. Saving, pausing and disconnecting above explains when saving tests the connection, how to pause synchronization and what Disconnect keeps. The Help link of each section leads to its part of this guide, in German when Nextcloud speaks German to you and in English otherwise; so does the link of a warning in Administration → Overview.
1 · Connection and ownership: the address of Paperless, its API token, the Nextcloud user who owns the archive, picked from the users of Nextcloud, the base folder in the files of that user, which a new installation names in the default language of Nextcloud, like the other folders, as Folder names above describes, whether Paperless runs in your local network, at an address that Nextcloud otherwise refuses, the address of Paperless in the browser for the links to Paperless, when browsers reach it at another address than the server, and who gets the documents: the target user all of them, or each user those that they own in Paperless, with the table of the users of Paperless with another ID in Nextcloud and the group whose members alone get theirs, and the tags that a user may see, with which some users get only the documents with one of their tags. Test connection below them checks these settings without saving them, and lists every Paperless permission that the enabled modules need, as Connection checklist above describes.
Create an account for the app in Paperless, folded away below them, creates the account of the app with the API token of a Paperless superuser, which you enter once: a user that is no superuser, nextcloud-sync unless you choose another name, with the permissions that the modules of the form need. Create the account and save saves the settings with the token of that account and shows its connection checklist, as The account of the app above describes.
2 · Schedule and modules: the scheduled synchronization, the export to Nextcloud and the import from the inbox, each on its own, the interval, from 5 minutes to a day, and the most changes of one run.
3 · Structured archive: the archive folder, the conflict policy for a file in the way, the path template with a button for each of its variables and the paths of the newest documents with it while you type, whether a document follows its storage path of Paperless, the archive version or the original, which documents stay out: those in the inbox of Paperless, those with one of the excluded tags, picked from the tags of Paperless, and, with tags to mirror, those without any of them, whether the runs write the metadata next to the archive, and whether the copies carry the tags of Paperless as tags of Nextcloud.
4 · Nextcloud inbox: its first line says that videos, programs and archives stay in the inbox; then the inbox folder, the error folder, the subfolders of the inbox, whether an imported file leaves the inbox, and the tags of the inbox: one for each subfolder, tags for every import, picked from the tags of Paperless, and whether the app creates those that Paperless lacks; below them, the group whose members may send files to Paperless from Files, picked from the groups of Nextcloud.
5 · Trash and deletion safety: what a document in the Paperless trash does to its copy, the deleted folder, the scans before a missing document counts as gone, and the switches of permanent deletion.
6 · Changes within seconds: the address of the webhook that a workflow of Paperless calls when it adds or changes a document, its secret, which the page shows once after Create secret, the last call and what came of it, whether a call mirrors its document at once, and the steps in Paperless, as Changes within seconds describes and shows.
The report of a run¶
A dry-run, a run by hand or a run of occ paperless_sync:run ends with its report: how many documents each kind of change concerned, and a line for every file that the run writes, moves or deletes, or would in a dry-run, up to 100 lines with the errors and deletions first. The settings page shows it in your language, with a colored badge for each kind of change, the errors on top, a filter for each kind and, when you are the target user, a link from each file to its folder; Copy report copies it for a bug report. The page keeps the report of the last run, also of a scheduled one, for the next visit. A file of the inbox that Paperless refuses appears once, as Refused with the reason of Paperless (IMPORT REJECTED on the command line), and counts as a failed import; until it changes, the runs after it count it as skipped. This dry-run comes a few days after the first synchronization, when Paperless has two new documents, a new title, a document in its trash, one with the excluded tag Private and a finished import:
Status, report and log¶
Every run leaves its outcome in five places, also a scheduled run that nobody watched:
The top of the settings page shows how the last run ended, when it finished, the last run without errors, roughly the next scheduled run, as Nextcloud's background jobs start it a few minutes after the interval, and below them the Paperless that the last run reached: its version, as Paperless names it, and the version of its API that the app uses, such as The last run reached Paperless-ngx 3.3.0 through version 9 of its API. A run that failed, or ended with errors of single documents, shows them in a box below, the error that stopped the run first, with a link to the table Messages and their fixes. A request that Paperless refused, or that did not reach it, says there what happened and what to do, such as for a token that Paperless no longer takes, and after Details: the message of the HTTP client, which names the request. The report of the last run follows the buttons. Both stay after a reload, for a scheduled run too. A run of Synchronize now is Queued until the background jobs start it, and Not started once it has waited for 15 minutes while no other run holds the lock. A run that ended without saying how, because PHP stopped it, such as on a restart of the server, is Interrupted once Nextcloud's lock of the run is gone and the run gave no sign of life for 15 minutes: an active run writes one every minute; the next run continues where it stopped. While a run is queued or active, the page asks for its status, after each change of the state every second at first, then every five seconds, and after five minutes every thirty seconds.
Write all copies again, beside Refresh, does what occ paperless_sync:forget --all does, for those without a shell, such as the members of a group to which the page is delegated: after a question that says what it costs, the next runs download every document again, batch by batch, and write it in place of its copy. A copy keeps its path, its file ID, its shares and its versions, and one that someone edited or damaged in Nextcloud gets the content of Paperless again; the edit stays as an earlier version. While a run is active, the page asks to try again when it has ended.
The report shows in the language of the administrator what the run changed, or would change in a dry-run, whose heading says Dry-run — nothing was changed. Its counts show the kinds of changes that happened, and a sentence the documents that stayed unchanged and those that the run skipped, such as for a later run or for an excluded tag. Each change has a badge of its kind: red for errors, failed and refused imports, amber for deletions, removals of excluded copies, moves to the deleted folder and notices such as an incomplete scan, green for finished imports. The errors come first, then the notices, then the changes in the order of the run, and a filter above the list shows the changes of one kind. An administrator who is also the target user, and so may open the files, opens the folder of a file that the run wrote, moved or left in place with a click on its path. Copy report copies the heading, the counts and the lines in English, as occ paperless_sync:run prints them, such as EXPORT P12: Documents/Paperless/…, for a bug report. The errors that the app explains, such as a target user that Nextcloud doesn't know or a full quota, are in the language of the administrator too, in the report and in the status above it, while the log and the command line keep them in English; the reasons of Paperless and the other messages of Paperless and Nextcloud stay in the words in which the run got them.
The report counts every change and lists up to 100 lines of them. A run with more lines lists its errors, deletions, removals of excluded copies, moves to the deleted folder and failed imports first, in place of exports, moves and imports, and says how many lines it leaves out, so that a dry-run never hides a deletion behind a hundred imports; SCAN INCOMPLETE and EXPORT STOPPED always stay. The status keeps the first 50 errors of the run and counts the others.
The Nextcloud log has a warning, with the ID of the document and its path, when an error of a document first occurs or changes; an error that comes back in every run is logged once. A run that fails as a whole is logged as an error.
Activity¶
The Activity app of Nextcloud tells the target user, or with per-user ownership each user, what Paperless Sync did, in the language of the user, also in a scheduled run that nobody watched:
- A run that changed something has one entry, which counts its changes and links its first five files: Paperless Sync added or updated 6 documents and moved 1 document to _Deleted: a.pdf, b.pdf, c.pdf, d.pdf, e.pdf and 2 more. A link leads to its file also after the file moved again. The entry opens the archive folder, whose Activity tab in Files lists the runs.
- A file of the inbox that Paperless imported has an entry with a link to its new document in Paperless: scan.pdf was imported into Paperless as P123. The link starts with the address of Paperless in the browser, or with the Paperless URL while that is empty.
- A file that Paperless failed to import has an entry with the reason of Paperless and a link to the file in the error folder, and a file that Paperless refused has one with the reason, once: the file stays in the inbox until it changes.
A dry-run and a run without changes add no entry. The filter Paperless Sync in the navigation of the Activity app shows the entries alone, and in the personal settings under Activity, each user can have them sent by mail or as notifications as well, which is off until then. Nextcloud's own entries of the Files app don't tell this story: they leave out the files of a run by hand, and they show those of a scheduled run as changes of a remote account.
Being notified¶
A mirror that stops is the worst failure of a backup, and nobody looks at the settings page every day. Paperless Sync says so on its own, in three places, without another service:
- Notifications. Three runs in a row that failed or completed with errors, or fewer once the first of them ended a day ago, as with an interval of a day, send every administrator one notification, with the first 200 characters of the error and a link to the settings: Paperless Sync failed 3 times in a row. It comes once for the whole row, also by mail or as a push notification of the Nextcloud apps where the user has turned those on, and the next successful run removes it. Two failed runs, such as during a restart of Paperless, notify nobody. The target user, or with per-user ownership the user whose inbox held the file, gets a notification for each file of the inbox that Paperless could not import or refused, with its reason, and so does the owner of a file that a rule of Flow sent. When an administrator deletes the target user in Nextcloud, every administrator gets a notification, Nextcloud deleted paperless, the target user of Paperless Sync, until the settings name another target user: every run fails until then, and a new account with that ID would get every document. A dry-run notifies nobody.
- Setup checks. Administration → Overview and
occ setupchecksshow two checks of the app. Paperless Sync is an error when the last run failed, a warning when it completed with errors or when no run succeeded for three intervals, at least an hour, as when the background jobs stopped, and a note with a link to the settings while they lack the URL of Paperless, its token or the target user, as on a new installation or after Disconnect. Paperless Sync background job warns when scheduled runs are on but Nextcloud runs its background jobs with AJAX or Webcron, which start them only while someone uses Nextcloud. The settings page shows their warnings on top. - The health check gives a monitor, such as Uptime Kuma or Home Assistant, the health of the mirror, with a token that opens nothing else: no file, no setting and no account of Nextcloud. Create token under Health check for a monitor on the settings page shows the token once, beside the Health check URL; a new token replaces the one before at once, and Revoke the token turns the health check off. Here the token is in the variable
HEALTH_TOKEN:
curl --header "Authorization: Bearer $HEALTH_TOKEN" \
"https://cloud.example.com/index.php/apps/paperless_sync/api/v1/health"
It answers:
{"healthy": false, "health": "failed", "state": "failed",
"lastSuccess": 1787900400, "failedRuns": 3, "failingSince": 1787909405}
health is unconfigured while the settings lack the URL of Paperless, its token or the target user, so that no run can start, then failed or errors while the last run failed or completed with errors, also one by hand while scheduled runs are off, then off while they are off, waiting before the first successful run, stale as the setup check names it, or ok; healthy is false for failed, errors and stale. state is the state of the last run, also of a dry-run, as the settings page names it, such as completed or failed, failedRuns counts the runs in a row that failed or completed with errors, and failingSince is when the first of them ended; the times are Unix timestamps, 0 for none. The answer is 200 whatever the health, so that a monitor tells a failing mirror from a health check that it can't reach. A call without the token, or with a wrong one, gets 401, and Nextcloud's brute-force protection delays the next calls of that address, as for the webhook. In Uptime Kuma, a monitor of the type HTTP(s) - Json Query with this URL, the header {"Authorization": "Bearer <token>"}, the query healthy and the expected value true raises an alarm. In Home Assistant, a RESTful binary sensor does the same, with paperless_sync_health: Bearer <token> in secrets.yaml:
rest:
- resource: https://cloud.example.com/index.php/apps/paperless_sync/api/v1/health
headers:
Authorization: !secret paperless_sync_health
scan_interval: 300
binary_sensor:
- name: Paperless Sync problem
device_class: problem
value_template: "{{ not value_json.healthy }}"
The status API tells an administrator more, for a script of their own: also the error of the last run, the counts of the last run and of each user, and the Paperless that it reached. Only administrators may read it, with an app password of an administrator, from Personal settings → Security, which opens every file and the administration of the whole Nextcloud, so give a monitor the token of the health check instead. Here the app password is in the variable APP_PASSWORD:
curl --user "admin:$APP_PASSWORD" --header "OCS-APIRequest: true" \
"https://cloud.example.com/ocs/v2.php/apps/paperless_sync/api/v1/status?format=json"
It answers, with the counts of summary shortened:
{"ocs": {"meta": {"status": "ok", "statuscode": 200, "message": "OK"}, "data": {
"healthy": false, "health": "failed", "enabled": true, "state": "failed",
"lastStarted": 1787911200, "lastEnded": 1787911205, "lastSuccess": 1787900400, "nextRun": 1787912100,
"error": "Paperless refused the API token (HTTP 401). Copy a new token from My Profile in Paperless, enter it in the settings of Paperless Sync, and check that the account is active. Details: Client error: `GET https://paperless.example.com/api/documents/` resulted in a `401 Unauthorized` response:\n{\"detail\":\"Invalid token.\"}",
"failedRuns": 3, "failingSince": 1787909405,
"summary": {"dryRun": false, "exported": 0, "errors": 0}, "users": [],
"paperlessVersion": "", "paperlessApiVersion": ""}}}
healthy, health, state, lastSuccess, failedRuns and failingSince are those of the health check. summary holds the counts of the last run, also of a dry-run, users with per-user ownership the counts of each user by their ID, such as {"alice": {"exported": 2, …}}, and error the error of the last run of the row that failed, in English: for a request that Paperless refused or that did not reach it, what happened and what to do, and after Details: the message of the HTTP client.
The notification of a failing mirror goes to the group admin. Another group, such as one for the people who look after the archive, gets it in its place with occ config:app:set paperless_sync notification_group --value=archive-admins; a group that doesn't exist leaves it to the administrators, with a warning in the log.
Command line¶
Nextcloud's occ runs the app from the shell, for scripts, cron jobs of your own and monitoring, such as in a Docker or All-in-One installation: docker exec --user www-data nextcloud php occ …, or docker exec --user www-data nextcloud-aio-nextcloud php occ … for All-in-One.
| Command | What it does |
|---|---|
occ paperless_sync:run |
A run now, in the shell, as long as it takes, with its report. It makes at most as many changes as the batch size of the settings, as a scheduled run does. |
occ paperless_sync:run --dry-run |
The changes that a run would make, without making them. |
occ paperless_sync:run --batch-size=1000 |
A run with a batch size of its own; --unlimited makes every change that is due, such as for the first import of a large archive. |
occ paperless_sync:status |
The status of the last run, as the settings page shows it, with its report, and a stored token that it can't read, as after a restore with another secret. --exit-code tells by the exit code how it ended, for a check of a monitoring. |
occ paperless_sync:create-account --admin-token-file=FILE |
Creates the account of the app in Paperless with the token of a superuser in the file, or with - from standard input, with the permissions of the modules of the saved settings, stores its token and prints the connection checklist; --username names the account, --update updates a user that exists. It exits with 0 when every check passed, 1 when a check failed, and 2 when it failed, with no token stored. The account of the app has the details. |
occ paperless_sync:forget 123 P124 |
The next runs download these documents again and write each in place of its copy, such as after a copy was damaged; --all for every copy, such as after an incident of the storage. A copy keeps its path, its file ID, its shares and its versions, and an edit in Nextcloud gets the content of Paperless again. Write all copies again on the settings page does the same as --all. |
--output=json prints the report of a run, or the status, as the JSON that the settings page reads, on one line, and --output=json_pretty indented; messages about failures go to standard error. A run on the command line counts in the status and the log as any other run, and holds the same lock, so it never runs beside a scheduled run or one of Synchronize now.
| Exit code | paperless_sync:run |
paperless_sync:status --exit-code |
paperless_sync:forget |
|---|---|---|---|
| 0 | The run completed. | The last run completed, or none has ended yet. | Every document was forgotten. |
| 1 | It completed with errors of single documents or files; its report lists them. | It completed with errors. | Some of the documents have no copy. |
| 2 | It failed or didn't start: an option that isn't valid, an incomplete configuration, or Paperless out of reach. | It failed or was interrupted. | It failed. |
| 3 | Another run is active. | — | A run is active. |
The first import of a large archive in one go: a run without a limit can take hours. Nextcloud lets the lock of a run expire after an hour (filelocking.ttl in config.php), but the run gives a sign of life every minute, which keeps scheduled runs and those of Synchronize now from starting beside it.
occ paperless_sync:run --dry-run --unlimited # how many changes are due
occ paperless_sync:run --unlimited # make them all
How a run by hand starts, on the page and on the command line:
FAQ and troubleshooting¶
The FAQ answers the common questions, such as what happens to an edit of a mirrored file, where deleted files go and how long the first synchronization takes. Troubleshooting leads from an error message, a run that fails or a file that is missing to its cause and its fix.
Help and feedback¶
- A question about the set-up, or whether the app can do something: ask in the Q&A discussions, where the answer stays for the next person who asks.
- A bug: open a bug report with the versions of the app and of Nextcloud. Report a vulnerability privately instead.
- An idea: suggest it in a feature request.
- If it works for you: rate it in the Nextcloud App Store, so that others find it, star the repository, or support its development.




![Nextcloud Files in the folder Example Bank/Letter/2026 of the archive with the copy 2026-10-07 - Credit card terms [P190].pdf. A caption says that in Paperless the document becomes a Contract with the new title Credit card agreement, then that the next run moves the copy into the folder of its new type with its new name. The pointer opens Example Bank, which now holds Contract and Statement and no folder Letter, then Contract and 2026, where the copy is named 2026-10-07 - Credit card agreement [P190].pdf](images/move.gif#only-light)
![Nextcloud Files in the folder Example Bank/Letter/2026 of the archive with the copy 2026-10-07 - Credit card terms [P190].pdf. A caption says that in Paperless the document becomes a Contract with the new title Credit card agreement, then that the next run moves the copy into the folder of its new type with its new name. The pointer opens Example Bank, which now holds Contract and Statement and no folder Letter, then Contract and 2026, where the copy is named 2026-10-07 - Credit card agreement [P190].pdf](images/move-dark.gif#only-dark)



































