Allow running as non-root #343

Closed
opened 2026-04-05 16:16:15 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @lucasstinis on 12/17/2025

Thanks for sharing your project, it's really useful!

In regards to security, it would be great to be able to run the container as a non-root user, settable through e.g. compose -> user: "1010:1010". As far as I can tell, the main reason the container requires running as root is to create its file structure at startup, which should be a one-time step. It would be preferable to do this through a separate setup script or just manually by the user when setting up Postgresus for the fist time.

Solving it by doing cap_drop: all / cap_add: ... and always having to run as root doesn't feel "clean" as it's not a security best practice.

Hope this suggestion makes sense and you decide to implement it! Thanks and keep up the great work.

Cheers

*Originally created by @lucasstinis on 12/17/2025* Thanks for sharing your project, it's really useful! In regards to security, it would be great to be able to run the container as a non-root user, settable through e.g. compose -> `user: "1010:1010"`. As far as I can tell, the main reason the container requires running as root is to create its file structure at startup, which should be a one-time step. It would be preferable to do this through a separate setup script or just manually by the user when setting up Postgresus for the fist time. Solving it by doing `cap_drop: all` / `cap_add: ...` and always having to run as root doesn't feel "clean" as it's not a security best practice. Hope this suggestion makes sense and you decide to implement it! Thanks and keep up the great work. Cheers
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/databasus#343