Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sandervanhooft's avatar

After server reboot restart pm2

Hi,

I'm using Laravel Forge with DigitalOcean Ubuntu. I'm able to run my node.js server with pm2.

However, I would like pm2 to start after a server reboot.

I have tried and tested the following methods without success:

  • use '''pm2 startup ubuntu''' and follow instructions. No warnings or error messages. (Including '''pm2 start app..js''' afterwards)
  • use '''pm2 startup systemd''' and follow instructions. No warnings or error messages.
  • setup '''@reboot''' cron via the Forge panel using a custom cron, but the form input validation does not allow this.
  • The deamon functionality of the Forge panel seems not applicable to me here, as pm2 is a deamon manager itself.

I understand that I could use node <app.js>, but this does not give me the option to hot reload the server after a new code deploy.

If someone could suggest a solution, I'lldocument all steps involved with getting a node.js server up and running on node (documentation on this is lacking currently).

Kind regards,

Sander

0 likes
2 replies
Blueblau's avatar

Did you by any chance resolve this issue?

Please or to participate in this conversation.