# Running Node Red in Windows

**URL:** <https://discourse.nodered.org/t/running-node-red-in-windows/3697>\
**Category:** General\
**Created:** [4 October 2018 21:32 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697 "2018-10-04T21:32:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 21:32 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/1 "2018-10-04T21:32:42Z")

</div>

Hello guys

I'm running the red node with windows and would like to know how to automatically start it.

With the task manager it did not work well.

I configured using NSSM and until it starts but when I changed, for example, the port it did not load.

Anyone have any idea what might be happening?

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [4 October 2018 22:12 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/2 "2018-10-04T22:12:59Z")

</div>

What version of windows, what version of NR

Can you show us a screen shot of the startup and also the NSSM config ?

Craig

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [4 October 2018 22:21 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/3 "2018-10-04T22:21:28Z")

</div>

Are you saying that you made a change to the `settings.js` file, and the service did not restart? If so, then that is to be expected. There is no "watchdog" built-in to node-red... you would have to either create a flow that watches the userdir, or run it under `nodemon` -- or just do a manual restart.

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 22:25 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/4 "2018-10-04T22:25:34Z")

</div>

I am using Windows Server 2008.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/fa7da4515a58dfadef2d2c08930824ecdbd25f6e.jpeg)

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 22:27 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/5 "2018-10-04T22:27:04Z")

</div>

> [@shrickus](#):
>
> Are you saying that you made a change to the `settings.js` file, and the service did not restart? If so, then that is to be expected. There is no "watchdog" built-in to node-red... you would have to either create a flow that watches the userdir, or run it under `nodemon` -- or just do a manual restart.

No!

I actually restart the service manually. What I'm saying is that the settings made are not respected.

Like, I changed the door from 1880 to 8888 and it did not work.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 October 2018 22:27 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/6 "2018-10-04T22:27:15Z")

</div>

Didn't we cover this a few days ago. I gave the information on how to start node-red using the Windows Scheduler. NSSM can be used but isn't necessary. The Scheduler will try to restart a failing task but you may find something like PM2 to be more reliable and controllable (at the cost of significant additional resource use).

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [4 October 2018 22:29 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/7 "2018-10-04T22:29:36Z")

</div>

> [@dedynobre](#):
>
> What I'm saying is that the settings made are not respected.

Ok, well that sounds like you are changing the wrong `settings.js` file then... check the path that is output in the node-red log file at startup.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 October 2018 22:30 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/8 "2018-10-04T22:30:34Z")

</div>

which settings file did you edit... - when we start the first time the default one gets copied to the users directory. If you edited the "old" default one - then it won't affect the user one that is being used..

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 22:44 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/9 "2018-10-04T22:44:46Z")

</div>

I am ediing settings.js file in:  
C:\Users\xxxxx\AppData\Roaming\npm\node\_modules\node-red

but, I believe it is:  
C:\Users\xxxxx.node-red

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 22:52 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/10 "2018-10-04T22:52:36Z")

</div>

Did not work.

It looks like when I register a service it gets to the initial settings.

I was running the file node-red.cmd and when the settings changes it works normal.

When I close the node-red.cmd the red node to, right. When it starts the service it comes with the default start port.

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [4 October 2018 22:55 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/11 "2018-10-04T22:55:14Z")

</div>

Actually the default userdir should be in `C:\Users\xxxxx\.node-red`

If you can show us the console logs created when the service starts, that would make it clear. But I believe your Startup directory in the Nssm config is wrong -- it should be the userdir that I listed above.

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 22:57 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/12 "2018-10-04T22:57:36Z")

</div>

This configuration is correct?

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 22:59 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/13 "2018-10-04T22:59:02Z")

</div>

The NSSM configuration is correct.

If yes, then should be on the way to setting,js file

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 23:01 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/14 "2018-10-04T23:01:21Z")

</div>

C:\Users\xxxxx\AppData\Roaming\npm\node\_modules\node-red\settings.js the port is 8000

C:\Users\xxxxx.node-red\settings.js, the port is 8080

Starting the service, the node red is running in port 1880

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [4 October 2018 23:05 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/15 "2018-10-04T23:05:09Z")

</div>

> [@shrickus](#):
>
> Actually the default userdir should be in `C:\Users\xxxxx\.node-red`

> [@dedynobre](#):
>
> C:\Users\xxxxx.node-red\settings.js

The path you are showing is **not** correct... typically there is a hidden directory called `.node-red` underneath your user directory, _not_ another directory with the extension ".node-red".

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 23:07 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/16 "2018-10-04T23:07:22Z")

</div>

> [@dedynobre](#):
>
> C:\Users\xxxxx.node-red

The path correct is C:\Users\xxxxx\.node-red

it's this way

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 23:09 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/17 "2018-10-04T23:09:15Z")

</div>

But it's still not working the way it should.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f8d917df139311f86dbb6eb2e5ae17b58a71a355.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/008e96c98ead7ed29ed6fc95f21e9db47957fbab.png)

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [4 October 2018 23:17 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/18 "2018-10-04T23:17:11Z")

</div>

Do you have the env variable "PORT" set somewhere? Again, showing us the console log output would help...

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 23:18 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/19 "2018-10-04T23:18:37Z")

</div>

> [@shrickus](#):
>
> Do you have the env variable "PORT" set somewhere? Again, showing us the console log output would help...

What is the path of the log file? I did not find it

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [4 October 2018 23:21 UTC](https://discourse.nodered.org/t/running-node-red-in-windows/3697/20 "2018-10-04T23:21:32Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4bbb6c1403a7bb48cfcd3579dc2753ff1cce492d.png)

Executing this file normally opens:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f2aca10ba8d40142e1174372be7fff575dd926ab.png)

[Next page](https://discourse.nodered.org/t/running-node-red-in-windows/3697.md?page=2)
