{"id":4018,"date":"2026-03-23T10:52:12","date_gmt":"2026-03-23T10:52:12","guid":{"rendered":"https:\/\/telahosting.com\/manual\/?p=4018"},"modified":"2026-03-23T10:52:12","modified_gmt":"2026-03-23T10:52:12","slug":"how-to-set-up-a-node-js-app-on-cpanel-directadmin","status":"publish","type":"post","link":"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/","title":{"rendered":"How to Set Up a Node.js App on cPanel\/DirectAdmin"},"content":{"rendered":"<p><img data-dominant-color=\"70716e\" data-has-transparency=\"false\" style=\"--dominant-color: #70716e;\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4019 not-transparent\" src=\"https:\/\/telahosting.com\/manual\/wp-content\/uploads\/2026\/03\/How-to-Set-Up-a-Node.js-App-on-cPanelDirectAdmin-711x400.avif\" alt=\"How to Set Up a Node.js App on cPanel\/DirectAdmin\" width=\"711\" height=\"400\" srcset=\"https:\/\/telahosting.com\/manual\/wp-content\/uploads\/2026\/03\/How-to-Set-Up-a-Node.js-App-on-cPanelDirectAdmin-711x400.avif 711w, https:\/\/telahosting.com\/manual\/wp-content\/uploads\/2026\/03\/How-to-Set-Up-a-Node.js-App-on-cPanelDirectAdmin-768x432.avif 768w, https:\/\/telahosting.com\/manual\/wp-content\/uploads\/2026\/03\/How-to-Set-Up-a-Node.js-App-on-cPanelDirectAdmin.avif 1366w\" sizes=\"auto, (max-width: 711px) 100vw, 711px\" \/><\/p>\n<p>Running a Node.js application on cPanel or DirectAdmin is possible on hosting plans that support Node.js through the control panel. This guide explains the practical steps to deploy your Node.js app, install dependencies, set the correct startup file, and make the application accessible through your domain or subdomain.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_1 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><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><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Before_You_Start\" >Before You Start<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#What_Your_App_Folder_Should_Contain\" >What Your App Folder Should Contain<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Part_1_How_to_Set_Up_a_Nodejs_App_on_cPanel\" >Part 1: How to Set Up a Node.js App on cPanel<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_1_Log_in_to_cPanel\" >Step 1: Log in to cPanel<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_2_Open_the_Nodejs_App_Feature\" >Step 2: Open the Node.js App Feature<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_3_Create_the_Application\" >Step 3: Create the Application<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_4_Upload_Your_Application_Files\" >Step 4: Upload Your Application Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_5_Install_the_App_Dependencies\" >Step 5: Install the App Dependencies<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_6_Make_Sure_Your_App_Uses_the_Correct_Port\" >Step 6: Make Sure Your App Uses the Correct Port<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_7_Restart_the_Application\" >Step 7: Restart the Application<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_8_Test_the_Application_URL\" >Step 8: Test the Application URL<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Part_2_How_to_Set_Up_a_Nodejs_App_on_DirectAdmin\" >Part 2: How to Set Up a Node.js App on DirectAdmin<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_1_Log_in_to_DirectAdmin\" >Step 1: Log in to DirectAdmin<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_2_Locate_Nodejs_Support\" >Step 2: Locate Node.js Support<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_3_Create_the_Nodejs_Application\" >Step 3: Create the Node.js Application<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_4_Upload_Your_App_Files\" >Step 4: Upload Your App Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_5_Install_Dependencies\" >Step 5: Install Dependencies<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_6_Start_or_Restart_the_App\" >Step 6: Start or Restart the App<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Step_7_Test_the_URL\" >Step 7: Test the URL<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Important_Notes_for_Both_cPanel_and_DirectAdmin\" >Important Notes for Both cPanel and DirectAdmin<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#1_Use_the_Correct_Startup_File\" >1. Use the Correct Startup File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#2_Do_Not_Upload_node_modules_If_Not_Necessary\" >2. Do Not Upload node_modules If Not Necessary<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#3_Check_Your_packagejson_File\" >3. Check Your package.json File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#4_Use_Environment_Variables_Properly\" >4. Use Environment Variables Properly<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#5_Make_Sure_Your_Domain_Points_Correctly\" >5. Make Sure Your Domain Points Correctly<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Common_Issues_and_Fixes\" >Common Issues and Fixes<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#App_Does_Not_Open\" >App Does Not Open<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#503_Error_or_Application_Unavailable\" >503 Error or Application Unavailable<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Module_Not_Found_Error\" >Module Not Found Error<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#App_Starts_Then_Stops\" >App Starts Then Stops<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Nodejs_Option_Missing_in_Control_Panel\" >Node.js Option Missing in Control Panel<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Simple_Example_of_a_Basic_Nodejs_App\" >Simple Example of a Basic Node.js App<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Final_Setup_Checklist\" >Final Setup Checklist<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/telahosting.com\/manual\/how-to-set-up-a-node-js-app-on-cpanel-directadmin\/#Need_Help\" >Need Help?<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Before_You_Start\"><\/span>Before You Start<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Before setting up your Node.js application, make sure you have the following ready:<\/p>\n<ul>\n<li>An active hosting account with Node.js support enabled.<\/li>\n<li>Your Node.js project files.<\/li>\n<li>A valid domain or subdomain already added to your hosting account.<\/li>\n<li>A <code>package.json<\/code> file inside your app folder.<\/li>\n<li>Your main startup file such as <code>app.js<\/code>, <code>server.js<\/code>, or another entry file used by your project.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"What_Your_App_Folder_Should_Contain\"><\/span>What Your App Folder Should Contain<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Your application folder should normally contain files like these:<\/p>\n<pre><code>package.json\r\napp.js or server.js\r\nnode_modules (will be created after installation)\r\npublic\r\nviews\r\n.env (if your app uses environment variables)<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Part_1_How_to_Set_Up_a_Nodejs_App_on_cPanel\"><\/span>Part 1: How to Set Up a Node.js App on cPanel<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Step_1_Log_in_to_cPanel\"><\/span>Step 1: Log in to cPanel<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Log in to your cPanel account for the domain or hosting package where you want to run the Node.js application.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_2_Open_the_Nodejs_App_Feature\"><\/span>Step 2: Open the Node.js App Feature<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In cPanel, look for one of the following options:<\/p>\n<ul>\n<li><strong>Setup Node.js App<\/strong><\/li>\n<li><strong>Node.js Selector<\/strong><\/li>\n<li><strong>Application Manager<\/strong><\/li>\n<\/ul>\n<p>The name may vary depending on your server configuration.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_3_Create_the_Application\"><\/span>Step 3: Create the Application<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Click <strong>Create Application<\/strong> and fill in the required details.<\/p>\n<p><strong>Typical fields you will see:<\/strong><\/p>\n<ul>\n<li><strong>Node.js Version:<\/strong> Choose the version your project requires.<\/li>\n<li><strong>Application Mode:<\/strong> Choose <strong>Production<\/strong> for live websites.<\/li>\n<li><strong>Application Root:<\/strong> This is the folder where your app files will be stored, for example <code>myapp<\/code>.<\/li>\n<li><strong>Application URL:<\/strong> Select the domain or subdomain that should load the app.<\/li>\n<li><strong>Application Startup File:<\/strong> This is usually <code>app.js<\/code> or <code>server.js<\/code>.<\/li>\n<\/ul>\n<p>After filling in the details, click <strong>Create<\/strong>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_4_Upload_Your_Application_Files\"><\/span>Step 4: Upload Your Application Files<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Open <strong>File Manager<\/strong> in cPanel and go to the application root you selected earlier. Upload your Node.js app files into that folder.<\/p>\n<p>Example:<\/p>\n<pre><code>\/home\/username\/myapp<\/code><\/pre>\n<p>If your application was created with application root <code>myapp<\/code>, then your files should be uploaded into that same folder.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_5_Install_the_App_Dependencies\"><\/span>Step 5: Install the App Dependencies<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>After creating the app, cPanel usually provides a command that activates the Node.js environment. Copy the command shown on your Node.js app page.<\/p>\n<p>It often looks similar to this:<\/p>\n<pre><code>source \/home\/username\/nodevenv\/myapp\/20\/bin\/activate &amp;&amp; cd \/home\/username\/myapp<\/code><\/pre>\n<p>Open <strong>Terminal<\/strong> in cPanel if available, or connect through SSH, then run the environment activation command. After that, run:<\/p>\n<pre><code>npm install<\/code><\/pre>\n<p>This will install all packages listed in your <code>package.json<\/code> file.<\/p>\n<p>If your project needs a build step, also run:<\/p>\n<pre><code>npm run build<\/code><\/pre>\n<p>Only use this if your app actually requires it.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_6_Make_Sure_Your_App_Uses_the_Correct_Port\"><\/span>Step 6: Make Sure Your App Uses the Correct Port<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Your application must listen on the port provided by the server environment. Do not force a fixed port unless your setup specifically requires it.<\/p>\n<p>Use code like this in your Node.js app:<\/p>\n<pre><code>const express = require('express');\r\nconst app = express();\r\n\r\nconst PORT = process.env.PORT || 3000;\r\n\r\napp.get('\/', (req, res) =&gt; {\r\n  res.send('Node.js app is working');\r\n});\r\n\r\napp.listen(PORT, () =&gt; {\r\n  console.log(`Server running on port ${PORT}`);\r\n});<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Step_7_Restart_the_Application\"><\/span>Step 7: Restart the Application<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Go back to the <strong>Setup Node.js App<\/strong> page in cPanel and click:<\/p>\n<ul>\n<li><strong>Restart<\/strong>, or<\/li>\n<li><strong>Start App<\/strong><\/li>\n<\/ul>\n<p>This will start the application with the new settings and installed dependencies.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_8_Test_the_Application_URL\"><\/span>Step 8: Test the Application URL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Visit your assigned domain or subdomain in a browser. If everything is correctly configured, your Node.js app should now load successfully.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Part_2_How_to_Set_Up_a_Nodejs_App_on_DirectAdmin\"><\/span>Part 2: How to Set Up a Node.js App on DirectAdmin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Step_1_Log_in_to_DirectAdmin\"><\/span>Step 1: Log in to DirectAdmin<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Log in to your DirectAdmin account for the hosting package where you want to deploy the Node.js app.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_2_Locate_Nodejs_Support\"><\/span>Step 2: Locate Node.js Support<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Depending on how the server is configured, Node.js may appear under one of these areas:<\/p>\n<ul>\n<li><strong>Node.js<\/strong><\/li>\n<li><strong>Application Manager<\/strong><\/li>\n<li><strong>CustomBuild Features<\/strong> integrated into the user panel<\/li>\n<\/ul>\n<p>If you do not see Node.js in DirectAdmin, your hosting plan may not have Node.js enabled yet.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_3_Create_the_Nodejs_Application\"><\/span>Step 3: Create the Node.js Application<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Create a new Node.js application and fill in the details provided by DirectAdmin.<\/p>\n<p><strong>Common settings include:<\/strong><\/p>\n<ul>\n<li><strong>Node.js Version<\/strong><\/li>\n<li><strong>Application Root<\/strong><\/li>\n<li><strong>Domain or Subdomain<\/strong><\/li>\n<li><strong>Startup File<\/strong><\/li>\n<li><strong>Environment Mode<\/strong><\/li>\n<\/ul>\n<p>Use the same logic as cPanel:<\/p>\n<ul>\n<li>Set the correct application folder.<\/li>\n<li>Use the proper startup file.<\/li>\n<li>Choose the correct domain or subdomain.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Step_4_Upload_Your_App_Files\"><\/span>Step 4: Upload Your App Files<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Use the DirectAdmin <strong>File Manager<\/strong> or upload over FTP\/SFTP to place your project files inside the selected application root folder.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_5_Install_Dependencies\"><\/span>Step 5: Install Dependencies<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If DirectAdmin provides terminal access or SSH access is enabled, go into the application folder and run:<\/p>\n<pre><code>npm install<\/code><\/pre>\n<p>If your app requires a build step, also run:<\/p>\n<pre><code>npm run build<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Step_6_Start_or_Restart_the_App\"><\/span>Step 6: Start or Restart the App<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>After installation is complete, use the DirectAdmin Node.js app controls to start or restart the application.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_7_Test_the_URL\"><\/span>Step 7: Test the URL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Open the configured domain or subdomain in your browser to confirm that the Node.js app is loading properly.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Important_Notes_for_Both_cPanel_and_DirectAdmin\"><\/span>Important Notes for Both cPanel and DirectAdmin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1_Use_the_Correct_Startup_File\"><\/span>1. Use the Correct Startup File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Your startup file in the control panel must match the actual main file in your project.<\/p>\n<p>Examples:<\/p>\n<ul>\n<li>If your app starts from <code>app.js<\/code>, then use <code>app.js<\/code>.<\/li>\n<li>If your app starts from <code>server.js<\/code>, then use <code>server.js<\/code>.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"2_Do_Not_Upload_node_modules_If_Not_Necessary\"><\/span>2. Do Not Upload <code>node_modules<\/code> If Not Necessary<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>It is usually better to upload the project files and then run <code>npm install<\/code> on the server instead of uploading a large <code>node_modules<\/code> folder from your computer.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_Check_Your_packagejson_File\"><\/span>3. Check Your <code>package.json<\/code> File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Make sure your <code>package.json<\/code> file is valid and includes all required dependencies and scripts.<\/p>\n<p>Example:<\/p>\n<pre><code>{\r\n  \"name\": \"my-node-app\",\r\n  \"version\": \"1.0.0\",\r\n  \"main\": \"app.js\",\r\n  \"scripts\": {\r\n    \"start\": \"node app.js\"\r\n  },\r\n  \"dependencies\": {\r\n    \"express\": \"^4.18.2\"\r\n  }\r\n}<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"4_Use_Environment_Variables_Properly\"><\/span>4. Use Environment Variables Properly<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If your app uses database credentials, API keys, or other sensitive values, keep them in environment variables or a properly secured <code>.env<\/code> file where supported.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_Make_Sure_Your_Domain_Points_Correctly\"><\/span>5. Make Sure Your Domain Points Correctly<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The domain or subdomain used for the Node.js app must already be active on the hosting account and pointing to the correct server.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Common_Issues_and_Fixes\"><\/span>Common Issues and Fixes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"App_Does_Not_Open\"><\/span>App Does Not Open<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Possible causes:<\/p>\n<ul>\n<li>Wrong startup file<\/li>\n<li>Dependencies not installed<\/li>\n<li>App crashed on startup<\/li>\n<li>App not listening on <code>process.env.PORT<\/code><\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"503_Error_or_Application_Unavailable\"><\/span>503 Error or Application Unavailable<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>This usually means the app failed to start correctly. Restart the app and review your startup file and dependency installation.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Module_Not_Found_Error\"><\/span>Module Not Found Error<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>This usually means packages were not installed properly. Run:<\/p>\n<pre><code>npm install<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"App_Starts_Then_Stops\"><\/span>App Starts Then Stops<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>This usually means the application is crashing during launch. Check the app logs, terminal output, or application error logs in your control panel.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Nodejs_Option_Missing_in_Control_Panel\"><\/span>Node.js Option Missing in Control Panel<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you cannot find any Node.js feature in cPanel or DirectAdmin, it means Node.js may not be enabled on your current hosting package.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Simple_Example_of_a_Basic_Nodejs_App\"><\/span>Simple Example of a Basic Node.js App<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Create a file called <code>app.js<\/code> with the following content:<\/p>\n<pre><code>const express = require('express');\r\nconst app = express();\r\n\r\nconst PORT = process.env.PORT || 3000;\r\n\r\napp.get('\/', (req, res) =&gt; {\r\n  res.send('Welcome to my Node.js app');\r\n});\r\n\r\napp.listen(PORT, () =&gt; {\r\n  console.log(`App is running on port ${PORT}`);\r\n});<\/code><\/pre>\n<p>Then create your <code>package.json<\/code> file, upload both files, install dependencies, and restart the application.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Final_Setup_Checklist\"><\/span>Final Setup Checklist<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Node.js is enabled on the hosting account.<\/li>\n<li>The application has been created in cPanel or DirectAdmin.<\/li>\n<li>The correct app root folder was selected.<\/li>\n<li>The correct startup file was entered.<\/li>\n<li>Your app files were uploaded successfully.<\/li>\n<li><code>npm install<\/code> was run successfully.<\/li>\n<li>The app uses <code>process.env.PORT<\/code>.<\/li>\n<li>The app was restarted after setup.<\/li>\n<li>The assigned domain or subdomain opens correctly.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Need_Help\"><\/span>Need Help?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If your Node.js app is not starting correctly on your telaHosting account, kindly contact the telaHosting support team with your domain name, app root folder, startup file name, and any error message you are seeing so the issue can be checked faster.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Running a Node.js application on cPanel or DirectAdmin is possible on hosting plans that support Node.js through the control panel. This guide explains the practical steps to deploy your Node.js app, install dependencies, set the correct startup file, and make the application accessible through your domain or subdomain. Before You Start Before setting up your&#8230;<\/p>\n","protected":false},"author":1,"featured_media":4019,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[32,33],"tags":[97],"class_list":["post-4018","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel","category-directadmin","tag-node-js"],"_links":{"self":[{"href":"https:\/\/telahosting.com\/manual\/wp-json\/wp\/v2\/posts\/4018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/telahosting.com\/manual\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/telahosting.com\/manual\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/telahosting.com\/manual\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/telahosting.com\/manual\/wp-json\/wp\/v2\/comments?post=4018"}],"version-history":[{"count":2,"href":"https:\/\/telahosting.com\/manual\/wp-json\/wp\/v2\/posts\/4018\/revisions"}],"predecessor-version":[{"id":4022,"href":"https:\/\/telahosting.com\/manual\/wp-json\/wp\/v2\/posts\/4018\/revisions\/4022"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/telahosting.com\/manual\/wp-json\/wp\/v2\/media\/4019"}],"wp:attachment":[{"href":"https:\/\/telahosting.com\/manual\/wp-json\/wp\/v2\/media?parent=4018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/telahosting.com\/manual\/wp-json\/wp\/v2\/categories?post=4018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/telahosting.com\/manual\/wp-json\/wp\/v2\/tags?post=4018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}