JK Docs
Tools# pm2# nextjs# nodejs# deployment

Keep Next.js Running in Background with PM2

Last updated: 4/20/2026

Background Execution

To ensure your site stays up after closing the terminal:

  1. Install PM2: npm install -g pm2
  2. Start app: pm2 start npm --name "my-app" -- run start
  3. Save list: pm2 save
  4. Startup script: pm2 startup

PM2 will automatically restart your app if it crashes or the server reboots.

JK Docs
New Guide

Categories

DevOpsBackendFrontendDatabaseToolsSecurityDesignSystem Admin
Admin Panel