how to deploy an APP NodeJS Through cPanel

As JavaScript became one of the most popular programming languages to build web applications, many of our customers have come to love the language.

But to build scalable browser and server applications, they often want to use Node.js. Node.js is an open-source, cross-stage JavaScript runtime environment for building up a different assortment of instruments and applications.

In spite of the fact that Node.js is not a JavaScript system, a number of its essential modules are composed in JavaScript, and engineers can compose new modules in JavaScript.

Node.js is mainly used for hosting different kinds of applications like the Ghost blogging platform etc.

This open-source cross-platform environment allows for rapid development of applications, which leads to high productivity, and therefore quicker deployment.
Hosting Marketers now provides NodeJS support within our shared hosting servers, and you can create/manage applications easily via your hosting cPanel control panel interface.

How to Install a Node.js Application Using Node.js Selector

Node.js Selector is a CloudLinux component (that we provide on all our hosting servers) that allows each user to easily create Node.js applications, choose Node.js version and other parameters for applications based on their needs.
With a friendly UI (our cpanel), it unites all of the features in one place and makes it very convenient to manage.

At the time of writing this, Node.js Selector supports Node.js versions 6.x, 8.x, 9.x, 10.x.

The Node.js Selector has many advantages over manual deployment.

It allows for several different applications to be run under the same user, accessed under the “Setup Node.js App” page in your cPanel account.

With Node.js Selector, all these handled for you.

To start, go to cPanel → Software Section → Select Node.js Version.

The Web Applications page will be displayed and you will see several columns in the list.

App URI: application URI including the domain.

App Root Directory: application root directory relative to the user’s home.
Mode: can be production or development.
Status: started/stopped — displays if an application is running or not and version of the application.
Actions: allows to start, restart, stop, edit, and remove a particular application.

How To Create A Node.js Application

Before you can configure your Node.js application, you will need to get that application to your cPanel server.

You can simply use FTP to upload the copy of your application to your server.

Or you can also use cPanel’s native Git support to clone the repository onto your server and deploy from there.

The following example below used cPanel’s native Git support to clone the application to the server and then deploy it.

Clone The Application with Git

Go to GitHub and copy the URL of the repository to clone

copy the url, in this example I will use the Ghost a publishing platform.

Now go back to cpanel and click on Git™ Version Control

Click Create

A new page comes up to install the new git, re-enter the url

the the repository Path and repository name will show automatically.

click create again. Now it is done, copy the repository path, in this case


save this path you going to need to install the node. if you finished this step of the repository then go to “Back now to the node” but if using your own private repository on GitHub then continue reading below.

Cloning To A cPanel Server From A Private Github Repo

Private repos require SSH access, open a ticket with customer support and ask them to enable shell access.
You can use cPanel’s Terminal interface (cPanel – Home – Advanced – Terminal) to access the command line from within the cPanel interface.

Generate An SSH Key
If you have not already configured one, run the following command to generate an SSH key:

ssh-keygen -t rsa -b 4096 -C “”
In this example, “username” represents the cPanel account username and “” represents the domain name.

After you run this command, the system will prompt you to enter a passphrase.

Do not enter a passphrase.

Press Enter to continue.

Verify That The Key Is Available
To confirm that the key exists and is in the correct location, run the following command:

cat ~/.ssh/
Register our SSH Key With The Private Repository Host
To register an SSH key with GitHub, perform the following steps:

Log in to your GitHub account.
Navigate to your private repository.
In the top right corner of the page, click Settings. A new page will appear.
In the left side menu, click Deploy keys. A new page will appear.
In the top right corner of the page, click Add deploy key. A new page will appear.
Enter your SSH key data:
In the Title text box, enter a display name for the key.
In the Key text box, paste the entire SSH key.
If you want to push code from your cPanel account to your GitHub account, select the “Allow write access” checkbox.

If you do not select this checkbox, you can only deploy changes from your GitHub repository to the cPanel-hosted repository.

Click Add key.
Do note that some repository hosts do not allow you to configure write access for your access keys.

For information about how to register your SSH key with another private repository host (Bitbucket, GitLab, etc), consult that host’s website or documentation.

Test Out The SSH Key
To test your SSH key, run the following command.

ssh -T
where “” represents the private repository’s host – e.g ssh -T

Clone The Repo To cPanel

To clone the repository, run the following command on the cPanel account, where “git clone$name/private-repo.git” represents the private repository’s clone URL:

git clone$name/private-repo.git
If you see “Error: The WebSocket handshake failed at …” when you access cPanel’s Terminal interface (cPanel – Home – Advanced – Terminal), recheck your connection.

If you are using VPN, disconnect and use your normal internet connection.

Once you click on “Create” this will bring you back to the repository page showing the full path of the application being deployed.

This page is important, so do save that path for later use.

Back now to the node:

cPanel → Software Section → Select Node.js Version

1- Select a Node.js version.
2- Select either “Development” or “Production” for the application mode.
3- Select the application root. The path that we save before on the Git repository.


