How to Fix Docker Exit Code 137 (Fatal error: Out of Memory / OOMKilled)
Exit code 137 indicates a process was killed by the Linux kernel with SIGKILL (signal 9 + 128 = 137), almost always triggered by the Out-Of-Memory (OOM) killer when a container exceeds its memory allocation.
Docker Container Exited with Code 137 (OOMKilled)
Quick Fix Checklist
- Verify OOM status: docker inspect <container_id> --format="{{.State.OOMKilled}}"
- Increase Docker Desktop VM RAM in Settings -> Resources -> Memory to 4GB or 8GB
- Add NODE_OPTIONS="--max-old-space-size=4096" to your Dockerfile or compose environment
- Set explicit memory limits in docker-compose: deploy.resources.limits.memory: 4G