{"id":984,"date":"2023-09-06T11:18:51","date_gmt":"2023-09-06T10:18:51","guid":{"rendered":"https:\/\/harmonweb.com\/blog\/?p=984"},"modified":"2023-09-06T11:18:51","modified_gmt":"2023-09-06T10:18:51","slug":"how-to-host-a-node-js-application-with-cpanel","status":"publish","type":"post","link":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/","title":{"rendered":"How to Host a Node.JS Application With cPanel"},"content":{"rendered":"\n<p>Hosting Node.js was once a difficult task, especially on multi-user web hosting servers. Installing JavaScript applications and configuring Node.js environments, on the other hand, is a piece of cake with cPanel &amp; WHM&#8217;s Application Manager, allowing web hosts to offer intuitive Node.js hosting services with an easy-to-use graphical interface.<\/p>\n\n\n\n<p>This article will walk you through activating cPanel&#8217;s Application Manager as well as installing, registering, and managing Node.js applications.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e93a2ddf24f\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e93a2ddf24f\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#Getting_Started_With_the_cPanel_Application_Manager\" >Getting Started With the cPanel Application Manager<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#Creating_an_Application_in_the_cPanel_Application_Manager\" >Creating an Application in the cPanel Application Manager<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#Registering_Your_NodeJS_Application_in_the_cPanel_Application_Manager\" >Registering Your Node.JS Application in the cPanel Application Manager<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#Adding_Environment_Variables_to_Your_NodeJS_Apps_Environment\" >Adding Environment Variables to Your Node.JS App\u2019s Environment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#Editing_Your_NodeJS_Application\" >Editing Your Node.JS Application<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#Uninstalling_Your_NodeJS_Application\" >Uninstalling Your Node.JS Application<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Getting_Started_With_the_cPanel_Application_Manager\"><\/span><strong>Getting Started With the cPanel Application Manager<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In Application Manager, cPanel users can register Node.js applications and associate them with a domain. To provide this feature to hosting users, server administrators must first install a number of support packages and activate Application Manager.<\/p>\n\n\n\n<p>To enable Application Manager, we&#8217;ll use WHM&#8217;s Feature Manager. Open Feature Manager, which is located in the WHM sidebar menu under Packages.<\/p>\n\n\n\n<p>Under Manage Feature List, click the Edit button with the Default list selected in the dropdown menu.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"419\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-38-1024x419.png?v=1659271302\" alt=\"feature manager in WHM\" class=\"wp-image-985\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-38-1024x419.png 1024w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-38-300x123.png 300w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-38-768x314.png 768w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-38.png 1117w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Enter Application Manager in the search field and ensure that its feature list entry is checked. If it isn&#8217;t, click the adjacent box before clicking Save at the bottom of the page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"524\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-39-1024x524.png?v=1659271696\" alt=\"\" class=\"wp-image-986\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-39-1024x524.png 1024w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-39-300x153.png 300w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-39-768x393.png 768w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-39.png 1212w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Following that, we&#8217;ll install the software that enables cPanel to run and manage Node.js applications, such as the mod passenger app server and EasyApache4&#8217;s Node environment. To install the software, you must log in as root using SSH:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install ea-ruby24-mod_passenger ea-apache24-mod_env ea-nodejs10<\/code><\/pre>\n\n\n\n<p>Application Manager is now ready to host Node.js applications in user cPanel accounts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Creating_an_Application_in_the_cPanel_Application_Manager\"><\/span><strong>Creating an Application in the cPanel Application Manager<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Using cPanel to host applications is a two-step process:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Install the app on the server.\u00a0<\/li><li>Register it with\u00a0<em>Application Manager<\/em>.<\/li><\/ul>\n\n\n\n<p>In the following section, we&#8217;ll look at registering an application, but first, we&#8217;ll install it on the server. Git\u00a0version control system users could clone a repository using the command-line client or the Git Version Control interface in cPanel. To demonstrate the process, we&#8217;ll make a simple single-file application.<\/p>\n\n\n\n<p>Log in as a cPanel user with SSH and create a new directory in their home directory.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nmkdir nodejsapp<\/code><\/pre>\n\n\n\n<p>You can name the directory whatever you want. This is where the code files for your app will be stored. Using your preferred text editor, create a file called app.js in this directory. Unless you have a compelling reason to change the naming convention, cPanel expects the application&#8217;s entry point to be called app.js.<\/p>\n\n\n\n<p>Copy and paste the following code into the new file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const http = require('http')\r\nconst hostname = '127.0.0.1';\r\nconst port = 3000;\r\n\r\nconst server = http.createServer((req, res) => {\r\n  res.statusCode = 200;\r\n  res.setHeader('Content-Type', 'text\/plain');\r\n  res.end('Hello World! I am your new NodeJS app! \\n');\r\n});\r\n\r\nserver.listen(port, hostname, () => {\r\n  console.log(`Server running at http:\/\/${hostname}:${port}\/`);\r\n});<\/code><\/pre>\n\n\n\n<p>On port 3000, the code starts an HTTP server. It responds to web requests by saying, &#8220;Hello World! &#8220;I am your new NodeJS application!&#8221;<\/p>\n\n\n\n<p>We could proceed to the registration step right away, but let&#8217;s make sure the app works first. Execute the following command to run our mini-app with EasyApache&#8217;s Node.js installation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/cpanel\/ea-nodejs10\/bin\/node app.js<\/code><\/pre>\n\n\n\n<p>If everything goes well, you will see a message that says:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Server running at http:\/\/127.0.0.1:3000<\/code><\/pre>\n\n\n\n<p>Finally, launch a new terminal window and log in as the same cPanel user. To send a request to the app, we&#8217;ll use the curl HTTP client.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl http:\/\/127.0.0.1:3000<\/code><\/pre>\n\n\n\n<p>If it responds with &#8220;Hello World! I am a NodeJS app on cPanel,&#8221; you can proceed to the next step, which is registering your Node.js app with cPanel.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Registering_Your_NodeJS_Application_in_the_cPanel_Application_Manager\"><\/span><strong>Registering Your Node.JS Application in the cPanel Application Manager<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Registering your application tells the Passenger app manager and cPanel where to look for it and which domain to use.<\/p>\n\n\n\n<p>Open the Application Manager in cPanel, which can be found on the main page under Software.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"243\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-40-1024x243.png?v=1659273584\" alt=\"\" class=\"wp-image-987\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-40-1024x243.png 1024w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-40-300x71.png 300w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-40-768x183.png 768w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-40.png 1043w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Click the\u00a0<em>Register Application\u00a0<\/em>button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"274\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-41-1024x274.png?v=1659273588\" alt=\"\" class=\"wp-image-988\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-41-1024x274.png 1024w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-41-300x80.png 300w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-41-768x205.png 768w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-41.png 1402w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>We must provide four pieces of information in the Application Configuration table:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"616\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-42-1024x616.png?v=1659273701\" alt=\"\" class=\"wp-image-989\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-42-1024x616.png 1024w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-42-300x181.png 300w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-42-768x462.png 768w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-42.png 1246w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Application Name:<\/strong> The application&#8217;s display name. You can use any name you want, but it must begin with a number or letter and cannot contain periods.<\/li><li><strong>Deployment Domain:<\/strong> The domain name of the app. The domain must already be linked to a cPanel account.<\/li><li><strong>Base Application URL:<\/strong> The home page of the app will be accessible via the deployment domain + the base URL. For example, if you enter &#8220;nodeapp&#8221; in this field and the Deployment Domain is &#8220;example.com,&#8221; the app will be served from &#8220;example.com\/nodeapp.&#8221; The URL extension does not have to be the same as the directory in which the app&#8217;s files are stored.<\/li><li><strong>Application Path:<\/strong> The location of the app&#8217;s files in relation to the user&#8217;s home. In our example, we created a directory called &#8220;nodejsapp&#8221; in home, so we&#8217;d type &#8220;nodejsapp&#8221; here.<\/li><\/ul>\n\n\n\n<p>The Deployment Environment selector indicates whether the app is still in development or is ready for production deployment.<\/p>\n\n\n\n<p>An interface for configuring environment variables is located beneath the Application Configuration table. In the following section, we&#8217;ll go over them in greater detail.<\/p>\n\n\n\n<p>For the time being, we&#8217;ll click the Deploy button at the bottom of the page, and cPanel will configure the environment and domain for the app. When it&#8217;s finished, you can open your new app in a web browser by typing &#8220;example.com\/nodeapp&#8221; in our examples.<\/p>\n\n\n\n<p>Our one-pager, unlike a real app, has no external dependencies. If it did, the Ensure Dependencies button in cPanel Application Manager would appear for one-click installation. The button is only available for apps that are part of or have a package. json file containing a dependency list.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"313\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-43-1024x313.png?v=1659274473\" alt=\"\" class=\"wp-image-990\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-43-1024x313.png 1024w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-43-300x92.png 300w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-43-768x235.png 768w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-43.png 1305w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If you&#8217;re following along with our examples and want to see Ensure Dependencies in action, add a package.json file to the app&#8217;s directory with the following contents:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\r\n  \"name\": \"nodejsapp\",\r\n  \"version\": \"1.0.0\",\r\n  \"description\": \"A Node App\",\r\n  \"main\": \"app.js\",\r\n  \"author\": \"\",\r\n  \"license\": \"ISC\",\r\n  \"dependencies\": {\r\n    \"express\": \"^4.17.1\"\r\n  }\r\n}<\/code><\/pre>\n\n\n\n<p>As you can see, the Express web framework is listed as a dependency. In Application Manager, the Ensure Dependencies button should now be available. When you click it, cPanel installs Express as well as any applications and libraries that it requires.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Adding_Environment_Variables_to_Your_NodeJS_Apps_Environment\"><\/span><strong>Adding Environment Variables to Your Node.JS App\u2019s Environment<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Environment variables are name-value pairs that hold a piece of data. They function similarly to variables in programming, except that they are external to the program rather than internal to it. Environment variables are used by servers to store useful configuration data.<\/p>\n\n\n\n<p>CentOS, for example, stores a list of directories containing command-line programs in the PATH environment variable. When you type &#8220;ls,&#8221; the shell searches those directories for an executable file with that name. If there was no PATH variable, you&#8217;d have to type the entire command path: &#8220;\/usr\/bin\/ls&#8221; instead of just &#8220;ls.&#8221;<\/p>\n\n\n\n<p>The server administrator can modify the PATH environment variable to control which directories the shell searches without modifying the shell&#8217;s internal code. You can add environment variables to your Node.js app&#8217;s environment using cPanel&#8217;s Application Manager to configure its behavior in the same way.<\/p>\n\n\n\n<p>This line of JavaScript in our simple app.js file instructs the app on which port it should listen for connections.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const port = 3000;<\/code><\/pre>\n\n\n\n<p>In reality, when writing code, a developer is unlikely to know the correct port. To give users more options, they could instruct the app to search its environment for a variable called PORT and use its value when configuring the app.<\/p>\n\n\n\n<p>The JavaScript code in Node.js looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const PORT = process.env.PORT || 3000;<\/code><\/pre>\n\n\n\n<p>This changes the value of the app&#8217;s internal PORT variable to the value of the environment variable PORT, or to 3000 if no environment variable is set.<\/p>\n\n\n\n<p>By setting a PORT variable in the app&#8217;s environment, the user can now tell the app which port to bind to. To do so, navigate to the Environment Variables interface beneath Application Configuration in cPanel&#8217;s Application Manager and click Add Variable.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"239\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-44.png\" alt=\"\" class=\"wp-image-991\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-44.png 770w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-44-300x93.png 300w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-44-768x238.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n\n\n\n<p>Enter a variable name and value, and click\u00a0<em>Save.\u00a0<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"274\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-45.png\" alt=\"\" class=\"wp-image-992\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-45.png 764w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-45-300x108.png 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Editing_Your_NodeJS_Application\"><\/span><strong>Editing Your Node.JS Application<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In the Application Manager, you can change the registration configuration of a Node application.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"243\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-46-1024x243.png?v=1659278061\" alt=\"\" class=\"wp-image-993\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-46-1024x243.png 1024w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-46-300x71.png 300w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-46-768x183.png 768w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-46.png 1043w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In the Actions column, click the Edit button. You can edit all of the values you set when registering your application in this interface, including the environment variables.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"398\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-47-1024x398.png?v=1659278132\" alt=\"\" class=\"wp-image-994\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-47-1024x398.png 1024w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-47-300x117.png 300w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-47-768x298.png 768w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-47.png 1117w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Uninstalling_Your_NodeJS_Application\"><\/span><strong>Uninstalling Your Node.JS Application<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Click the unregister link to the right of the Application Manager table to uninstall or &#8220;unregister&#8221; a Node.js application from cPanel.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"398\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-48-1024x398.png?v=1659278285\" alt=\"\" class=\"wp-image-995\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-48-1024x398.png 1024w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-48-300x117.png 300w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-48-768x298.png 768w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/image-48.png 1117w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>When you unregister an application, it is removed from the list, its configuration file is deleted, and it is disconnected from the domain. The application&#8217;s files are not deleted by cPanel, but you can delete them yourself in File Manager or via the command line.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hosting Node.js was once a difficult task, especially on multi-user web hosting servers. Installing JavaScript applications and configuring&hellip;<\/p>\n","protected":false},"author":1,"featured_media":997,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[158],"tags":[],"class_list":["post-984","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-troubleshooting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Host a Node.JS Application With cPanel | HarmonWeb Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Host a Node.JS Application With cPanel | HarmonWeb Blog\" \/>\n<meta property=\"og:description\" content=\"Hosting Node.js was once a difficult task, especially on multi-user web hosting servers. Installing JavaScript applications and configuring&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/\" \/>\n<meta property=\"og:site_name\" content=\"HarmonWeb Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-06T10:18:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/node-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"318\" \/>\n\t<meta property=\"og:image:height\" content=\"159\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"John Adegoke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Adegoke\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/\"},\"author\":{\"name\":\"John Adegoke\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#\\\/schema\\\/person\\\/e9bc75c3e7e30a261690c47ec872a8fc\"},\"headline\":\"How to Host a Node.JS Application With cPanel\",\"datePublished\":\"2023-09-06T10:18:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/\"},\"wordCount\":1383,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/node-1.png\",\"articleSection\":[\"Troubleshooting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/\",\"name\":\"How to Host a Node.JS Application With cPanel | HarmonWeb Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/node-1.png\",\"datePublished\":\"2023-09-06T10:18:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/#primaryimage\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/node-1.png\",\"contentUrl\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/node-1.png\",\"width\":318,\"height\":159},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-host-a-node-js-application-with-cpanel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Host a Node.JS Application With cPanel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/\",\"name\":\"HarmonWeb Blog\",\"description\":\"HarmonWeb\",\"publisher\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#organization\",\"name\":\"HarmonWeb\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/cropped-HARMON-WEB-LOGO-2.png\",\"contentUrl\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/cropped-HARMON-WEB-LOGO-2.png\",\"width\":831,\"height\":172,\"caption\":\"HarmonWeb\"},\"image\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#\\\/schema\\\/person\\\/e9bc75c3e7e30a261690c47ec872a8fc\",\"name\":\"John Adegoke\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/litespeed\\\/avatar\\\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/litespeed\\\/avatar\\\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677\",\"contentUrl\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/litespeed\\\/avatar\\\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677\",\"caption\":\"John Adegoke\"},\"sameAs\":[\"https:\\\/\\\/harmonweb.com\\\/blog\"],\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/author\\\/harmonweb\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Host a Node.JS Application With cPanel | HarmonWeb Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/","og_locale":"en_US","og_type":"article","og_title":"How to Host a Node.JS Application With cPanel | HarmonWeb Blog","og_description":"Hosting Node.js was once a difficult task, especially on multi-user web hosting servers. Installing JavaScript applications and configuring&hellip;","og_url":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/","og_site_name":"HarmonWeb Blog","article_published_time":"2023-09-06T10:18:51+00:00","og_image":[{"width":318,"height":159,"url":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/node-1.png","type":"image\/png"}],"author":"John Adegoke","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Adegoke","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#article","isPartOf":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/"},"author":{"name":"John Adegoke","@id":"https:\/\/harmonweb.com\/blog\/#\/schema\/person\/e9bc75c3e7e30a261690c47ec872a8fc"},"headline":"How to Host a Node.JS Application With cPanel","datePublished":"2023-09-06T10:18:51+00:00","mainEntityOfPage":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/"},"wordCount":1383,"commentCount":0,"publisher":{"@id":"https:\/\/harmonweb.com\/blog\/#organization"},"image":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/node-1.png","articleSection":["Troubleshooting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/","url":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/","name":"How to Host a Node.JS Application With cPanel | HarmonWeb Blog","isPartOf":{"@id":"https:\/\/harmonweb.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#primaryimage"},"image":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/node-1.png","datePublished":"2023-09-06T10:18:51+00:00","breadcrumb":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#primaryimage","url":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/node-1.png","contentUrl":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2022\/07\/node-1.png","width":318,"height":159},{"@type":"BreadcrumbList","@id":"https:\/\/harmonweb.com\/blog\/how-to-host-a-node-js-application-with-cpanel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/harmonweb.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Host a Node.JS Application With cPanel"}]},{"@type":"WebSite","@id":"https:\/\/harmonweb.com\/blog\/#website","url":"https:\/\/harmonweb.com\/blog\/","name":"HarmonWeb Blog","description":"HarmonWeb","publisher":{"@id":"https:\/\/harmonweb.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/harmonweb.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/harmonweb.com\/blog\/#organization","name":"HarmonWeb","url":"https:\/\/harmonweb.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/harmonweb.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2020\/06\/cropped-HARMON-WEB-LOGO-2.png","contentUrl":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2020\/06\/cropped-HARMON-WEB-LOGO-2.png","width":831,"height":172,"caption":"HarmonWeb"},"image":{"@id":"https:\/\/harmonweb.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/harmonweb.com\/blog\/#\/schema\/person\/e9bc75c3e7e30a261690c47ec872a8fc","name":"John Adegoke","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/harmonweb.com\/blog\/wp-content\/litespeed\/avatar\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677","url":"https:\/\/harmonweb.com\/blog\/wp-content\/litespeed\/avatar\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677","contentUrl":"https:\/\/harmonweb.com\/blog\/wp-content\/litespeed\/avatar\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677","caption":"John Adegoke"},"sameAs":["https:\/\/harmonweb.com\/blog"],"url":"https:\/\/harmonweb.com\/blog\/author\/harmonweb\/"}]}},"_links":{"self":[{"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/posts\/984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/comments?post=984"}],"version-history":[{"count":1,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/posts\/984\/revisions"}],"predecessor-version":[{"id":998,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/posts\/984\/revisions\/998"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/media\/997"}],"wp:attachment":[{"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/media?parent=984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/categories?post=984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/tags?post=984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}