PM2 Tutorial: Keeping a Node.js App Running Reliably on One Server
PM2 is a Node.js process manager that runs an app in the background, restarts it after crashes, and keeps it alive after the user logs out. The article demonstrates this with a small order-status API for an online shop, built using only Node's built-in http module. It suggests PM2 suits a single server you control, while platforms that already manage processes make it unnecessary. The author also notes that PM2 does not survive a reboot by itself, so commands like pm2 startup and pm2 save are needed. Scaling across several machines is identified as a different problem that PM2 alone does not solve.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in