PM2 Setup
Setting up PM2 for production deployment of the HPC Dashboard
PM2 Setup
This guide will provide detailed instructions for deploying the HPC Dashboard in a production environment using PM2 process manager. Topics will include:
- Installing PM2
- Setting up automatic startup on boot
Preliminary Setup
While we complete this documentation, here's a basic PM2 configuration to get you started:
# Install PM2 globally
npm install -g pm2
# Build the Next.js application
npm run build
# Start with PM2
pm2 start npm --name "hpc-dashboard" -- start
# Save the PM2 configuration
pm2 save
# Set up automatic startup
pm2 startup
Port Change:
You can adjust the port for PM2 by changing the start command:
pm2 start npm --name "hpc-dashboard" -- start -- --port 3020
Changing Settings
Settings in .env are read when the server starts. After changing one, restart the process; you don't need to rebuild:
pm2 restart hpc-dashboard
Only NEXT_PUBLIC_BASE_PATH needs a rebuild (npm run build), because it's fixed when the app is built.