Resolving listen EACCES Permission Denied 0.0.0.0:3000
When running a Node.js app on Windows, you may run into an error saying:
Error: listen EACCES: permission denied 0.0.0.0:3000This means your system blocked Node.js from using that port. The good news: it’s usually easy to fix. Below are the most common and reliable solutions.
Why This Error Happens
Node.js throws EACCES when:
- The port requires elevated permissions
- Another process already uses the port
- Windows NAT / networking services are stuck
- System TCP ranges are misconfigured
Ports below 1024 often require admin rights. Even higher ports (like 3000) can fail if Windows services misbehave or other apps occupy the port.
Solution 1: Change the Port (Fastest Fix)
Ports below 1024 may require elevated permissions, and port 3000 is often used by other tools (Next.js, React dev server, Vite, etc.). Switching to another port works in 99% of cases.
Plain Node.js HTTP Server
import http from 'http';
const PORT = process.env.PORT || 4000;
const server = http.createServer((req, res) => {
res.end('Hello from Node');
});
server.listen(PORT, '0.0.0.0', () => {
console.log(\`Server running at http://localhost:\${PORT}\`);
});Express.js
import express from 'express';
const app = express();
const PORT = process.env.PORT || 4000;
app.get('/', (req, res) => res.send('Hello from Express'));
app.listen(PORT, () => {
console.log(\`Express server at http://localhost:\${PORT}\`);
});NestJS — edit main.ts
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const PORT = process.env.PORT || 4000;
await app.listen(PORT, '0.0.0.0');
}
bootstrap();Next.js — update package.json
{
"scripts": {
"dev": "next dev -p 4000",
"start": "next start -p 4000"
}
}Vite / React / TanStack Router
{
"scripts": {
"dev": "vite --port 5174",
"preview": "vite preview --port 4174"
}
}Hono (Node.js or Bun)
import { Hono } from 'hono';
import { serve } from '@hono/node-server';
const app = new Hono();
const PORT = Number(process.env.PORT) || 4000;
serve({ fetch: app.fetch, port: PORT });Angular
ng serve --port 4300Solution 2: Restart Windows NAT (Fixes Most Port/Bind Issues)
Run PowerShell as Administrator:
net stop winnatThen reset TCP dynamic ports:
netsh int ipv4 set dynamic tcp start=49152 num=16384
netsh int ipv6 set dynamic tcp start=49152 num=16384Restart the service:
net start winnatThis often fixes hidden Windows networking bugs that block Node.js ports.
Solution 3: Free the Port (If Another App Uses It)
Check what process is using port 3000:
netstat -ano | findstr :3000Kill it:
taskkill /PID <id> /FSolution 4: Run Terminal as Administrator
Sometimes the issue is simply lack of permissions.
Right‑click → Run as Administrator → start your project again.
Solution 5: Use a Reverse Proxy (Production)
In production, apps rarely bind directly to port 80/443.
Use:
- Nginx
- Caddy
- Apache
Your Node.js app listens on 3000/8080 internally while Nginx handles public traffic.
Conclusion
The listen EACCES error is common, especially on Windows. Most of the time, switching the port or restarting NAT fixes it instantly. If not, check which process is using the port or run your terminal with admin permissions. After applying these steps, your Node.js server should run normally without permission errors.