01
What Paperless-ngx does
Paperless-ngx is a free, open source document manager. For each file added, it:
- reads the text with OCR if the document does not already contain any, such as a scan or a photo of a letter;
- creates an archive version in PDF/A format, with selectable text, always keeping the original intact;
- automatically suggests tags, a correspondent (the organization or person who sent it) and a type (invoice, contract, statement…), learning from your choices.
Tags replace folders: one document can carry several. Search covers the full text of the documents and all of this information. Documents come in through the consume folder, by drag and drop in the web interface, or by fetching from a mailbox.
Paperless-ngx does not replace a file share: to sync folders between your devices, see installing Nextcloud on a VPS instead.
02
Install with the official Docker Compose files
You need a recent Linux VPS, the settings from securing a Linux VPS and Docker with its Compose plugin: follow installing Docker on a VPS. The project provides an interactive installation script; the manual method below shows what it does. Download the PostgreSQL variant, which the documentation recommends for a new installation, and its two settings files:
sudo mkdir -p /opt/paperless
cd /opt/paperless
sudo curl -L -o docker-compose.yml https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/docker/compose/docker-compose.postgres.yml
sudo curl -L -o docker-compose.env https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/docker/compose/docker-compose.env
sudo curl -L -o .env https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/docker/compose/.env
sudo mkdir consume export
sudo chown 1000:1000 consume export
To also read Office documents, take instead a file whose name contains tika from the same project folder. In docker-compose.yml, replace - "8000:8000" with - "127.0.0.1:8000:8000": Docker writes its own filtering rules ahead of UFW's, and the port would otherwise be open to the whole Internet. Then open docker-compose.env and set:
PAPERLESS_SECRET_KEY=une-longue-cle-generee
PAPERLESS_TIME_ZONE=Europe/Paris
PAPERLESS_OCR_LANGUAGE=fra
PAPERLESS_SECRET_KEY: required, Paperless refuses to start without it. Generate it with python3 -c "import secrets; print(secrets.token_urlsafe(64))" and do not change it afterwards.
PAPERLESS_OCR_LANGUAGE: the language of most of your documents, as a three-letter code. French (fra) is already installed in the image; use eng for English.
USERMAP_UID and USERMAP_GID: set them only if your user does not have UID 1000 (id -u), so it can write to consume.
sudo docker compose pull
sudo docker compose up -d
03
Administrator account and consume folder
Open an SSH tunnel from your computer, then go to http://localhost:8000:
ssh -L 8000:127.0.0.1:8000 utilisateur@IP_DU_VPS
On the first visit, Paperless asks you to create the superuser. You can also create it from the command line with sudo docker compose exec webserver createsuperuser. This account sees and edits every document: the documentation advises creating a regular account for daily use, or removing the superuser status afterwards.
The consume folder is watched constantly: any file dropped into /opt/paperless/consume is read, filed, stored in Paperless's storage, then removed from the folder. Think of it as a mailbox, not as storage. On a VPS, you drop files there over SFTP:
scp releve-novembre.pdf utilisateur@IP_DU_VPS:/opt/paperless/consume/
Then create your first tags, correspondents and document types in the management lists. Correct the suggestions on the first documents: automatic filing improves as you confirm. For more precise rules, for example a tag based on the file name or the document's source, use workflows.
04
Securing access to your documents
Invoices, contracts, tax notices, identity papers: a Paperless instance gathers very personal documents. Protect it like a safe:
- HTTPS is a must. Put Paperless behind Nginx Proxy Manager: add the
proxy network to the webserver service, declare it as external: true at the bottom of the file, then create a proxy host pointing to the container (its name is shown by sudo docker compose ps, usually paperless-webserver-1), port 8000, with a Let's Encrypt certificate, Force SSL and Websockets Support.
- Declare the public address. Add
PAPERLESS_URL=https://docs.example.com to docker-compose.env, with no trailing slash or subfolder, then restart with sudo docker compose down and sudo docker compose up -d. Paperless uses it to validate where requests come from.
- Long passwords and two-factor authentication. Each user can enable it in their profile with an authenticator app; keep the recovery codes somewhere safe.
- One account per person, with only the rights they need: Paperless handles permissions per user, per group and per document.
- No direct exposure of port 8000, and if you are the only user, go through a VPN rather than the Internet: see installing WireGuard on a VPS.
- Regular updates of the system and of Paperless.
05
Export, back up and update
Export. The document_exporter tool writes all your documents, their thumbnails, your settings and the database contents into a folder. With the official Compose files, ../export inside the container maps to the export folder on the VPS:
cd /opt/paperless
sudo docker compose exec -T webserver document_exporter ../export
Run again on the same folder, it only copies new or changed files, which works well with an incremental copy using rsync to another machine. The -z option produces a zip archive, and -d removes the files of deleted documents from the export. Two limits: an export can only be imported back into the same version of Paperless, and it does not contain API tokens, which must be recreated after a restore.
Backup. Run the export at a time when Paperless is not processing documents, copy it off the VPS, and keep several versions: otherwise a filing mistake or a deletion spreads to the copy. The export holds your documents unencrypted: protect the place where it is stored. You can also back up the Docker volumes paperless_media (the documents), paperless_data and paperless_pgdata (the database).
Updating. Check that no processing is running, make an export, read the release notes (some major versions require manual steps before updating), then:
sudo docker compose down
sudo docker compose pull
sudo docker compose up -d
sudo docker compose logs -f webserver
Database migrations are applied at startup. The latest tag in the official files always follows the latest stable release.
06
On CloudFive
CloudFive does not offer a managed Paperless-ngx: you install it yourself on a VPS, with root access. The Ryzen VPS, from €5.99 per month, is a good fit:
- an AMD Ryzen 9 9950X, with DDR5 memory and NVMe storage, useful for OCR, which works the processor on every addition;
- Docker and Docker Compose install with the official script, nesting being enabled on our VPS (see the Docker VPS page);
- a dedicated IPv4 address and basic DDoS protection included;
- snapshots from the customer area, to take before an update.
Servers are in France, on our own network, monthly with no commitment, with support in French 7 days a week by tickets, on Discord and by phone. A snapshot does not replace the export: always keep a copy of your documents off the VPS.
07
Frequently asked questions
How do I install Paperless-ngx on a VPS?
Install Docker, download an official docker-compose file (the PostgreSQL variant is recommended) with docker-compose.env and .env, set PAPERLESS_SECRET_KEY and the OCR language, then run docker compose pull and docker compose up -d. Then open port 8000 through an SSH tunnel or an HTTPS reverse proxy to create the superuser.
Which port does Paperless-ngx use?
Paperless-ngx listens on port 8000. On a VPS, publish it only on 127.0.0.1 and go through an HTTPS reverse proxy, then fill in PAPERLESS_URL with the public address. The port is changed in the ports line of the docker-compose.yml file.
How do I add documents to Paperless-ngx?
Drop files into the consume folder, for example over SFTP, drag them into the web interface, or set up fetching from a mailbox. Paperless reads the text, files the document, then removes it from the consume folder: this folder is a drop box, not storage.
How do I back up Paperless-ngx?
Run document_exporter, which writes documents, settings and the database into the export folder, then copy that folder off the VPS while keeping several versions. An export can only be imported back into the same version of Paperless; you can also back up the media, data and pgdata Docker volumes.
Does Paperless-ngx read documents in French?
Yes. Set PAPERLESS_OCR_LANGUAGE=fra in docker-compose.env: French is one of the languages installed by default in the Docker image. For other languages, the PAPERLESS_OCR_LANGUAGES variable lets you install extra ones.