# Running Node-Red Server as a Service

**URL:** https://discourse.nodered.org/t/running-node-red-server-as-a-service/20666
**Category:** General
**Created:** [21 January 2020 00:25 UTC](https://discourse.nodered.org/t/running-node-red-server-as-a-service/20666 "2020-01-21T00:25:13Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Yep](https://avatars.discourse-cdn.com/v4/letter/y/43a26b/32.png) [@Yep](https://discourse.nodered.org/u/Yep)
#### Post date: [21 January 2020 00:25 UTC](https://discourse.nodered.org/t/running-node-red-server-as-a-service/20666/1 "2020-01-21T00:25:13Z")

</div>

Hello,

I have created a node-red program to send emails and text messages, it is all working fine and is about to be uploaded to its own little server.  
My question is, is there a way to run it as a service on the server and are then any cons to doing so.  
The server will be running Windows Server 2008 R2 however as its a virtual server can be configured as required if this is a problem.

Thanks in advance,  
P.s Ideally the solution wont involved installing any 3rd party software like RunAsService but i am open to ideas

---

<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: [21 January 2020 00:58 UTC](https://discourse.nodered.org/t/running-node-red-server-as-a-service/20666/2 "2020-01-21T00:58:02Z")

</div>

This has been covered several times before in the forum, you should be able to search for it. You can also search on the Internet for running node.js as a service. There are various options.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [21 January 2020 10:04 UTC](https://discourse.nodered.org/t/running-node-red-server-as-a-service/20666/3 "2020-01-21T10:04:39Z")

</div>

some pointers...

> [@Node red multiple instances](https://discourse.nodered.org/t/node-red-multiple-instances/9787/5):
>
> Instead of changing settings file, I use the -p command line option to specify the port. I also use nssm on windows for multiple instances. So each service launches for example... node-red -p 1881 -u c:/nr1881 node-red -p 1882 -u c:/nr1882 And so on. BTW, @knolleary that document you linked to doesn't show the -p option or -t option.

> [@Run on windows as service](https://discourse.nodered.org/t/run-on-windows-as-service/13569):
>
> Hi, I have created a node-red application that works together with an Opto 22 controller to monitor alarms. I installed the app on the computer used on the company where it is going to be working. But sometimes operators close the command prompt where the node-red is running and the app stops. Is there a way to run node red as a windows service?. In that way as the computer is turned on, node red would be instantiated.

For the record - I use NSSM on windows server

---

<div class="post-metadata">

### Author: ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)
#### Post date: [21 January 2020 10:29 UTC](https://discourse.nodered.org/t/running-node-red-server-as-a-service/20666/4 "2020-01-21T10:29:55Z")

</div>

For Windows I can recommend NSSM as well.

On Linux systems I often use PM2 (launched by systemd) in conjunction with an ecosystem file.

---

<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: [21 January 2020 14:57 UTC](https://discourse.nodered.org/t/running-node-red-server-as-a-service/20666/5 "2020-01-21T14:57:08Z")

</div>

I'd personally only use PM2 (actually I use the lighter weight nodemon) for a development environment. systemd on its own does a fine job for running daemons.

---

<div class="post-metadata">

### Author: ![Yep](https://avatars.discourse-cdn.com/v4/letter/y/43a26b/32.png) [@Yep](https://discourse.nodered.org/u/Yep)
#### Post date: [22 January 2020 00:54 UTC](https://discourse.nodered.org/t/running-node-red-server-as-a-service/20666/6 "2020-01-22T00:54:59Z")

</div>

Thanks Everyone,

Using NSSM worked a treat.

P.s Sorry for making this post, i somehow missed the other posts in the forum.
