From 735c3b073a254ea86b88b7fcde670b82b8034a1b Mon Sep 17 00:00:00 2001 From: Albert Mikaelyan Date: Wed, 15 Jul 2026 10:19:22 -0700 Subject: [PATCH] Fix: allow setting any UID and GID when running rootless (#13090) --- Dockerfile | 4 ++++ docs/setup.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2fdce08b1..929d205b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -238,6 +238,10 @@ RUN set -eux \ && chown --from root:root --changes --recursive paperless:paperless /usr/src/paperless \ && echo "Making fontconfig cache writable for arbitrary container UIDs" \ && chmod 1777 /var/cache/fontconfig \ + && echo "Making /run world-writable for rootless operation" \ + && chmod 1777 /run \ + && echo "Removing setuid from s6-overlay-suexec for rootless compat" \ + && chmod u-s /command/s6-overlay-suexec \ && echo "Collecting static files" \ && PAPERLESS_SECRET_KEY=build-time-dummy s6-setuidgid paperless python3 manage.py collectstatic --clear --no-input --link \ && PAPERLESS_SECRET_KEY=build-time-dummy s6-setuidgid paperless python3 manage.py compilemessages \ diff --git a/docs/setup.md b/docs/setup.md index 9420ba40b..f58313ddd 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -142,7 +142,7 @@ a [superuser](usage.md#superusers) account. It is not possible to run the container rootless if additional languages are specified via `PAPERLESS_OCR_LANGUAGES`. -If you want to run Paperless as a rootless container, set `user:` in `docker-compose.yml` to the UID and GID of your host user (use `id -u` and `id -g` to find these values). The container process starts directly as that user with no internal privilege remapping: +If you want to run Paperless as a rootless container, set `user:` in `docker-compose.yml` to the UID and GID of your host user (use `id -u` and `id -g` to find these values). The container process starts directly as that user with no internal privilege remapping. Any UID and GID is supported: ```yaml webserver: