Use this guide when build or test tooling fails with ENFILE, EMFILE, or
too many open files.
Typical symptoms
This usually appears in:
next buildfor the tenant app, internal company app, docs, or marketing,- Playwright e2e runs,
- Docker or BuildKit builds,
- self-hosted CI runners with low
nofilelimits.
Quick diagnostics
bash
Nanami docs
ulimit -n
cat /proc/self/limits | grep -i "open files"
Recommended baseline
- local dev: soft
65535, hard65535or higher, - CI or self-hosted runners: soft
65535, hard1048576.
Temporary shell fix
bash
Nanami docs
ulimit -Sn 65535
ulimit -Hn 65535
Persistent service fix
Systemd override:
ini
Nanami docs
# /etc/systemd/system/<service>.d/override.conf
[Service]
LimitNOFILE=1048576
Apply:
bash
Nanami docs
sudo systemctl daemon-reload
sudo systemctl restart <service>
Docker daemon default:
json
Nanami docs
{
"default-ulimits": {
"nofile": {
"Name": "nofile",
"Soft": 65535,
"Hard": 1048576
}
}
}
Then:
bash
Nanami docs
sudo systemctl restart docker
Docker Compose service override:
yaml
Nanami docs
ulimits:
nofile:
soft: 65535
hard: 1048576