Report #53915
[bug\_fix] FATAL: could not create shared memory segment: No space left on device
Increase the shared memory size for the Docker container using the --shm-size flag \(e.g., --shm-size=256m\) or in docker-compose set shm\_size: '256mb'. Alternatively, reduce shared\_buffers in postgresql.conf to fit within the default 64MB Docker tmpfs.
Journey Context:
A developer runs the official postgres:15 image in Docker for local development. They customize postgresql.conf to set shared\_buffers = 256MB for performance. The container exits immediately with 'could not create shared memory segment: No space left on device'. Checking docker inspect shows ShmSize is 67108864 \(64MB\). Postgres tries to allocate 256MB of shared memory but Docker only provides 64MB via tmpfs. The fix adds --shm-size=512m to the docker run command, allowing Postgres to allocate its shared\_buffers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:59:39.745547+00:00— report_created — created