Jump to content

Paperless-ngx: Difference between revisions

From Official NixOS Wiki
Tboston (talk | contribs)
Add one more example with showing settings and user generation
Epskoon (talk | contribs)
add 'More commands' in section 'Maintenance'
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{application infobox
  |name=Paperless-ngx
  |type=Container
  |image=Paperless-ngx-logo.svg
  |firstRelease=March 2022
  |latestRelease=2.20.6
  |status=Active
  |license=GNU General Public License v3.0 or later
  |os=Cross-platform
  |platform=Docker
  |programmingLanguage=Python, TypeScript
  |website=[https://paperless-ngx.com paperless-ngx.com]
  |github=paperless-ngx/paperless-ngx
  |bugTracker=[https://github.com/paperless-ngx/paperless-ngx/issues GitHub Issues]
  |documentation=[https://docs.paperless-ngx.com Paperless-ngx Documentation]
}}
[https://paperless-ngx.com Paperless-ngx] is a community-supported open-source document management system that transforms your physical documents into a searchable online archive, allowing you to reduce paper clutter.
[https://paperless-ngx.com Paperless-ngx] is a community-supported open-source document management system that transforms your physical documents into a searchable online archive, allowing you to reduce paper clutter.


Line 12: Line 28:
   enable = true;
   enable = true;
   consumptionDirIsPublic = true;
   consumptionDirIsPublic = true;
   address = "paperless.example.com";
   address = "<machine ip>";
   settings = {
   settings = {
     PAPERLESS_CONSUMER_IGNORE_PATTERN = [
     PAPERLESS_CONSUMER_IGNORE_PATTERN = [
Line 23: Line 39:
       pdfa_image_compression = "lossless";
       pdfa_image_compression = "lossless";
     };
     };
    PAPERLESS_URL = "https://paperless.example.com";
   };
   };
};
};
</syntaxhighlight>After the installation, you can set an admin user yourself via the following command on the server <syntaxhighlight lang="bash">
</syntaxhighlight>After the installation, you can set an admin user yourself via the following command on the server <syntaxhighlight lang="bash">
sudo /var/lib/paperless/paperless-manage createsuperuser
sudo paperless-manage createsuperuser
</syntaxhighlight>
</syntaxhighlight>
== Maintenance ==
Paperless-ngx comes with some [https://docs.paperless-ngx.com/administration/#management-commands management commands] that can be used for various maintenance tasks. On NixOS you can invoke these commands with <code>paperless-manage</code> in the following way:
==== Export / Backup ====
Creating backups of your data (incl. settings and database) can be configured and automated with [https://search.nixos.org/options?channel=unstable&query=services.paperless.exporter&type=options services.paperless.exporter]. If needed you can also manually trigger an export with <code>document_exporter</code>for example:<syntaxhighlight>
sudo -u paperless paperless-manage document_exporter /var/lib/paperless/export <arguments>
</syntaxhighlight>
==== Import ====
The <code>document_importer</code> takes your previously created export and imports it into paperless:<syntaxhighlight>
sudo -u paperless paperless-manage document_importer /path/to/export <arguments>
</syntaxhighlight>
==== More commands ====
Check [https://docs.paperless-ngx.com/administration/#management-commands official documentation] for more management commands and further explanation.
== FAQ ==
=== Why is Paperless being rebuilt from source, even if there is a version in the package cache? ===
If you have set <code>PAPERLESS_OCR_LANGUAGE</code>, the tesseract OCR engine and consequently paperless-ngx are recompiled for your specified languages.
[[Category:Server]]
[[Category:Server]]
[[Category:Web Applications]]
[[Category:Web Applications]]

Latest revision as of 15:41, 18 October 2026

Paperless-ngx

Container Application

100%
Latest release2.20.6
StatusActive
Operating SystemCross-platform
Platform(s)Docker
Language(s)Python, TypeScript
LicenseGNU General Public License v3.0 or later
External links
Websitepaperless-ngx.com
GitHubpaperless-ngx/paperless-ngx
Bug trackerGitHub Issues
DocumentationPaperless-ngx Documentation

Paperless-ngx is a community-supported open-source document management system that transforms your physical documents into a searchable online archive, allowing you to reduce paper clutter.

Setup

The following example configuration will enable Paperless locally

❄︎ /etc/nixos/configuration.nix
environment.etc."paperless-admin-pass".text = "admin";
services.paperless = {
  enable = true;
  passwordFile = "/etc/paperless-admin-pass";
};

After applying the configuration you can access the instance via http://localhost:28981 and login with username admin and password admin. Another example below could be used on a server with an actual URL and some extra settings.

services.paperless = {
  enable = true;
  consumptionDirIsPublic = true;
  address = "<machine ip>";
  settings = {
    PAPERLESS_CONSUMER_IGNORE_PATTERN = [
      ".DS_STORE/*"
      "desktop.ini"
    ];
    PAPERLESS_OCR_LANGUAGE = "deu+eng";
    PAPERLESS_OCR_USER_ARGS = {
      optimize = 1;
      pdfa_image_compression = "lossless";
    };
    PAPERLESS_URL = "https://paperless.example.com";
  };
};

After the installation, you can set an admin user yourself via the following command on the server

sudo paperless-manage createsuperuser

Maintenance

Paperless-ngx comes with some management commands that can be used for various maintenance tasks. On NixOS you can invoke these commands with paperless-manage in the following way:

Export / Backup

Creating backups of your data (incl. settings and database) can be configured and automated with services.paperless.exporter. If needed you can also manually trigger an export with document_exporterfor example:

sudo -u paperless paperless-manage document_exporter /var/lib/paperless/export <arguments>

Import

The document_importer takes your previously created export and imports it into paperless:

sudo -u paperless paperless-manage document_importer /path/to/export <arguments>

More commands

Check official documentation for more management commands and further explanation.

FAQ

Why is Paperless being rebuilt from source, even if there is a version in the package cache?

If you have set PAPERLESS_OCR_LANGUAGE, the tesseract OCR engine and consequently paperless-ngx are recompiled for your specified languages.