Lowercase filenames in Paperless-ngx

Another quick tip.

Paperless-ngx lets you decide how documents are stored on disk with PAPERLESS_FILENAME_FORMAT. By default you end up with folders and filenames full of capital letters and spaces, which is annoying the moment you touch them from a terminal.

This is the template I use:

PAPERLESS_FILENAME_FORMAT={{ created_year | lower | replace(" ", "-") }}/{{ correspondent | lower | replace(" ", "-") }}/{{ title | lower | replace(" ", "-") }}

Everything gets lowercased and spaces become dashes, so you end up with a tidy tree like:

2026/electricity-company/january-invoice.pdf

Set it in your docker-compose.yml environment section (or paperless.conf if you're not using Docker Compose) and restart the container.

Existing documents are not renamed automatically. To apply the new format to what's already there, run:

docker compose exec webserver document_renamer

Much nicer to work with.

I ♥ RSS