Install Paperless-ngx
Make receipts and invoices searchable with Swedish text recognition, and include the line that otherwise stops the whole start.
Last reviewed:
What Paperless-ngx is
An archive for paper. You scan or photograph an invoice, a receipt or a contract, put the file in a folder, and Paperless-ngx takes care of the rest. It reads the text in the image, guesses who the sender is, sets the date and tags, and makes the document searchable in the archive.
That text reading is called OCR and it is what makes all the difference. A photographed invoice is just an image, and an image cannot be searched. After OCR it can be searched like any other text. You type the supplier's name in the search box and get every receipt you have from them.
A company collects more paper than you would think: purchase receipts, trade fair materials, contracts, invoices. At the annual closing everything must be accounted for, and an archive where you actually find things is worth more than a binder nobody has opened since last year.
This is a server program
Paperless-ngx does not run as a program on your computer. It needs two parts: the program itself and a queue service called Redis, which keeps track of which documents are waiting to be processed. Docker starts both at once. If you do not have Docker, start with Install Docker.
The program is free and open source, with no cloud version from the project itself. What exists is companies that run it for others, and they have nothing to do with the project.
Windows and Linux Mint
The same file on both. Create a folder called paperless in the home folder, that is in C:\Users\ert-namn on Windows and in /home/ert-namn on Linux Mint, and two empty subfolders called consume and export. In consume you put the files that will go into the archive. Then put a text file called compose.yaml in the paperless folder:
services:
broker:
image: redis:8
volumes:
- redisdata:/data
restart: unless-stopped
webserver:
image: ghcr.io/paperless-ngx/paperless-ngx:latest
depends_on:
- broker
ports:
- "8000:8000"
volumes:
- data:/usr/src/paperless/data
- media:/usr/src/paperless/media
- ./export:/usr/src/paperless/export
- ./consume:/usr/src/paperless/consume
environment:
- PAPERLESS_CONSUMER_POLLING=10
environment:
PAPERLESS_REDIS: redis://broker:6379
PAPERLESS_URL: http://localhost:8000
PAPERLESS_TIME_ZONE: Europe/Stockholm
PAPERLESS_OCR_LANGUAGE: swe+eng
PAPERLESS_OCR_LANGUAGES: swe eng
PAPERLESS_SECRET_KEY: BYT_UT_MIG
PAPERLESS_ADMIN_USER: admin
PAPERLESS_ADMIN_PASSWORD: BYT_UT_MIG_ADMIN
restart: unless-stopped
volumes:
data:
media:
redisdata:
Open the terminal and go into the folder. On Windows that is PowerShell:
cd $HOME\paperless
On Linux Mint the program is called Terminal:
cd ~/paperless
Then start:
docker compose up -d
If Docker cannot find a compose.yaml, you are in the wrong folder, and the cd line above is what is missing. The first start takes longer than you think, often five minutes or more, because the language packs for OCR are downloaded and the database is set up. Follow along in docker compose logs -f and wait until it says that Paperless has started. Then open http://localhost:8000 and log in with the account you set in the file. We ran exactly this setup, and Paperless-ngx started right away with the latest version and Swedish OCR active. The PAPERLESS_CONSUMER_POLLING line above is needed especially on Windows, where Docker Desktop does not always notice new files in the folder on its own.
The address only applies to the computer the archive runs on. localhost means the local machine, always, so a link that is passed on leads the recipient to the recipient's own computer. That does not matter as long as one person scans and searches. If the whole company is to access the archive, Paperless must run on a machine that is switched on, reached at that machine's address, for example http://192.168.1.42:8000, and PAPERLESS_URL is changed to the same address.
Three things to do first
- Drop three real receipts into the
consumefolder and see what happens. They disappear from the folder within a minute and show up in the archive. If you see nothing, check the log, because it says straight out what went wrong. - Add your most common suppliers as senders under Correspondents. Paperless learns over time which documents belong to whom, but it needs a few examples first.
- Decide on a single rule for tags and write it down in the company wiki. Three tags used consistently beat twenty that are used now and then.
The most common trap
Setting PAPERLESS_OCR_LANGUAGE to Swedish and thinking that is enough. That line tells you what language the text is in. It does not install the language. Without the line below, PAPERLESS_OCR_LANGUAGES, the word list itself is missing, and the container refuses to start with an error that reads roughly the selected ocr language swe is not installed.
We ran straight into it when we tested. Two lines, almost the same name, different jobs: PAPERLESS_OCR_LANGUAGE selects the language, PAPERLESS_OCR_LANGUAGES downloads it. If you have both as in the file above, Swedish receipts work right away.
The second thing to know is that the archive is your only copy if you throw away the paper. So export the whole archive at regular intervals, to the export folder that already exists in the file:
docker compose exec webserver document_exporter ../export
Then the documents are ordinary files, readable without Paperless. Copy that folder to another disk, and you have a backup worth the name.