---
title: "Discussion on \"How To Deploy NodeJS Apps With PM2 & NGINX In Cluster Mode On Production\" | Hashnode"
description: "Discussion on \"How To Deploy NodeJS Apps With PM2 & NGINX In Cluster Mode On Production\". Process Manager is a special program designed to effectively manage server processes and take benefit of server resources."
url: "https://hashnode.com/posts/how-to-deploy-nodejs-apps-with-pm2-nginx-in-cluster-mode-on-production/5fcb13742e4db7780e482ce4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How To Deploy NodeJS Apps With PM2 & NGINX In Cluster Mode On Production](https://meswapnilwagh.com/how-to-deploy-nodejs-apps-with-pm2-nginx-in-cluster-mode-on-production?utm_source=hashnode&utm_medium=feed)

Process Manager is a special program designed to effectively manage server processes and take benefit of server resources.

May 20, 2020 · 4 min read · meswapnilwagh.com  
Updated Jul 21, 2022  
Read the article

-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#ubuntu](https://hashnode.com/tag/ubuntu)
-   [#aws](https://hashnode.com/tag/aws)
-   [#pm2](https://hashnode.com/tag/pm2)
-   [#process-manager](https://hashnode.com/tag/process-manager)

## Written by

[Swapnil Wagh](https://hashnode.com/@meswapnilwagh)

@meswapnilwagh · Dubai, United Arab Emirates

  
[View profile](https://hashnode.com/@meswapnilwagh)

Senior Full Stack Developer

I'm Swapnil Abhimanyu Wagh, a passionate and self-taught programmer with over 12+ years of experience in IT application development. I love exploring new and exciting technologies and always strive to stay at the forefront of the tech world. Throughout my career, I have worked extensively with a variety of technologies, including node.js, AWS, JavaScript, Loopback, and Angular. My goal is to leverage this knowledge to create innovative software solutions that address real-world challenges faced by organizations. When I'm not coding, you can find me indulging in my other interests. I love spending quality time with my family, watching movies and TV shows, and enjoying playful moments with my adorable daughter. Currently, I am working as a Full Stack Developer, constantly honing my skills to deliver exceptional results. My skillset includes Python, JavaScript, Angular, React, AWS, Docker, Jira, and Agile methodologies. In addition to my programming expertise, I am well-versed in working with various databases, including Postgres, MySQL, MariaDB, and DynamoDB. I'm always open to new opportunities and challenges, and I look forward to creating more amazing software solutions in the future. Let's connect and collaborate to make a positive impact with technology! 🚀 #Developer #FullStack #TechEnthusiast #Innovation

## Responses 1

Markdown supported · ⌘↵ to post

[mohammad khosravi](https://hashnode.com/@smkh)

[Feb 1, 2023](https://hashnode.com/posts/how-to-deploy-nodejs-apps-with-pm2-nginx-in-cluster-mode-on-production/5fcb13742e4db7780e482ce4/comment/63da36c0672b295ef3b4268d)

hi, thank you for this article, its very helpful. but i have a problem and i search for it but got no answer. i have a nextjs project and i deploy it with pm2 and nginx. it works properly and i set max instances for my project in cluster mode. but when i stop the first instance the website is going down and get 502 nginx error and other instances not working until i restart the other instance. why this happens? note: i use this command for start my project with pm2: pm2 start npm --name myproject -i -1 -- start

with regards
