Running PM2 on Digital Ocean App Platform

I’m trying to run PM2 for my Node application that is hosted on the Digital Ocean App Platform. I have no issues running my app with node index.js but when I try to run pm2 start index.js I end up with a failed deployment. I haven’t seen anywhere saying otherwise, but is it possible to use PM2 on the App Platform?

Error message: Component Issues app_name failed to deploy

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Moises Eskinazi
DigitalOcean Employee
DigitalOcean Employee badge
March 1, 2023

Hi idriskhenchil,

To run pm2 on App Platform you must tell it to run in the foreground, that way the health check knows your app is running and the deployment was successful. To run pm2 in the foreground use the command:

pm2 start index.js --no-daemon

Best, Moises

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up