run PostgeSQL rootless
10K+

run PostgeSQL rootless
PostgreSQL is a powerful, open-source, object-relational database management system known for its reliability, feature set, and adherence to standards. It supports both SQL (relational) and JSON (non-relational) querying and is backed by a large, active community.
What can I do with this? This image will run postgres as postgres with the database postgres and the password you set initially. Why so simple? Because 99.9% of all containers that need postgres, are happy with the default settings, no different dbname, different dbuser, whatever needed. It also adds a simple backup scheduler that will backup your database if POSTGRES_BACKUP_SCHEDULE is set. It allows for incremental backups too if enabled.
Supported PostgreSQL versions: 15, 16, 17 and 18
Why should I run this image and not the other image(s) that already exist? Good question! Because ...
If you value security, simplicity and optimizations to the extreme, then this image might be for you.
Below you find a comparison between this image and the most used or original one.
| image | size on disk | init default as | distrolessβ | supported architectures |
|---|---|---|---|---|
| 11notes/postgres | 61MB | 1000:1000 | β | amd64, arm64, armv7 |
| postgres | 304MB | 0:0 | β | 386, amd64, arm64v8, armv6, armv7, ppc64le, riscv64, s390x |
Checkout compose.secrets.ymlβ if you want to use secrets instead of environment variables.
name: "db"
x-lockdown: &lockdown
# prevents write access to the image itself
read_only: true
# prevents any process within the container to gain more privileges
security_opt:
- "no-new-privileges=true"
services:
postgres:
image: "11notes/postgres:18"
<<: *lockdown
environment:
TZ: "Europe/Zurich"
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
# make a full and compressed database backup each day at 03:00
POSTGRES_BACKUP_SCHEDULE: "0 3 * * *"
# only keep the last five backups
POSTGRES_BACKUP_RETENTION: 5
ports:
- "5432:5432/tcp"
- "9090:9187/tcp"
networks:
frontend:
volumes:
- "postgres.etc:/postgres/etc"
- "postgres.var:/postgres/var"
- "postgres.backup:/postgres/backup"
tmpfs:
# needed for read-only
- "/postgres/run:uid=1000,gid=1000"
- "/postgres/log:uid=1000,gid=1000"
restart: "always"
volumes:
postgres.etc:
postgres.var:
postgres.backup:
networks:
frontend:
To find out how you can change the default UID/GID of this container image, consult the RTFMβ .
| Parameter | Value | Description |
|---|---|---|
user | docker | user name |
uid | 1000 | user identifierβ |
gid | 1000 | group identifierβ |
home | /postgres | home directory of user docker |
| Parameter | Value | Default |
|---|---|---|
TZ | Time Zoneβ | |
DEBUG | Will activate debug option for container image and app (if available) | |
POSTGRES_PASSWORD | Password for the postgres user | |
POSTGRES_PASSWORD_FILE (optional) | Secrets file containing the password for the postgres user (check compose.secrets.ymlβ ) | |
POSTGRES_BACKUP_SCHEDULE (optional) | Set backup schedule for full backups (crontab style) | |
POSTGRES_BACKUP_RETENTION (optional) | Set backup retention points to keep | 0 (disabled) |
These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value.
docker pull 11notes/postgres:18
docker pull ghcr.io/11notes/postgres:18
docker pull quay.io/11notes/postgres:18
This image supports unraid by default. Simply add -unraid to any tag and the image will run as 99:100 instead of 1000:1000.
This image supports nobody by default. Simply add -nobody to any tag and the image will run as 65534:65534 instead of 1000:1000.
This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the releasesβ for breaking changes. If you have any problems with using this image simply raise an issueβ , thanks. If you have a question or inputs please create a new discussionβ instead of an issue. You can find all my other repositories on githubβ .
created 23.07.2026, 08:46:35 (CET)
Content type
Image
Digest
sha256:5c0f70507β¦
Size
28 MB
Last updated
19 days ago
docker pull 11notes/postgres:18