-
Download, install, and configure Node.js, if necessary:
Ensure that you can run your script from the command line.
It's important to confirm that everything works exactly as you expect before introducing Windows Services!
-
Next, download and install AlwaysUp, if necessary.
-
Start AlwaysUp.
-
Select Application > Advisor to open the Application Advisor:
-
Click Next to get started:
-
Choose Node.js from the list of applications and click Next:
-
The advisor will spend a few seconds gathering information about your Node.js installation. Afterwards, you'll be asked to enter the
full path to your Node.js script (*.js):
We specified our slightly modified version of the
sample web server script mentioned on the Node.js home page,
saved as "C:\Scripts\web-server.js".
Click Next once your file is in place.
-
On the next screen, the Advisor will prompt you to enter the user name and password of your Windows account.
Click Next after you've entered them:
-
At this point, AlwaysUp has completed all the heavy lifting. Click Next to continue:
-
The Add Application window contains all the recommended settings for running your Node.js script 24x7 as soon as your computer boots.
If you are curious, you can cycle through the tabs and review the options that AlwaysUp has selected for you.
Click Save to record your new Node.js service:
-
In a couple of seconds, a new entry will show up in the AlwaysUp window. The service is now installed.
However, the state will be "Stopped" because the service isn't running yet:
-
To start your Node.js application from AlwaysUp, choose Application > Start.
The state will transition to "Running" and your script will be running invisibly in the background
(in Session 0):
At this point, you should verify that your script is working as expected. Is it doing what it should?
Our simple web server application worked flawlessly:
-
That's it! Next time your computer boots, your Node.js application will start up automatically, before anyone logs on.
We encourage you to edit the Node.js entry in AlwaysUp and check out the many other settings that may be helpful in your specific situation.
For example, you can: