Operations for Node.jss
Operations is the work of running a Node.js service in production. It includes packaging with Docker, process management with PM2 or a container orchestrator, reverse proxying through Nginx, and scaling by running several processes with the cluster module or multiple instances behind a load balancer.
Stage: Delivery · Part of the Node.js roadmap · Last reviewed 19 November 2026
What to learn in Operations
- Write a Dockerfile for a Node.js service using a slim base image
- Run the app under PM2 with automatic restarts
- Place Nginx in front as a reverse proxy with TLS
- Scale across CPU cores using the cluster module or multiple instances
- Shut down gracefully on SIGTERM by finishing open requests
Operations interview questions
Why does a Node.js app need clustering to use all CPU cores?
A single Node.js process runs JavaScript on one thread, so it uses one core. The cluster module, PM2 cluster mode or several container replicas start multiple processes that share a port, letting the machine serve more concurrent requests.
What is graceful shutdown in Node.js?
On SIGTERM the server stops accepting new connections, lets in-flight requests finish, closes database connections, and then exits. This avoids dropped requests during deployments and restarts, and orchestrators like Kubernetes expect this behaviour.
Where Operations fits in the Node.js roadmap
Operations belongs to the Delivery stage (advanced level), which takes about 22 hours. Test and run.
Other units in this stage
Back to the full Node.js roadmap