What’s running on port 9229 on my Mac?
9229 is the Node.js debugger. Something on your Mac was started with --inspect, and while that port is open, anything that can reach it can run code in that process.
Updated
Commonly used by
- Node.js
--inspectnode --inspectand--inspect-brkopen the V8 inspector on 127.0.0.1:9229. - NODE_OPTIONS / VS Code
NODE_OPTIONS=--inspector VS Code’s JavaScript Debug Terminal can turn it on for every child process. - Deno
deno run --inspectuses the same 127.0.0.1:9229 default. - Wrangler
wrangler devopens its DevTools inspector on 9229 by default.
Check what’s on port 9229
lsof -nP -iTCP:9229 -sTCP:LISTEN
ps -o pid,ppid,command -p <PID>
The command line shows --inspect or --inspect-brk, or nothing at all if it came from NODE_OPTIONS. To check that:
ps eww -o command -p <PID> | tr ' ' '\n' | grep NODE_OPTIONS
The inspector also describes itself:
curl -s http://127.0.0.1:9229/json/list
That returns the script path and a webSocketDebuggerUrl for each debuggable target.
With Stat Space: statspace port 9229.
Free it or change it
Stop the process with kill <PID>, or restart it without --inspect. To keep debugging but avoid collisions:
| Situation | Fix |
|---|---|
| Two Node apps | node --inspect=9230 app.js for the second |
| Many children (test runners, monorepos) | --inspect=0 for a random free port each |
NODE_OPTIONS set in your shell | unset NODE_OPTIONS, or remove it from ~/.zshrc |
| Wrangler vs Node | wrangler dev --inspector-port 9230 |
Security: never expose 9229
The inspector speaks the Chrome DevTools Protocol, which can evaluate any JavaScript inside the process. That means reading files, spawning shells and reading environment secrets, with no password. Exposing it is remote code execution on your Mac.
- The default
127.0.0.1:9229is local only. Keep it. --inspect=0.0.0.0:9229, often copied from Docker guides, puts it on every network you join. Use it only inside a container whose port you publish as-p 127.0.0.1:9229:9229.- To debug a remote machine, tunnel instead:
ssh -L 9229:localhost:9229 server.
Even on localhost, any web page can try to talk to it, which is why Node checks the Host header. Don’t leave --inspect on in long-running services. More in dev server exposed to the network.
Seeing it live
Stat Space lists 9229 next to the app port of the same Node process, with its project folder and launcher, and flags it if it’s bound to 0.0.0.0. A debugger that’s been open for days is hard to miss.
Questions
What does 'Starting inspector on 127.0.0.1:9229 failed: address already in use' mean?
Another process already has the debugger port, often because NODE_OPTIONS=--inspect applies to every Node process you start. Give each its own port with --inspect=9230, or use --inspect=0 to pick a random one.
How do I connect to a process on 9229?
Open chrome://inspect in Chrome and click inspect under Remote Target, or use VS Code's Attach to Node Process. Both find 9229 automatically.
Is port 9229 open on a Mac by default?
No. It only opens when a Node, Deno or Wrangler process is started with debugging on, and closes when that process exits.
Know what your Mac is doing, without adding to it.
Free, no account. Pro is $9.99 once for the first 100 buyers.