What health checks should I do after deployment?
Check pm2 status (app is online), pm2 logs --lines 20 (no errors), curl http://localhost:3000/api/health (app responds), curl https://yourdomain.com/api/health (Nginx proxies correctly), and sudo systemctl status nginx (Nginx is running).
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Nginx and PM2 Deployment Workflow Complete Guide to Node.js Production Setup
Initial setup: install Node.js, PM2, Nginx, clone project, configure .env, start with PM2, configure Nginx as reverse proxy, add SSL with Let's Encrypt. Regular deployments: git pull, npm install, pm2 reload (zero downtime). Use automated scripts and ecosystem.config.js for complex setups.
Use pm2 reload devtinder-api instead of pm2 restart. In cluster mode, PM2 reloads workers one at a time, keeping the app available throughout. No requests are dropped during the reload.
Option 1: git revert HEAD or git reset --hard <commit-hash>, then npm install and pm2 reload. Option 2: Keep a previous directory (devtinder-backend-prev) and switch PM2 to it: pm2 stop, pm2 delete, cd to prev directory, pm2 start.
Still have questions?
Browse all our FAQs or reach out to our support team