4- Select the Application URL. This is an HTTPS link to your application.
4- Fill the form to point to the Application startup file. In this case the Ghost the file is index.js

You can also add additional Environment variables by clicking on the “Add Variable”.
5- Click Create.

cpanel nodejs deploy app

… a more detailed explanation, below:

Node.js Application Configuration
With the application files in place on the server, you are ready to configure Node.js to launch that application from the web.

From cPanel on the same account under the “Software” tab, select “Setup Node.js App”.

On this setup screen, you’ll select “Create Application” to bring up the options for choosing the Node.js version as well as whether to use a Development or Production environment.

Development generally has different application hooks in the code of the application, depending on how this environment variable is set.

As a general rule, Production is going to have more levels of caching, as well as minimal logging.

So, for a Development environment set, you can expect the inverse, with fewer levels of application caching, and more verbose logging and error message output.

A typical example would be where in production, you may only see an error page.

In development, you may see a full stack trace on an application error which allows you to figure out exactly where the error took place inside the code.

Since Node.js applications, in general, depend on several environment variables, you can add these using the “Add Variable” button near the bottom right of the page.

The Node.js production or development variable is already set separately in the top section using the “Application Mode”, so it is not necessary to set it again in the Environment variables section.

This same menu is where you can select the version of Node.js that you’d like to use as well as the application’s startup file.

This might be index.js, app.js or any number of variations; it depends on the application.

Once you’ve saved your application, you’ll need to resolve its package dependencies.

The NPM package manager does this automatically based on the package.json file packaged with the application, so all that you’ll need to do here is click on the ‘NPM Install” button.

At this point, you will require your domain to resolve to an IP address, or the installation script will have an error.

If you are using a sub-domain, make sure that this has been created and that you have added all relevant records to your DNS.

You can confirm this by simply running:

$ dig
NPM will read the contents of the package.json file and install the needed packages into a virtual environment specific to the application.

If you are familiar with the command line, you can follow the instructions at the top of the page to gain access to the “npm” and “node” commands to make additional changes manually, allowing for a great deal of customization.

Node.js Application Deployment

By this point, you’ll have your application configured and Node.js modules installed, so you’re ready to launch the application.

Our cPanel systems make this very easy.

On the same page where you configured your application, click

“Run JS Script”

This will execute the application startup file that you defined earlier during setup.

As Node.js applications have several different options, this can bring up another menu with different options to select depending on the application that you’re running.

In general, you’ll want to select the “Start” option next. Attention that it can take some time so wait awhile.

Finally, you can select the “Open” option to visit your page, and see your application!

How To Start A Node.js Application

To start a stopped application do the following:

Click Start icon in the Actions column in a stopped application row.

When the action is completed, a Start icon changes to Stop icon.

How To Stop A Node.js Application

To stop a started application do the following:

Click Stop icon in the Actions column in a started application row.

When the action is completed, a Stop icon changes to Start icon.

How To Start A Node.js Application

To restart the application do the following:

Click Restart icon in the Actions column in a started application row.

The current row will be blocked and will be unblocked when the process is completed.

How To Remove A Node.js Application

To remove the application do the following:

click the “Bin” icon in the Actions column in a particular application row.
in the confirmation, pop-up click Agree to start removing or Cancel to close the pop-up.

When the action is completed, an application will be removed from the Web Applications table and a confirmation pop-up displayed.

How To Edit Your Node.js Application

To edit application do the following:

Click Pencil icon in the Actions column in a particular application row.

An application tab will be open.

At the moment, you can:

restart application – click Restart button.

  • stop Node.js — click Stop Node.js button.
  • run JavaScript script — click Run JS Script button to run a command specified in the Scripts section of the package.json file. Specify the name of the script to run plus any parameters then click Ok.
  • remove application — click Delete button and confirm the action in a pop-up.
  • change Node.js version — choose Node.js version from a drop-down.
  • change Application mode — choose application mode from a drop-down. Available modes are Production and Development. 
    specify Application root — specify in a field a physical address to the application on a server that corresponds with its URI.
  • specify Application URL — specify in a field an HTTP/HTTPS link to the application.
  • specify Application startup file — specify as NAME.js file.
  • run npm install command — click Run npm install button to install the package(s) described in the package.json file.
  • add Environment variables — click Add Variable and specify a name and a value.

How To Debug Errors On Your Node.js Application

Directives such as PassengerFriendlyErrorPages and PassengerAppEnv are available for use from a .htaccess file.

This allows cPanel users to debug a Node.js application during development.

For example, if you add one of the following lines to the .htaccess file on the application page and there is an error, you will see the error listed:

PassengerAppEnv development

PassengerFriendlyErrorPages on

