How do I start pm2 service in Windows?
How do I start pm2 service in Windows?
In terminal cd into: C:\NodeJS\npm\node_modules\pm2-windows-service….Setup the app(s) you like PM2 to startup – when shutdown or after a reboot:
- pm2 start myApp. js –name mySuperApp.
- pm2 -f save.
- reboot or if you use AWS (or any other cloud provider).
Does pm2 start on boot?
Generating a Startup Script Now PM2 will automatically restart at boot.
What does pm2 startup do?
pm2 save takes a snapshot of your currently running Node applications. You can then restore these applications using pm2 resurrect . This is useful because it means you don’t have to manually restart each application when you restart pm2 (such as a machine reboot).
Can pm2 run on Windows?
The key point for PM2 on Windows is to set up Windows an environment variable PM2_HOME at system level.
How to start PM2 on Windows Server 2012?
Create a Windows Batch file that consist of PM2 script to start our application @echo off SET PM2_HOME = C:\\etc\\.pm2 pm2 start “D:\\Your_Folder\\Application\\File_App.js” –name app-1 Save file as “pm2-myapp.bat” and try to run the Batch file, if error occurred then check your script inside the file.
Where do I save the PM2 startup script?
Once you started all the applications you want to manage, you have to save the list you wanna respawn at machine reboot with: It will save the process list with the corresponding environments into the dump file $PM2_HOME/.pm2/dump.pm2.
How to auto start PM2 with node application on Windows?
Today I gonna share with you guys how to auto start PM2 with Node Application on Windows after reboot? For this approach, we will use this pm2-windows-service module to achieve this. 1. Configure the PM2. npm i -g pm2. Copy C:\\Users\\ \\.pm2 folder to C:\\etc\\.pm2.
What does PM2 do when the system reboots?
PM2 ships with the functionality to generate startup scripts for multiple init systems. These scripts are executed on system boot and with that spawn the PM2 process itself which is required to (re)start application servers.