All posts

May 23, 2026

How I built a self-hosted deployment tool with Node.js and PM2

A deep dive into building a lightweight, predictable deployment pipeline using Node.js and PM2 without adding complex Kubernetes overhead.

For small teams and early-stage founders, Kubernetes is often an over-engineered distraction. Managing massive control planes, YAML specs, and cluster networking takes focus away from what actually matters: shipping product features.

When designing the deployment automation for RunStack, I wanted a solution that stays completely readable, operates directly on simple virtual machines, and recovers instantly. I built it using Node.js and PM2.

PM2 provides exceptional process lifecycle management, log streaming, and zero-downtime reloads out of the box. By wrapping PM2's programmatic API in a lightweight Node.js daemon, we can trigger Git-webhook-driven deployments, execute pre-flight checks, and stream build output in real time.

This architecture keeps the entire system transparent and debuggable. If a build fails, you read simple stdout files rather than wading through cluster event logs. It is fast, highly stable, and runs on a $5 VPS.