Running a Script via PM2 on a VPS Server
Let's now run our test site script via PM2. First, let's navigate to our project folder:
cd /var/www/test.com
Now let's start our script:
pm2 start app.js
After this, you can open the site in your browser and it will work even with the terminal closed.
Run the test site script via PM2.