1 Using PM2 to keep the Node Server running
Tom edited this page 2018-04-26 14:03:59 +02:00

If you want to keep the nodejs Sever running after you logged out of your Terminal there are different ways to do this:

  • screen
  • pm2
  • forever

I will show you how to keep it running with PM2, because this works same on all Operating Systems and is easy to use!

Requirements

  • npm
  • administrator privileges

Installation

To install pm2, execute (sudo) npm i -g pm2 in your command line. If you are on macOS or Linux you'll need the sudo. On windows start the Command Line with administrator privileges.

Start the Speedtest Server

After PM2 was installed successfully, navigate to the NodeSpeedtest executable and start it by executing: pm2 start <fileName>. After a short time you should see something like this: pm2 console output

Your server is now running!

Nice to know:

List all running processes: pm2 list

Restart a process: pm2 restart <name / id>

Stop a process: pm2 stop <name / id>

View logs: pm2 logs <name / id>