What You'll Need
n8n Cloud or self-hosted n8n (for orchestrating automated workflows)
Hetzner VPS or Contabo VPS for hosting your Node.js processes
DigitalOcean as an alternative hosting provider
Node.js 18+ installed locally and on your server
SSH access to your VPS
PM2 (we'll install this together)
A text editor (VS Code recommended)
Table of Contents
Why PM2 Matters for Bot Automation
Installation & Initial Setup
Running Your First Process
Clustering & Load Balancing
Monitoring & Logs in Real-Time
Auto-Restart on Server Reboot
Integration with n8n Webhooks
Getting Started
Why PM2 Matters for Bot Automation
I learned this the hard way. Three years ago, I deployed a Node.js bot to a VPSβno process manager. It crashed at 2 AM on a Sunday, sat dead for six hours, and tanked the entire automation pipeline.β¦