29 thoughts on “how to deploy an APP NodeJS Through cPanel”

  1. Can I just say what a comfort to find someone that actually understands what they’re talking about nodejs on cpanel. You certainly know how to bring
    an issue to light and make it important. More and more people should look at this and understand this side of your web hosting.

    I can’t believe you aren’t more popular because you surely understand nodejs on cpanel, I just started it this week and I find it very useful for my apps.

  2. Hi, just wanted to mention, I enjoyed this article.
    I was trying to add an app on the cpanel for a nodejs and your blog is very helpful

  3. I needed to send you this little note to give thanks as before on the striking knowledge you’ve shared on this site. It is quite unbelievably generous of people like you to present easily and clearly this apps as nodejs on the cpanel, it is very difficult to explain but you certainly know your subject. On your hosting how many apps can we add? Thanks.

  4. Can you give an app example please? I’m very interested in creating something with the nodejs but I’m Totally clueless.

  5. It’s awesome designed for me to have a web site with nodejs which is
    helpful in favor of my experience. thanks admin

  6. Hey there would you mind letting me know which web host you’re using?
    I’ve loaded your blog in 3 different internet browsers and I must say this blog loads a lot faster then most.
    Can you suggest a good web hosting provider at a reasonable
    price? Thanks a lot, I appreciate it!

  7. Your means of telling the whole thing in this paragraph is actually fastidious, all be
    able to easily understand it, Thanks a lot. I loved the last part about the nodejs.

  8. nodejs is the best app on the all net, I’m very impressed with your clear blog, but nodejs is very resource based on the servers, is this not slow down your customers sites?

  9. Hey just wanted to give you a quick heads up.
    The words in your article seem to be very good info on nodejs, what about python hosting? do you have it on the cpanel?
    The style and design look great though! Hope you get the issue solved soon. Many thanks

  10. I just couldn’t leave your website prior to suggesting that I extremely loved the usual information an individual provide in your guests?

    Is going to be again incessantly to investigate cross-check new posts and please give me some info on python hosting, I’m interested in cpanel apps for python.

  11. what is the use of nodejs? I prefer the PHP language, this new modes they come and go. PHP will stay….

  12. Hi there to all, it’s actually a nice for me to visit this web page, it consists of useful Information although could you please explain what do you do with a nodejs app?

  13. Good day! Do you know if they make any plugins to safeguard against of nodejs apps?

    I’m kinda paranoid about losing everything I’ve worked hard
    on. Any tips?

  14. I think nodejs on cpanel is the greatest invention of the 21st century… I’m joking, but that you offering is very good, now we need python and rtmp servers.

  15. Genuinely when someone doesn’t be aware of after that it’s up to other developers to know and understand
    that they will help, so here it takes place.

  16. This is a topic that’s close to my heart… I’m fascinated with nodeJS.
    Take care! Exactly where are your contact details though? I think I will add this post to my social media.

  17. Heya just wanted to give you a quick heads up and let you know a
    few of the pictures aren’t loading correctly.
    I’m not sure why but I think its a linking issue. I’ve tried it in two different browsers and both show the same results.

  18. Hi there every one, here every one is sharing these familiarity, so it’s exciting to read this website, and I
    used to pay a quick visit this webpage once a while.

  19. It’s fantastic that you are getting thoughts from this article as well as from our discussion made here. I’m very interested in nodejs. you give us lots of information.

  20. Howdy! This article could not be written any better!
    Looking through this post reminds me of my previous roommate!
    He continually kept talking about this. I will send this
    article to him. Pretty sure he will have a very good read.
    I appreciate you for sharing! Woah! I’m really loving the nodejs information of this website.
    It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between superb usability and appearance.
    I must say that you’ve done a awesome job with this.

    Additionally, the blog loads extremely quick for me on Firefox.

    Exceptional Blog! I just couldn’t depart your website
    before suggesting that I actually enjoyed the usual info an individual supply for your
    visitors? Is going to be back incessantly to check out new posts

  21. Fabulous, what a web site it is! This blog provides helpful facts to us, do you have some info on rtmp servers?

  22. I do not even know how I ended up here, but I thought this post was good.
    I don’t know who you are but definitely you’re
    going to a famous blogger if you are not already 😉 I appreciate your post on the nodejs.

  23. Great Blog I wish I had one like this on my site. If you are ever in Frisco,
    Texas and need some IT Support in nodejs please give us a call

  24. Hi! Thіs is my 1st comment heгe so I just wanted to give a
    quick shout out and say I genuinely enjoy reading through your posts.
    Can you suggest any other blogs/websites/forums that go oѵer the same subjects about nodejs? they should make ab ebook about it.

    Appreciate it!

  25. can you explain how to run an app on cpanel with nodejs? I’m not yet doing it properly,sorry.

  26. We all know God exists. Why? Because without Him, we couldn’t prove anything at all. Do we live our lives as if we cannot know anything? No. So why is God necessary? In order to know anything for certain, you would have to know everything, or have revelation from somebody who does. Who is capable of knowing everything? No,except the nodejs which is so important So to know anything, you would have to be God, or hosting marketers…

Leave a Reply

Your email address will not be published. Required fields are marked *