# How to Fix Exit Code 137 (SIGKILL / OOMKilled) (2026 Verified Ubuntu/Docker Fix)

- URL: https://nodebudget.dev/errors/n8n-exit-code-137-oom-fix/
- Category: Memory & OOM · Severity: Critical
- Author: Yuanqiang Leng (https://github.com/a895047059)
- Updated: 2026-11-27

## Exact Log Signature
`container exited with code 137 | dmesg: Out of memory: Killed process (node)`

## Root Cause
Linux kernel OOM killer terminated n8n or OpenClaw because container RSS exceeded host RAM with no swap cushion.

## Verified Fix Commands
```bash
sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# Add to docker-compose.yml environment:
# NODE_OPTIONS=--max-old-space-size=2048
```

## Permanent Production Prevention
Use at least 4 GB RAM ($47.98/yr RackNerd BF) or 8 GB RAM (Hostinger KVM 2) + 2 GB swap.

### Additional n8n OOM Hardening Variables
- `N8N_DEFAULT_BINARY_DATA_MODE=filesystem` (prevents large PDF/audio attachments from staying in RAM)
- `EXECUTIONS_DATA_PRUNE=true` and `EXECUTIONS_DATA_PRUNE_MAX_COUNT=25000`
- Verify kernel kills with `dmesg -T | grep -i -E "oom|killed process"`
- Set Docker `mem_limit: 3g` with `NODE_OPTIONS=--max-old-space-size=2048` on a 4 GB+ VPS

---
Source: NodeBudget (https://nodebudget.dev/tools/error-decoder/)
