Server Commands Reference

Restart a Web Server

net stop cloudflared
net start cloudflared

net stop cloudflared && net start cloudflared
            

Open MySQL Workbench and Connect to Any One Database

(Then launch MySQL Workbench manually and connect to your database.)

open in File Manager

Open terminal and navigate to:
F:\4Born-Server-setup
                        

PM2 Process Manager Commands

🚀 Most Important & Frequently Used Commands

pm2 list Check all running processes - your go-to command to see what's running
pm2 save Save current configuration - CRITICAL to persist your processes after changes
pm2 restart [id/name] Restart a process - most common command for applying changes
pm2 start app.js --name "App Name" Create and start a new PM2 instance with custom name
pm2 resurrect Recover all saved processes after system restart or PM2 restart
pm2 monit Open monitoring dashboard - essential for debugging and performance monitoring
pm2 logs [id/name] View real-time logs - crucial for debugging application issues
pm2 stop [id/name] Stop a process gracefully - use when you need to pause an application

📋 Process Listing & Information

pm2 ls Quick list of all running processes (shorthand)
pm2 list Detailed list showing process status, memory usage, and uptime
pm2 info [id/name] Show detailed information about a specific process including environment variables and restart count
pm2 -v Display PM2 version information

🔄 Process Control

pm2 start [id/name] Start a specific process or all processes with 'all'
pm2 stop [id/name] Stop a specific process gracefully or all processes
pm2 restart [id/name] Restart a process (stops and starts) - useful for applying changes
pm2 reload [id/name] Zero-downtime reload - starts new instance before stopping old one
pm2 delete [id/name] Remove a process from PM2 management completely

📊 Monitoring & Logs

pm2 monit Open real-time monitoring dashboard showing CPU, memory, and logs
pm2 logs Display logs from all processes in real-time
pm2 logs [id/name] Show logs for a specific process only
pm2 flush Clear all log files - useful for freeing up disk space

💾 Configuration & Persistence

pm2 save Save current process list to disk - essential for persistence across reboots
pm2 resurrect Restore previously saved processes after PM2 restart or system reboot
pm2 startup Configure PM2 to start automatically when system boots up
pm2 startup systemd Generate systemd service file for automatic startup on Linux systems
pm2 unstartup Remove PM2 from system startup - disable auto-start

⚡ System Management

pm2 kill Kill PM2 daemon and all managed processes - use with caution
pm2 --help Show comprehensive help with all available commands and options

💡 Pro Tips

  • Process ID vs Name: You can use either process ID (number) or app name to target specific processes
  • Zero-downtime: Use pm2 reload instead of pm2 restart for production deployments
  • Always save: Run pm2 save after making changes to persist them
  • Monitor first: Use pm2 monit to understand your application's resource usage