Exercise 1: Running the Production Build Under PM2 — Possible Solution ==================================================================== BUILDING AND STARTING ------------------------------ Per this chapter, npm run build (which runs next build) produces the production bundle. With ecosystem.config.js in place, pm2 start ecosystem.config.js launches it as a managed process rather than a plain foreground terminal command. CONFIRMING IT'S RUNNING ------------------------------ pm2 status lists the process by the name given in ecosystem.config.js ("website-rebuild-with-nextjs") with a status of "online" and a real, non-zero uptime - confirming PM2 successfully started and is actively supervising it, not just that the command exited without an error. REGISTERING STARTUP ------------------------------ pm2 save persists the current process list; pm2 startup prints (and, once the suggested command is run, installs) a real system service definition that relaunches PM2's own saved process list automatically on server boot. Confirming this worked means checking that the printed startup command was actually executed - pm2 startup alone only prints instructions, it doesn't install anything by itself. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly distinguishes pm2 start (launches the process now) from pm2 save + pm2 startup (makes it survive a reboot), and confirms the running state via pm2 status's own real output rather than assuming success from the absence of an error message.