BlogWikiAbout

Kyle Pericak

"It works in my environment"

Created: 2019-09-06Updated: 2026-05-03

Docker Shared Memory: 64MB /dev/shm Default and --shm-size

Category:developmentTags:docker
Docker's default /dev/shm size is 64MB. Raise it per-container with --shm-size, set a daemon-wide default in daemon.json, or remount /dev/shm on the host.

Docker supports shared memory. The default /dev/shm size is only 64MB, which is tiny for anything doing serious IPC or running Chromium-based tools.

The small size became a problem during a containerized OpenStack upgrade.

This will be a really short post because I haven't done much playing with the shared memory yet, I just think its really neat.


Change the /dev/shm size on the system

This lets you change the size of shared memory on a host.

mount -o remount,size=1G /dev/shm

Update Docker Daemon's Default Shared Memory Size

This will update the default across the whole Docker service.

vi /etc/docker/daemon.json

{
  "default-shm-size": "512M"
}

Set a Containers Shared Memory Size

Here's how to change it for a specific container at runtime.

docker run -it --shm-size=512M
Blog code last updated on 2026-05-10: 2643ad795e21d296b577516823e6878dab2fb1e2