Keep Paperless-ngx. Change one line.
Paperless-ngx sends your Office files and emails to Gotenberg to make the PDFs it archives. Marqius Kern is a drop-in replacement for Gotenberg: change the image of Paperless-ngx’s gotenberg service and keep everything else. A 41 MB server takes the place of a 672 MB one.
- Paperless-ngx’s own tests, in public
- A 41 MB image instead of 672 MB
- Free for personal use
The same archive, on a smaller server.
- Smaller and lighter. Ready in 0.14 seconds.
16× smaller A 41 MB image instead of the 672 MB of Gotenberg 8.38, the version Paperless-ngx’s compose files use.
6× less memory 80 MB of memory instead of 558 MB, after archiving one file of each kind. - Maintained. Paperless-ngx calls Gotenberg 8’s API, and Gotenberg 8 no longer gets fixes. Marqius Kern answers that API, maintained.
- Nothing to babysit. No browser and no office suite inside: one program, started for each document, with nothing left running in between and nothing to restart.
- Your documents stay at home. Self-hosted, like Paperless-ngx: your papers never leave your own server.
Change the image. Keep its command.
In your Paperless-ngx docker-compose.yml, the gotenberg service changes one line, its image, and keeps its command:
gotenberg:
- image: docker.io/gotenberg/gotenberg:8.38
+ image: marqius/kern
restart: unless-stopped
command:
- "gotenberg"
- "--chromium-disable-javascript=true"
- "--chromium-allow-list=^file:///tmp/.*"
In the folder of that file, these two commands make the change, keeping your old file as docker-compose.yml.bak, and start the service again with the new image:
sed -i.bak 's#image: docker.io/gotenberg/gotenberg:.*#image: marqius/kern#' docker-compose.ymldocker compose up -dPAPERLESS_TIKA_GOTENBERG_ENDPOINT stays http://gotenberg:3000: the service keeps its name. To go back, put the old file back:
mv docker-compose.yml.bak docker-compose.ymldocker compose up -dWhat keeps working, and what does not yet.
- Office files. Word (.docx and .doc), Excel (.xlsx and .xls), PowerPoint (.pptx and .ppsx), OpenDocument text, spreadsheets and presentations, and RTF are archived as PDF/A, as Paperless-ngx asks, with their thumbnails.
- Emails. Each email is archived as one PDF: Paperless-ngx’s page with the sender, subject and names of the attachments, then the email itself with its pictures.
- Search. Paperless-ngx reads the words of Office files with Tika, and of emails from the email itself, so search finds what it found before.
- PDFs, photos and scans. Paperless-ngx reads them itself and never sends them to Gotenberg: the switch does not touch them.
- Your settings. The service keeps its name, its command and its address, and
PAPERLESS_OCR_OUTPUT_TYPEstill chooses the kind of PDF/A.
Not yet: PowerPoint 97-2003 slides (.ppt) and OpenDocument drawings (.odg). Marqius Kern refuses them with the reason, and Paperless-ngx shows the upload as failed. If you archive those, keep Gotenberg for now.
Looks different: on an email’s first page, the grey band behind the sender and subject is not drawn, and email addresses are underlined. An Excel 97-2003 sheet (.xls) prints without the header and footer it sets.
Paperless-ngx’s own tests, run against both.
Paperless-ngx’s own tests of its Office and email archiving run unchanged against Gotenberg and against Marqius Kern, on GitHub’s machines, and every result is public, differences included.
| Pass on Gotenberg | Pass on Marqius Kern | |
|---|---|---|
| Paperless-ngx 3.5.1’s own tests of its Office and email archiving | 8 | 6 |
| Word (.doc and .docx) and OpenDocument text, archived as PDF (one of them after Tika’s second try) | 4 | 4 |
| An email’s text, read by Tika, and its thumbnail | 2 | 2 |
| An email printed to PDF/A, and two PDFs merged into one PDF/A file, each compared word for word with Gotenberg’s | 2 | 0 |
See Paperless-ngx’s results on the scoreboard
The two that differ, and why: Paperless-ngx asks for PDF/A when it archives an email, and merges the email’s pages into one file. Marqius Kern writes the PDF/A file directly from the document and keeps merged pages exactly as they were. Gotenberg makes PDF/A by re-importing the file through LibreOffice, which can move words onto tab stops; the two tests compare the text with copies Gotenberg made. What it means for you: the words in the archived PDF are the same, and only the spaces between them can differ when you copy text out. Paperless-ngx’s search is not affected: it reads Office files with Tika, and emails from the email itself.
Free at home. Licensed for business.
Personal, teaching and open-source use is free with a Community licence. Archiving your own papers at home is personal use, and it works without a key too: Marqius Kern then makes the same documents and says in its log that it has none.
A free key takes that line away:
- Get your free key on marqius.com/licence/marqius-kern, then sign in with Google.
- Tick “I’ll use Marqius Kern only for personal, teaching or open-source work”.
- Get my free key, then Copy key.
- Add it to Paperless-ngx’s compose file, as the variable
MARQIUS_LICENCEof thegotenbergservice.
Anything done by or for a business, including internal tools and client work, needs a paid licence. See the plans and prices.
Questions
Can Paperless-ngx use something other than Gotenberg?
Yes. Paperless-ngx calls Gotenberg’s API at the address in PAPERLESS_TIKA_GOTENBERG_ENDPOINT. Marqius Kern answers the same API, so changing the image of the gotenberg service is the whole switch.
Which files does Paperless-ngx send to Gotenberg?
Office files (Word, Excel, PowerPoint, OpenDocument and RTF) and emails, to make the PDFs it archives. PDFs, photos and scans never go to Gotenberg: Paperless-ngx reads them itself, so the switch does not touch them.
Does Paperless-ngx work with Gotenberg 9?
Not as it stands. Paperless-ngx 3.5.1 calls Gotenberg 8’s API, and Gotenberg 9 changed it: it renamed the field Paperless-ngx uses to ask for PDF/A, and removed the route it merges emails with. With Gotenberg 9.10.3 in its place, every Office file and email we uploaded failed. Marqius Kern answers Gotenberg 8’s API, so Paperless-ngx works with it as it is.
How much memory does it use beside Paperless-ngx?
About 80 MB after archiving one file of each kind, as docker stats shows it, against 558 MB for Gotenberg 8.38, which keeps Chromium and LibreOffice running once they have started. Before the first document, Gotenberg shows 7 MB and Marqius Kern 59 MB, most of that the pages of its own program, which the system can drop.
Does it run on a Raspberry Pi?
Yes, with a 64-bit system: the image runs on arm64, as it does on amd64.
Will the documents I have archived change?
No. Paperless-ngx keeps the PDFs it has archived. New uploads are archived by Marqius Kern, with the same words.
Is it free for Paperless-ngx at home?
Yes. Personal use, such as archiving your own papers at home, is free with a Community licence, and it works without a key too: the log then says it has none. Anything done by or for a business needs a paid licence.
How do I go back to Gotenberg?
Put the old file back with mv docker-compose.yml.bak docker-compose.yml and run docker compose up -d. Nothing else was changed.
Change one line. Keep your archive.
Try it on a new Paperless-ngx first, as the switching guide shows, then change your own.