aggaton
aggaton

Reputation: 3350

Deploy nodejs in Windows environment

I am trying to deploy nodejs in a windows environment. As far as I can see nodejs is just a standard application run through the command-line. However running it that way is not very practical in a server environment. Is there a way to run it as a windows service, so you get all the benefits of controlling the execution as you have with other services? I found similar forum entries about this subject, however they are all related to running nodejs in a linux environment, how would you go about doing this in a window environment?

Upvotes: 16

Views: 19442

Answers (1)

haotang
haotang

Reputation: 5698

Nodejs application is not like mongodb, redis, nginx ... It's not supposed to run as an os service.

As a best practice, people usually use a process management tool like pm2 to run production nodejs applications. You can give it a try by creating a deploy.sh or deploy.bat as an execution file which trigger pm2 command to start or restart the application.

Upvotes: 14

Related Questions