Created: 2019-09-06Updated: 2026-05-03
Docker Shared Memory: 64MB /dev/shm Default and --shm-size

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