NodeJS Deployment Using PM2 on Zhap Cloud
A walkthrough detailing deploying a NodeJS application on Zhap Cloud using PM2

I seek out simple and scalable solutions to various challenges with tech
Search for a command to run...
A walkthrough detailing deploying a NodeJS application on Zhap Cloud using PM2

I seek out simple and scalable solutions to various challenges with tech
No comments yet. Be the first to comment.
Program to interfaces, not implementations.

ChatGPT is great for brainstorming, but professionals need structured drafts, consistent tone, and version history. Learn when to use ChatGPT vs a document-first AI writing assistant like WriterOS
Today I’m launching ProMind Writer, a focused product built around one simple reality: a huge number of professionals do not “write occasionally.” They write constantly. Proposals, SOPs, policies, PRD

How Every Layer You Add Changes Everything

Many SaaS companies face a common challenge: despite feature-rich products and aggressive marketing, they struggle with high churn rates. The root cause? A classic case of "feedback blindness" – building in isolation without truly understanding user ...

This walkthrough assumes you have the following:
Zhap Cloud App service comes preinstalled with git.
Head on to https://zhap.cloud/app/machine and launch the app terminal

In the /usr/src/app directory run a git clone _REPOURL. Ensure all files and operations are done in the /usr/src/app directory and its children.
root@a15f257eec:/usr/src/app$ git clone https://github.com/chinaza/dummy-app
With your project cloned, cd into the project directory and install npm dependencies/ packages and run any build steps if exists.
As an example:
root@a15f257eec:/usr/src/app$ cd dummy-app
root@a15f257eec:/usr/src/app$ npm install
Once the dependencies are installed, you can proceed to the next step.
To enable your app being accessible ensure it runs dynamically on the PORT environment variable. To manually get the assigned port for your app service environment, run this command on your terminal:
root@a15f257eec:/usr/src/app$ echo $PORT
Now all is set! Let's start our application using PM2.
root@a15f257eec:/usr/src/app$ pm2 start --name="DUMMY-APP" npm -- start
For a better understanding on PM2 and its commands, visit https://pm2.keymetrics.io/docs/usage/quick-start/
root@a15f257eec:/usr/src/app$ pm2 list
Get a list of currently running applications.
root@a15f257eec:/usr/src/app$ pm2 stop APP_NAME_OR_ID
Use this command to stop your application. You must specify the app name or id gotten from pm2 list above.
root@a15f257eec:/usr/src/app$ pm2 restart APP_NAME_OR_ID
Use this command to restart your application. You must specify the app name or id gotten from pm2 list above.
root@a15f257eec:/usr/src/app$ pm2 logs
Get logs for your application with the logs command.
root@a15f257eec:/usr/src/app$ pm2 flush
With flush, you can clear the logs collected from your application.
Congratulations! Your app is now fully setup and deployed on Zhap Cloud!
Get managed hosting and database for your NodeJS, Python, Go applications and more. SQL and NoSQL databases all included under one plan. Start for free today! https://zhap.cloud