Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep node in running state even after user log-off

How to keep a node application running in windows even when user logs off? Also how to keep running a node http-server even after user log-off?

like image 374
Machau Avatar asked Dec 04 '25 15:12

Machau


1 Answers

You have 2 great options. One is as mentioned in comments above Forever.

The other is PM2 which is easy to install and offers an incredible amount of options. I use this in all projects, but I cannot attest to the Windows version as I am on Linux & Ubuntu servers and work on a Mac. You can daemonize your node process, follow logs, cluster it and make sure the process reboots even with a server shutdown (it is a service).

like image 153
twg Avatar answered Dec 07 '25 04:12

twg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!