PM2 online but I can't the site in browser

I am having an issue running my application with PM2.

Basically, my web app works when I run "npm start server.js" (server.js being where my express app starts)

But when I try "pm2 start server.js" it shows it had started and is online but I can't reach it from my browser.

Your assistance will be highly appreciated.

1 Reply

Hey @karekezi90! I'm personally not too familiar with PM2, but given the situation, a great first troubleshooting step is to check PM2 logs. According to the PM2 documentation, log files are located in the folder $HOME/.pm2/logs. You can view the logs by running pm2 logs. Look for any error messages that might help explain why the app is not working.

I would also check that the port that your application is listening on is not being blocked by the server's firewall. You can do this by temporarily disabling the firewall and trying to access the application again using the correct port number.

Also, you might want to add a few tags to this post. Tags like "pm2" and "nodejs" may facilitate the right person seeing this a bit sooner.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct