{"id":801,"date":"2019-07-05T22:02:50","date_gmt":"2019-07-05T22:02:50","guid":{"rendered":"https:\/\/hosting-marketers.com\/news\/?p=801"},"modified":"2019-07-06T03:15:02","modified_gmt":"2019-07-06T03:15:02","slug":"how-to-deploy-an-app-nodejs-through-cpanel","status":"publish","type":"post","link":"https:\/\/hosting-marketers.com\/news\/2019\/07\/05\/how-to-deploy-an-app-nodejs-through-cpanel\/","title":{"rendered":"how to deploy an APP NodeJS Through cPanel"},"content":{"rendered":"\n<p>As JavaScript became one of the most popular programming languages to build web applications, many of our customers have come to love the language.<\/p>\n\n\n\n<p> 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. <\/p>\n\n\n\n<p>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. <\/p>\n\n\n\n<p>Node.js is mainly used for hosting different kinds of applications like the Ghost blogging platform etc. <\/p>\n\n\n\n<p>This open-source cross-platform environment allows for rapid development of applications, which leads to high productivity, and therefore quicker deployment.<br \/> 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.<\/p>\n\n\n\n<p><br \/><strong> How to Install a Node.js Application Using Node.js Selector<\/strong><\/p>\n\n\n\n<p><br \/> 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.<br \/> With a friendly UI (our cpanel), it unites all of the features in one place and makes it very convenient to manage.<\/p>\n\n\n\n<p>At the time of writing this, Node.js Selector supports Node.js versions 6.x, 8.x, 9.x, 10.x.<\/p>\n\n\n\n<p>The Node.js Selector has many advantages over manual deployment.<\/p>\n\n\n\n<p>It allows for several different applications to be run under the same user, accessed under the \u00e2\u20ac\u0153Setup Node.js App\u00e2\u20ac\u009d page in your cPanel account.<\/p>\n\n\n\n<p>With Node.js Selector, all these handled for you.<\/p>\n\n\n\n<p>To start, go to cPanel \u00e2\u2020\u2019 Software Section \u00e2\u2020\u2019 Select Node.js Version.<\/p>\n\n\n\n<p>The Web Applications page will be displayed and you will see several columns in the list.<\/p>\n\n\n\n<p>App URI: application URI including the domain.<\/p>\n\n\n\n<p>App Root Directory: application root directory relative to the user\u00e2\u20ac\u2122s home.<br \/>\nMode: can be production or development.<br \/>\nStatus: started\/stopped \u00e2\u20ac\u201d displays if an application is running or not and version of the application.<br \/>\nActions: allows to start, restart, stop, edit, and remove a particular application.<\/p>\n\n\n\n<p><strong>How To Create A Node.js Application<\/strong><\/p>\n\n\n\n<p><br \/> Before you can configure your Node.js application, you will need to get that application to your cPanel server.<\/p>\n\n\n\n<p>You can simply use FTP to upload the copy of your application to your server.<\/p>\n\n\n\n<p>Or you can also use cPanel\u00e2\u20ac\u2122s native Git support to clone the repository onto your server and deploy from there.<\/p>\n\n\n\n<p>The following example below used cPanel\u00e2\u20ac\u2122s native Git support to clone the application to the server and then deploy it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Clone The Application with Git<\/strong><\/h2>\n\n\n\n<p>Go to GitHub and copy the URL of the repository to clone <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1279\" height=\"416\" data-attachment-id=\"805\" data-permalink=\"https:\/\/hosting-marketers.com\/news\/2019\/07\/05\/how-to-deploy-an-app-nodejs-through-cpanel\/github\/\" data-orig-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/github.jpg?fit=1279%2C416&amp;ssl=1\" data-orig-size=\"1279,416\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"github\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/github.jpg?fit=300%2C98&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/github.jpg?fit=640%2C208&amp;ssl=1\" src=\"https:\/\/i2.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/github.jpg?fit=474%2C154&amp;ssl=1\" alt=\"\" class=\"wp-image-805\" srcset=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/github.jpg?w=1279&amp;ssl=1 1279w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/github.jpg?resize=300%2C98&amp;ssl=1 300w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/github.jpg?resize=768%2C250&amp;ssl=1 768w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/github.jpg?resize=1024%2C333&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>copy the url, in this example I will use the Ghost a publishing platform. <\/p>\n\n\n\n<p>https:\/\/github.com\/TryGhost\/Ghost.git<\/p>\n\n\n\n<p>Now go back to cpanel and click on Git\u00e2\u201e\u00a2 Version Control<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"226\" data-attachment-id=\"806\" data-permalink=\"https:\/\/hosting-marketers.com\/news\/2019\/07\/05\/how-to-deploy-an-app-nodejs-through-cpanel\/git\/\" data-orig-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/git.jpg?fit=1520%2C537&amp;ssl=1\" data-orig-size=\"1520,537\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"git\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/git.jpg?fit=300%2C106&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/git.jpg?fit=640%2C226&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/git.jpg?resize=640%2C226&#038;ssl=1\" alt=\"\" class=\"wp-image-806\" srcset=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/git.jpg?resize=1024%2C362&amp;ssl=1 1024w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/git.jpg?resize=300%2C106&amp;ssl=1 300w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/git.jpg?resize=768%2C271&amp;ssl=1 768w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/git.jpg?w=1520&amp;ssl=1 1520w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/git.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>Click Create<\/p>\n\n\n\n<p>A new page comes up to install the new git, re-enter the url<\/p>\n\n\n\n<p>https:\/\/github.com\/TryGhost\/Ghost.git<\/p>\n\n\n\n<p>the the repository Path and repository name will show automatically.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1522\" height=\"755\" data-attachment-id=\"807\" data-permalink=\"https:\/\/hosting-marketers.com\/news\/2019\/07\/05\/how-to-deploy-an-app-nodejs-through-cpanel\/ghost\/\" data-orig-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/ghost.jpg?fit=1522%2C755&amp;ssl=1\" data-orig-size=\"1522,755\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ghost\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/ghost.jpg?fit=300%2C149&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/ghost.jpg?fit=640%2C318&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/ghost.jpg?fit=474%2C235&amp;ssl=1\" alt=\"\" class=\"wp-image-807\" srcset=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/ghost.jpg?w=1522&amp;ssl=1 1522w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/ghost.jpg?resize=300%2C149&amp;ssl=1 300w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/ghost.jpg?resize=768%2C381&amp;ssl=1 768w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/ghost.jpg?resize=1024%2C508&amp;ssl=1 1024w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/ghost.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>click create again. Now it is done, copy the repository path, in this case <\/p>\n\n\n\n<p> \/home\/cpaneluser\/repositories\/Ghost<\/p>\n\n\n\n<p>save this path you going to need to install the node.  if you finished this step of the repository then go to &#8220;<a href=\"#back\">Back now to the node<\/a>&#8221; but if using your own private repository on GitHub then continue reading below.<\/p>\n\n\n\n<p><strong>Cloning To A cPanel Server From A Private Github Repo<\/strong><br \/> <\/p>\n\n\n\n<p>Private repos require SSH access, open a ticket with <a href=\"https:\/\/hosting-marketers.com\/customers\/submitticket.php?step=2&amp;deptid=1\">customer support<\/a> and ask them to enable shell access.<br \/> You can use cPanel\u00e2\u20ac\u2122s Terminal interface (cPanel \u00e2\u20ac\u201c Home \u00e2\u20ac\u201c Advanced \u00e2\u20ac\u201c Terminal) to access the command line from within the cPanel interface.<\/p>\n\n\n\n<p>Generate An SSH Key<br \/>\nIf you have not already configured one, run the following command to generate an SSH key:<\/p>\n\n\n\n<p>ssh-keygen -t rsa -b 4096 -C &#8220;username@example.com&#8221;<br \/>\nIn this example, \u00e2\u20ac\u0153username\u00e2\u20ac\u009d represents the cPanel account username and \u00e2\u20ac\u0153example.com\u00e2\u20ac\u009d represents the domain name.<\/p>\n\n\n\n<p>After you run this command, the system will prompt you to enter a passphrase.<\/p>\n\n\n\n<p>Do not enter a passphrase.<\/p>\n\n\n\n<p>Press Enter to continue.<\/p>\n\n\n\n<p>Verify That The Key Is Available<br \/>\nTo confirm that the key exists and is in the correct location, run the following command:<\/p>\n\n\n\n<p>cat ~\/.ssh\/id_rsa.pub<br \/>\nRegister our SSH Key With The Private Repository Host<br \/>\nTo register an SSH key with GitHub, perform the following steps:<\/p>\n\n\n\n<p><strong>Log in to your GitHub account.<\/strong><br \/> Navigate to your private repository.<br \/> In the top right corner of the page, click Settings. A new page will appear.<br \/> In the left side menu, click Deploy keys. A new page will appear.<br \/> In the top right corner of the page, click Add deploy key. A new page will appear.<br \/> Enter your SSH key data:<br \/> In the Title text box, enter a display name for the key.<br \/> In the Key text box, paste the entire SSH key.<br \/> If you want to push code from your cPanel account to your GitHub account, select the \u00e2\u20ac\u0153Allow write access\u00e2\u20ac\u009d checkbox.<\/p>\n\n\n\n<p>If you do not select this checkbox, you can only deploy changes from your GitHub repository to the cPanel-hosted repository.<\/p>\n\n\n\n<p>Click Add key.<br \/>\nDo note that some repository hosts do not allow you to configure write access for your access keys.<\/p>\n\n\n\n<p>For information about how to register your SSH key with another private repository host (Bitbucket, GitLab, etc), consult that host\u00e2\u20ac\u2122s website or documentation.<\/p>\n\n\n\n<p>Test Out The SSH Key<br \/>\nTo test your SSH key, run the following command.<\/p>\n\n\n\n<p>ssh -T git@example.com<br \/>\nwhere \u00e2\u20ac\u0153example.com\u00e2\u20ac\u009d represents the private repository\u00e2\u20ac\u2122s host \u00e2\u20ac\u201c e.g ssh -T git@github.com.<\/p>\n\n\n\n<p><strong>Clone The Repo To cPanel<\/strong><\/p>\n\n\n\n<p><br \/> To clone the repository, run the following command on the cPanel account, where \u00e2\u20ac\u0153git clone git@example.com:$name\/private-repo.git\u00e2\u20ac\u009d represents the private repository\u00e2\u20ac\u2122s clone URL:<\/p>\n\n\n\n<p>git clone git@example.com:$name\/private-repo.git<br \/>\nIf you see \u00e2\u20ac\u0153Error: The WebSocket handshake failed at \u00e2\u20ac\u00a6\u00e2\u20ac\u009d when you access cPanel\u00e2\u20ac\u2122s Terminal interface (cPanel \u00e2\u20ac\u201c Home \u00e2\u20ac\u201c Advanced \u00e2\u20ac\u201c Terminal), recheck your connection.<\/p>\n\n\n\n<p>If you are using VPN, disconnect and use your normal internet connection.<\/p>\n\n\n\n<p>Once you click on \u00e2\u20ac\u0153Create\u00e2\u20ac\u009d this will bring you back to the repository page showing the full path of the application being deployed.<\/p>\n\n\n\n<p>This page is important, so do save that path for later use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"back\"><strong>Back now to the node:<\/strong><\/h2>\n\n\n\n<p> <\/p>\n\n\n\n<p>cPanel \u00e2\u2020\u2019 Software Section \u00e2\u2020\u2019 Select Node.js Version <\/p>\n\n\n\n<p>1- Select a Node.js version. <br \/>2-  Select either \u00e2\u20ac\u0153Development\u00e2\u20ac\u009d or \u00e2\u20ac\u0153Production\u00e2\u20ac\u009d for the application mode.<br \/>3-  Select the application root. The path that we save before on the Git repository.<\/p>\n\n\n\n<p>\n\n\/home\/cpaneluser\/repositories\/Ghost\n\n<\/p>\n\n\n\n<p><br \/>4-  Select the Application URL. This is an HTTPS link to your application. <br \/> 4- Fill the form to point to the Application startup file. In this case the Ghost the file is  index.js<\/p>\n\n\n\n<p>You can also add additional Environment variables by clicking on the \u00e2\u20ac\u0153Add Variable\u00e2\u20ac\u009d.<br \/> 5- <strong>Click Create<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"311\" data-attachment-id=\"802\" data-permalink=\"https:\/\/hosting-marketers.com\/news\/2019\/07\/05\/how-to-deploy-an-app-nodejs-through-cpanel\/nodejs\/\" data-orig-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/nodejs.jpg?fit=1506%2C733&amp;ssl=1\" data-orig-size=\"1506,733\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"nodejs\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/nodejs.jpg?fit=300%2C146&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/nodejs.jpg?fit=640%2C311&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/nodejs.jpg?resize=640%2C311&#038;ssl=1\" alt=\"cpanel nodejs deploy app\" class=\"wp-image-802\" srcset=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/nodejs.jpg?resize=1024%2C498&amp;ssl=1 1024w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/nodejs.jpg?resize=300%2C146&amp;ssl=1 300w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/nodejs.jpg?resize=768%2C374&amp;ssl=1 768w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/nodejs.jpg?w=1506&amp;ssl=1 1506w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/nodejs.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p><br \/> \u00e2\u20ac\u00a6 a more detailed explanation, below:<\/p>\n\n\n\n<p><strong>Node.js Application Configuration<\/strong><br \/> With the application files in place on the server, you are ready to configure Node.js to launch that application from the web.<\/p>\n\n\n\n<p>From cPanel on the same account under the \u00e2\u20ac\u0153Software\u00e2\u20ac\u009d tab, select \u00e2\u20ac\u0153Setup Node.js App\u00e2\u20ac\u009d.<\/p>\n\n\n\n<p>On this setup screen, you\u00e2\u20ac\u2122ll select \u00e2\u20ac\u0153Create Application\u00e2\u20ac\u009d to bring up the options for choosing the Node.js version as well as whether to use a Development or Production environment.<\/p>\n\n\n\n<p>Development generally has different application hooks in the code of the application, depending on how this environment variable is set.<\/p>\n\n\n\n<p>As a general rule, Production is going to have more levels of caching, as well as minimal logging.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>A typical example would be where in production, you may only see an error page.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>Since Node.js applications, in general, depend on several environment variables, you can add these using the \u00e2\u20ac\u0153Add Variable\u00e2\u20ac\u009d button near the bottom right of the page.<\/p>\n\n\n\n<p>The Node.js production or development variable is already set separately in the top section using the \u00e2\u20ac\u0153Application Mode\u00e2\u20ac\u009d, so it is not necessary to set it again in the Environment variables section.<\/p>\n\n\n\n<p>This same menu is where you can select the version of Node.js that you\u00e2\u20ac\u2122d like to use as well as the application\u00e2\u20ac\u2122s startup file.<\/p>\n\n\n\n<p>This might be index.js, app.js or any number of variations; it depends on the application.<\/p>\n\n\n\n<p>Once you\u00e2\u20ac\u2122ve saved your application, you\u00e2\u20ac\u2122ll need to resolve its package dependencies.<\/p>\n\n\n\n<p>The NPM package manager does this automatically based on the package.json file packaged with the application, so all that you\u00e2\u20ac\u2122ll need to do here is click on the \u00e2\u20ac\u02dcNPM Install\u00e2\u20ac\u009d button.<\/p>\n\n\n\n<p>At this point, you will require your domain to resolve to an IP address, or the installation script will have an error.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>You can confirm this by simply running:<\/p>\n\n\n\n<p>$ dig sub-domain.com<br \/>\nNPM will read the contents of the package.json file and install the needed packages into a virtual environment specific to the application.<\/p>\n\n\n\n<p>If you are familiar with the command line, you can follow the instructions at the top of the page to gain access to the \u00e2\u20ac\u0153npm\u00e2\u20ac\u009d and \u00e2\u20ac\u0153node\u00e2\u20ac\u009d commands to make additional changes manually, allowing for a great deal of customization.<\/p>\n\n\n\n<p><strong>Node.js Application Deployment<\/strong><\/p>\n\n\n\n<p><br \/> By this point, you\u00e2\u20ac\u2122ll have your application configured and Node.js modules installed, so you\u00e2\u20ac\u2122re ready to launch the application.<\/p>\n\n\n\n<p>Our cPanel systems make this very easy.<\/p>\n\n\n\n<p>On the same page where you configured your application, click <\/p>\n\n\n\n<p>\u00e2\u20ac\u0153Run JS Script\u00e2\u20ac\u009d<\/p>\n\n\n\n<p>This will execute the application startup file that you defined earlier during setup.<\/p>\n\n\n\n<p>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\u00e2\u20ac\u2122re running.<\/p>\n\n\n\n<p>In general, you\u00e2\u20ac\u2122ll want to select the \u00e2\u20ac\u0153Start\u00e2\u20ac\u009d option next. Attention that it can take some time so wait awhile.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"655\" data-attachment-id=\"819\" data-permalink=\"https:\/\/hosting-marketers.com\/news\/2019\/07\/05\/how-to-deploy-an-app-nodejs-through-cpanel\/node2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/node2.jpg?fit=600%2C655&amp;ssl=1\" data-orig-size=\"600,655\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"node2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/node2.jpg?fit=275%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/node2.jpg?fit=600%2C655&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/node2.jpg?resize=600%2C655&#038;ssl=1\" alt=\"\" class=\"wp-image-819\" srcset=\"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/node2.jpg?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/node2.jpg?resize=275%2C300&amp;ssl=1 275w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p>Finally, you can select the \u00e2\u20ac\u0153Open\u00e2\u20ac\u009d option to visit your page, and see your application!<\/p>\n\n\n\n<p><strong>How To Start A Node.js Application<\/strong><\/p>\n\n\n\n<p><br \/> To start a stopped application do the following:<\/p>\n\n\n\n<p>Click Start icon in the Actions column in a stopped application row.<\/p>\n\n\n\n<p>When the action is completed, a Start icon changes to Stop icon.<\/p>\n\n\n\n<p><strong>How To Stop A Node.js Application<\/strong><\/p>\n\n\n\n<p><br \/> To stop a started application do the following:<\/p>\n\n\n\n<p>Click Stop icon in the Actions column in a started application row.<\/p>\n\n\n\n<p>When the action is completed, a Stop icon changes to Start icon.<\/p>\n\n\n\n<p><strong>How To Start A Node.js Application<\/strong><\/p>\n\n\n\n<p><br \/> To restart the application do the following:<\/p>\n\n\n\n<p>Click Restart icon in the Actions column in a started application row.<\/p>\n\n\n\n<p>The current row will be blocked and will be unblocked when the process is completed.<\/p>\n\n\n\n<p><strong>How To Remove A Node.js Application<\/strong><\/p>\n\n\n\n<p><br \/> To remove the application do the following:<\/p>\n\n\n\n<p>click the \u00e2\u20ac\u0153Bin\u00e2\u20ac\u009d icon in the Actions column in a particular application row.<br \/>\nin the confirmation, pop-up click Agree to start removing or Cancel to close the pop-up.<\/p>\n\n\n\n<p>When the action is completed, an application will be removed from the Web Applications table and a confirmation pop-up displayed.<\/p>\n\n\n\n<p><strong>How To Edit Your Node.js Application<\/strong><\/p>\n\n\n\n<p><br \/> To edit application do the following:<\/p>\n\n\n\n<p>Click Pencil icon in the Actions column in a particular application row.<\/p>\n\n\n\n<p>An application tab will be open.<\/p>\n\n\n\n<p>At the moment, you can:<\/p>\n\n\n\n<p>restart application \u00e2\u20ac\u201c click Restart button.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>stop Node.js \u00e2\u20ac\u201d click Stop Node.js button.<\/li><li>run JavaScript script \u00e2\u20ac\u201d 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.<\/li><li>remove application \u00e2\u20ac\u201d click Delete button and confirm the action in a pop-up.<\/li><li>change Node.js version \u00e2\u20ac\u201d choose Node.js version from a drop-down.<\/li><li>change Application mode \u00e2\u20ac\u201d choose application mode from a drop-down. Available modes are Production and Development.&nbsp;<br \/>specify Application root \u00e2\u20ac\u201d specify in a field a physical address to the application on a server that corresponds with its URI.<\/li><li>specify Application URL \u00e2\u20ac\u201d specify in a field an HTTP\/HTTPS link to the application.<\/li><li>specify Application startup file \u00e2\u20ac\u201d specify as NAME.js file.<\/li><li>run npm install command \u00e2\u20ac\u201d click Run npm install button to install the package(s) described in the package.json file.<\/li><li>add Environment variables \u00e2\u20ac\u201d click Add Variable and specify a name and a value.<\/li><\/ul>\n\n\n\n<p><strong>How To Debug Errors On Your Node.js Application<\/strong><\/p>\n\n\n\n<p><br \/> Directives such as PassengerFriendlyErrorPages and PassengerAppEnv are available for use from a .htaccess file.<\/p>\n\n\n\n<p>This allows cPanel users to debug a Node.js application during development.<\/p>\n\n\n\n<p>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:<\/p>\n\n\n\n<p>PassengerAppEnv development<br \/> or<\/p>\n\n\n\n<p>\n\nPassengerFriendlyErrorPages on\n\n<\/p>\n\n\n\n<p><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>how to setup or deploy an app on nodejs with our cpanel<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[181,182],"tags":[183],"class_list":["post-801","post","type-post","status-publish","format-standard","hentry","category-deploy-app-nodejs-cpanel","category-nodejs","tag-nodejs-on-cpanel"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p9Yxzd-cV","jetpack-related-posts":[{"id":1141,"url":"https:\/\/hosting-marketers.com\/news\/2022\/08\/27\/node-js-creating-an-application-on-our-cpanel-application-manager\/","url_meta":{"origin":801,"position":0},"title":"Node JS: Creating an Application on our CPANEL Application Manager","author":"Admin","date":"August 27, 2022","format":false,"excerpt":"Creating an Application in the cPanel Application Manager Hosting applications with cPanel is a two-step process: Install the app on the server.\u00c2\u00a0Register it with\u00c2\u00a0the Application Manager. We\u00e2\u20ac\u2122ll look at registering an application in the next section, but first, we need to install it on the server. Users of the Git\u00e2\u201e\u00a2\u2026","rel":"","context":"In &quot;Hosting Marketers News&quot;","block_context":{"text":"Hosting Marketers News","link":"https:\/\/hosting-marketers.com\/news\/category\/hosting-marketers-news\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1050,"url":"https:\/\/hosting-marketers.com\/news\/2021\/06\/02\/deploy-node-js-on-our-shared-servers\/","url_meta":{"origin":801,"position":1},"title":"Deploy Node.js on our shared servers","author":"Admin","date":"June 2, 2021","format":false,"excerpt":"[et_pb_section][et_pb_row][et_pb_column type=\"4_4\"][et_pb_text] Version Control with Git Before we can\u00a0configure your Node.js application, the first step is getting that application on your server. There are a few options. You can use FTP to upload the copy of your application to your server, or you can use cPanel\u00e2\u20ac\u2122s native Git support to\u2026","rel":"","context":"In &quot;Hosting Marketers News&quot;","block_context":{"text":"Hosting Marketers News","link":"https:\/\/hosting-marketers.com\/news\/category\/hosting-marketers-news\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":539,"url":"https:\/\/hosting-marketers.com\/news\/2015\/09\/01\/node-js-some-information\/","url_meta":{"origin":801,"position":2},"title":"Node.js some information","author":"Admin","date":"September 1, 2015","format":false,"excerpt":"As third-party software, Hosting Marketers does not support node.js beyond installation. All our servers have node.js installed, but you need to configure it on your account, for that we need to know which port you using for the node, and you will need to create cron job and a bash\u2026","rel":"","context":"In &quot;Hosting Marketers News&quot;","block_context":{"text":"Hosting Marketers News","link":"https:\/\/hosting-marketers.com\/news\/category\/hosting-marketers-news\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1367,"url":"https:\/\/hosting-marketers.com\/news\/2025\/04\/15\/12-essential-steps-to-secure-your-laravel-website-on-cpanel\/","url_meta":{"origin":801,"position":3},"title":"12 Essential Steps to Secure Your Laravel Website on cPanel","author":"Admin","date":"April 15, 2025","format":false,"excerpt":"Laravel is a powerful and flexible PHP framework \u2014 but with that power comes responsibility. If you're running your Laravel application on a cPanel server, securing your environment is critical. At Hosting Marketers, we use LiteSpeed, CloudLinux, CPGuard, and Cloudflare, providing a robust foundation \u2014 but the app itself must\u2026","rel":"","context":"In &quot;security&quot;","block_context":{"text":"security","link":"https:\/\/hosting-marketers.com\/news\/category\/security\/"},"img":{"alt_text":"Laravel security is not optional \u2014 and at Hosting Marketers, we make sure you start with the best protection possible. By combining strong server-level firewalls with smart application-level hardening, your Laravel website can stay one step ahead of hackers.","src":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_15_08-AM.png?fit=800%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_15_08-AM.png?fit=800%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_15_08-AM.png?fit=800%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_15_08-AM.png?fit=800%2C1200&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":482,"url":"https:\/\/hosting-marketers.com\/news\/2014\/07\/07\/cloudflare\/","url_meta":{"origin":801,"position":4},"title":"Hosting Marketers Partners with CloudFlare!","author":"Admin","date":"July 7, 2014","format":false,"excerpt":"This post was originally published in 2014 and covers the now-discontinued Cloudflare Railgun feature. It is kept for archival reference. See our 2025 guide for updated Cloudflare setup methods.","rel":"","context":"In &quot;Hosting Marketers News&quot;","block_context":{"text":"Hosting Marketers News","link":"https:\/\/hosting-marketers.com\/news\/category\/hosting-marketers-news\/"},"img":{"alt_text":"cloudfare network of datacenters","src":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2014\/07\/cloudflare-1.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2014\/07\/cloudflare-1.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2014\/07\/cloudflare-1.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2014\/07\/cloudflare-1.jpg?resize=700%2C400 2x"},"classes":[]},{"id":1323,"url":"https:\/\/hosting-marketers.com\/news\/2024\/05\/28\/effortlessly-separate-web-and-email-hosting-a-step-by-step-guide-to-setting-up-a-dedicated-mail-server-with-whm-cpanel\/","url_meta":{"origin":801,"position":5},"title":"Effortlessly Separate Web and Email Hosting: A Step-by-Step Guide to Setting Up a Dedicated Mail Server with WHM\/cPanel","author":"Admin","date":"May 28, 2024","format":false,"excerpt":"[et_pb_section fb_built=\"1\" _builder_version=\"4.23\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_row _builder_version=\"4.23\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_column type=\"4_4\" _builder_version=\"4.23\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_text _builder_version=\"4.24.2\" _module_preset=\"default\" global_colors_info=\"{}\"]In today\u2019s digital landscape, efficiently managing your web and email hosting can significantly enhance your server performance and security. If you\u2019re using WHM\/cPanel and looking to streamline your hosting setup, separating your web and email hosting\u2026","rel":"","context":"In &quot;email&quot;","block_context":{"text":"email","link":"https:\/\/hosting-marketers.com\/news\/category\/email\/"},"img":{"alt_text":"EmailServer","src":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2024\/05\/DALL%C2%B7E-2024-05-28-07.48.22-A-sleek-modern-data-center-with-two-distinct-server-racks-labeled-Web-Hosting-and-Email-Hosting.-The-Web-Hosting-rack-is-connected-to-a-cPanel-.webp?fit=1200%2C686&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2024\/05\/DALL%C2%B7E-2024-05-28-07.48.22-A-sleek-modern-data-center-with-two-distinct-server-racks-labeled-Web-Hosting-and-Email-Hosting.-The-Web-Hosting-rack-is-connected-to-a-cPanel-.webp?fit=1200%2C686&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2024\/05\/DALL%C2%B7E-2024-05-28-07.48.22-A-sleek-modern-data-center-with-two-distinct-server-racks-labeled-Web-Hosting-and-Email-Hosting.-The-Web-Hosting-rack-is-connected-to-a-cPanel-.webp?fit=1200%2C686&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2024\/05\/DALL%C2%B7E-2024-05-28-07.48.22-A-sleek-modern-data-center-with-two-distinct-server-racks-labeled-Web-Hosting-and-Email-Hosting.-The-Web-Hosting-rack-is-connected-to-a-cPanel-.webp?fit=1200%2C686&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2024\/05\/DALL%C2%B7E-2024-05-28-07.48.22-A-sleek-modern-data-center-with-two-distinct-server-racks-labeled-Web-Hosting-and-Email-Hosting.-The-Web-Hosting-rack-is-connected-to-a-cPanel-.webp?fit=1200%2C686&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/comments?post=801"}],"version-history":[{"count":9,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/801\/revisions"}],"predecessor-version":[{"id":820,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/801\/revisions\/820"}],"wp:attachment":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/media?parent=801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/categories?post=801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/tags?post=801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}