CloudPanel makes management of web applications easier - follow these steps to set up a Node.js application using CloudPanel on your Hostinger VPS:
Step 1 – Preparations
While some basic knowledge of Node.js and server management is recommended, the basic requirements are:
A Hostinger VPS with CloudPanel installed. If you don't have one yet, you can check the available options here: CloudPanel VPS hosting.
A domain name pointed to the IP address of your VPS (recommended for production environments).
Step 2 – Access CloudPanel
Open a web browser and navigate to your CloudPanel installation by entering your VPS IP followed by the CloudPanel port:
https://your-vps-ip:8443
Replace your-vps-ip with the IP address of your VPS.
Enter the login credentials provided during the CloudPanel setup:
Step 3 – Create a Node.js Application
Create a new application – Navigate to the Sites section in CloudPanel and click on Add Site. Select Node.js from the application type options:
Configure the application settings
Domain name – Enter the domain name for your application.
Node.js version – Select the Node.js version your application will be running on.
App port – Select the port for your application.
Deploy your application
After configuring the application settings, deploy your application by uploading your Node.js application files through the file manager or by using Git.
Step 4 – Start Your Node.js Application
Log in via SSH with the site user:
ssh user@your-vps-ip
Replace your-vps-ip with the IP address of your VPS.
Next, go to the root directory of your application:
cd htdocs/domain.tld/
Replace domain.tld with your domian name.
Once there, install the latest pm2 via npm:
npm install pm2@latest -g
And start your application by executing:
pm2 start server.js
That's all, now your Node.js application is started within CloudPanel on your Hostinger VPS.
Additional Resources