> ## Content Index
> Fetch the complete content index at: https://www.binarysludge.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# PhpStorm remote debugging Node.js on a foreign host (JetBrains, Webstorm, RubyMine)
- URL: https://www.binarysludge.com/2012/02/21/phpstorm-remote-debugging-node-js-on-a-foreign-host-jetbrains-webstorm-rubymine/
- Published: 2012-02-21T20:05:50.000Z
- Updated: 2015-01-16T18:03:19.000Z
- Author: Andrew Martin
- Tags: Debugging, error, IDE, Javascript, JetBrains, Node.js, PhpStorm, RubyMine, WebStorm, #Import 2026-10-22 12:56

![Node.js](http://c213.r13.cf3.rackcdn.com/nodejs-black[1].png "Node.js")

[node-inspector](https://github.com/dannycoates/node-inspector?ref=binarysludge.com) is the de-facto standard Node.js debugger, but runs in another browser window. For those that like their IDEs fully integrated, PhpStorm *should* support remote debugging functionality for Node.js but is currently buggy - it will only connect to servers on the same host. The bug is [here](http://youtrack.jetbrains.net/issue/WI-9821?ref=binarysludge.com "Bug WI-9821").

For when the bug is fixed, here are RHEL/CentOS instructions on how to connect to a remote Node.js process (Node.js currrently only allows its debugger to listen for connections on `127.0.0.1`, which isn't much use for remote debugging).

On VM console 1 (`-df` debug mode on for diagnosis):

yum install balance -yt
balance -df 8585 127.0.0.1.5858

On VM console 2:

node --debug app.js 

On host:

telnet {VM IP} 8585

Should output

Type: connect
V8-Version: 3.6.6.14
Protocol-Version: 1
Embedding-Host: node v0.6.6
Content-Length: 0

VM console 1:

$ balance -df 8585 127.0.0.1:5858
argv[0]=balance
bindhost=NULL
source port 8585
file /var/run/balance/balance.8585.0.0.0.0 already exists
the following channels are active:
  0  0 127.0.0.1:5858:0
connect from 172.27.4.11
trying group 0 channel 0 ... connect to channel 0 successful
connect from 172.27.4.11
trying group 0 channel 0 ... connect to channel 0 successful

The connection is working, so attach the remote debugger in PhpStorm (this is the step that's currently broken):

| Host:       | 172.27.8.04 (replace with VM's IP) |
| ----------- | ---------------------------------- |
| Debug Port: | 8585                               |

Debug on!