Deploying Nodejs on a Windows server using NSSM

Source: Internet
Author: User

On Linux, you can easily deploy NODEJS applications using forever or PM2. But under Windows it was a hassle, and PM2 clearly said that support for Linux & Macos,forever looks like a lot of problems in Windows:

There is also a choice is iisnode, this has the time to study, today first the more simple NSSM. NSSM will monitor the node service you installed, and if node is dead, NSSM will restart it automatically.

Installation use

Currently the latest version is 2.23 (), unzip after download, according to your system select 32-bit and 64-bit version, directly in the nssm.exe directory Run command line, enter nssm install + your service name, for example:

    1. NSSM Install test

The GUI interface is then displayed:

In the Path Select your installed Node.exe, Startup directory Select your node app's directory, Argument enter your startup file, such as run on my desktop index.js (in the Startup directory directory execution node index.js ):

Click Install Service:

Then run:

    1. NSSM Start test

The service has started, I just index.js started an HTTP server with the file, listening on port 3000 and can now open 127.0.0.1:3000 access:

Other settings can refer to the official documentation. Its command-line operation is also simple:

    1. NSSM Start <servicename>
    2. NSSM Stop <servicename>
    3. NSSM Restart <servicename>

Specific operation of the official documents are described in detail, no longer repeat.

At present, an intranet small project using the Nodejs, to find the System group application server and deployment is more troublesome (previously no node project), on a Windows server on its own use of NSSM simple deployment, the specific performance of the study.

Source: http://my.oschina.net/u/1582119/blog/316069

Deploying Nodejs on a Windows server using NSSM

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.