Posts

🚀 Deploy Node.js API with PM2 on Windows (Offline + Auto-Restart on Boot)

 When deploying a Node.js API on a Windows server without internet access , traditional online installation steps won’t work. This guide walks you through offline deployment with PM2 and configuring it to auto-start on reboot using pm2-windows-startup . ✅ Prerequisites A development machine with Node.js and internet access. The target Windows server has: Node.js installed No internet access Your Node.js API project copied 📦 Step 1: Prepare Offline PM2 Package On a machine with internet: bash mkdir pm2-offline && cd pm2-offline npm install pm2 Then zip the folder: bash cd .. zip -r pm2-offline.zip pm2-offline 📁 Step 2: Transfer to Target Server Copy these to the Windows server: pm2-offline.zip Your Node.js API project Unzip both: bash unzip pm2-offline.zip 🔹 3. Use PM2 Locally or Link Globally To use PM2 in that folder: bash ./node_modules/.bin/pm2 --version ./node_modules/.bin/pm2 start app.js Or install it globally (optional): bash npm ins...