Node.js: Error: listen EACCES: permission denied (port 80)
Error: listen EACCES: permission denied 0.0.0.0:80
at Server.setupListenHandle [as _listen2] (node:net:1284:21)
at Server.listen (node:net:1333:10)
Immediate Remediation
bash
Run with sudo: `sudo node server.js` or change to a port above 1024: `PORT=8080 node server.js`
Root Cause Analysis
The process tried to bind to a privileged port (<1024) without the necessary OS permissions, which are typically restricted to root on Linux/macOS.
Verification & Guardrails
- Using sudo is not recommended for production; use a reverse proxy like nginx to forward from port 80 to a higher port.
- On Windows, ports below 1024 are not restricted, so this error is less common.
- Check if another process is already using the port (EADDRINUSE) - this error is specifically about permissions.
Have a custom or uncategorized crash?
Run your trace through our in-memory client privacy sandbox for instant SRE remediation.