{"id":3127,"date":"2024-09-12T15:28:45","date_gmt":"2024-09-12T09:58:45","guid":{"rendered":"https:\/\/www.nettigritty.com\/kb\/?p=3127"},"modified":"2024-09-12T15:28:45","modified_gmt":"2024-09-12T09:58:45","slug":"how-to-set-up-a-node-js-application-using-cloudlinuxs-node-js-selector-in-cpanel","status":"publish","type":"post","link":"https:\/\/www.nettigritty.com\/kb\/cpanel\/how-to-set-up-a-node-js-application-using-cloudlinuxs-node-js-selector-in-cpanel\/","title":{"rendered":"How to Set Up a Node.js Application Using CloudLinux\u2019s Node.js Selector in cPanel"},"content":{"rendered":"<p>\n\t\t\tIf you are hosting your application on a server with <strong>CloudLinux<\/strong> installed and have access to <strong>cPanel<\/strong>, setting up a Node.js application becomes straightforward. CloudLinux&rsquo;s <strong>Node.js Selector<\/strong> allows you to easily manage and deploy Node.js applications with various versions, without requiring advanced server configurations. Here&rsquo;s a step-by-step guide to setting up a Node.js application using the Node.js Selector in cPanel.<\/p>\n<h3>\n\t\t\tPrerequisites<\/h3>\n<ul>\n<li>\n\t\t\t\tA cPanel account with Node.js Selector enabled by your hosting provider.<\/li>\n<li>\n\t\t\t\tSSH or terminal access to execute commands (if necessary).<\/li>\n<li>\n\t\t\t\tYour Node.js application code ready for deployment.<\/li>\n<\/ul>\n<h3>\n\t\t\tStep 1: Log in to cPanel<\/h3>\n<p>\n\t\t\tLog in to your hosting account&rsquo;s <strong>cPanel<\/strong>. You can typically access cPanel by visiting <code>yourdomain.com\/cpanel<\/code> and entering your credentials.<\/p>\n<h3>\n\t\t\tStep 2: Access the Node.js Selector<\/h3>\n<p>\n\t\t\tOnce logged in, scroll down or use the search bar to find <strong>Setup Node.js App<\/strong> under the <strong>Software<\/strong> section.<\/p>\n<h3>\n\t\t\tStep 3: Create a New Node.js Application<\/h3>\n<ol>\n<li>\n<p>\n\t\t\t\t\tIn the <strong>Setup Node.js App<\/strong> interface, click the <strong>Create Application<\/strong> button.<\/p>\n<\/li>\n<li>\n<p>\n\t\t\t\t\tYou will be prompted to configure your application:<\/p>\n<ul>\n<li>\n\t\t\t\t\t\t<strong>Node.js Version<\/strong>: Choose the version of Node.js you want to use for your application. Select the latest stable version that matches your app&#39;s requirements.<\/li>\n<li>\n\t\t\t\t\t\t<strong>Application Mode<\/strong>: Select whether the application should run in <strong>Development<\/strong> or <strong>Production<\/strong> mode.<\/li>\n<li>\n\t\t\t\t\t\t<strong>Application Root<\/strong>: This is the directory where your application files will be stored. You can either use an existing directory or create a new one.<\/li>\n<li>\n\t\t\t\t\t\t<strong>Application URL<\/strong>: Define the URL path where your application will be accessible (e.g., <code>https:\/\/yourdomain.com\/app<\/code>).<\/li>\n<li>\n\t\t\t\t\t\t<strong>Application Startup File<\/strong>: Enter the name of the file that will start your application (e.g., <code>app.js<\/code> or <code>server.js<\/code>).<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\n\t\t\t\t\tClick <strong>Create<\/strong> once all the information is filled in. The system will now initialize the environment for your Node.js application.<\/p>\n<\/li>\n<\/ol>\n<h3>\n\t\t\tStep 4: Upload Your Application Files<\/h3>\n<ol>\n<li>\n\t\t\t\tUsing the <strong>File Manager<\/strong> in cPanel or an FTP client, navigate to the <strong>Application Root<\/strong> directory that you defined in the previous step.<\/li>\n<li>\n\t\t\t\tUpload your Node.js application files into this directory.<\/li>\n<li>\n\t\t\t\tMake sure that your <strong>package.json<\/strong> file is correctly configured with the necessary dependencies and scripts.<\/li>\n<\/ol>\n<h3>\n\t\t\tStep 5: Install Dependencies<\/h3>\n<ol>\n<li>\n\t\t\t\tBack in cPanel, return to the <strong>Setup Node.js App<\/strong> interface.<\/li>\n<li>\n\t\t\t\tLocate your application and click the <strong>Manage<\/strong> button.<\/li>\n<li>\n\t\t\t\tIn the management interface, you will see an option to run the <strong>NPM Install<\/strong> command. Click this button to install the dependencies listed in your <code>package.json<\/code>.<\/li>\n<\/ol>\n<h3>\n\t\t\tStep 6: Start Your Application<\/h3>\n<ol>\n<li>\n\t\t\t\tAfter the dependencies are installed, scroll down in the management interface and click the <strong>Run JS Script<\/strong> button next to the <strong>Application Startup File<\/strong> to start your application.<\/li>\n<li>\n\t\t\t\tYou should see a message indicating that the application has started successfully.<\/li>\n<\/ol>\n<h3>\n\t\t\tStep 7: Test Your Application<\/h3>\n<p>\n\t\t\tNavigate to the <strong>Application URL<\/strong> you configured earlier. If everything is set up correctly, your Node.js application should be running live.<\/p>\n<h3>\n\t\t\tStep 8: Managing and Monitoring the Application<\/h3>\n<ul>\n<li>\n\t\t\t\t<strong>Restart Application<\/strong>: If you make changes to your code, you may need to restart the application using the <strong>Restart<\/strong> button in the Node.js Selector interface.<\/li>\n<li>\n\t\t\t\t<strong>View Logs<\/strong>: To troubleshoot any issues, use the <strong>Error Log<\/strong> or <strong>Access Log<\/strong> options to view your application&rsquo;s logs.<\/li>\n<li>\n\t\t\t\t<strong>Change Node.js Version<\/strong>: You can easily change the Node.js version by stopping the application and selecting a new version in the setup interface.<\/li>\n<\/ul>\n<h3>\n\t\t\tConclusion<\/h3>\n<p>\n\t\t\tSetting up a Node.js application using CloudLinux&rsquo;s Node.js Selector in cPanel simplifies the deployment process significantly. By following these steps, you can quickly deploy, manage, and scale your Node.js applications directly from cPanel, without worrying about server configurations or manual installations.<\/p>\n<p>\n\t\t\tWith this setup, you&rsquo;re now ready to develop and host Node.js applications with ease.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are hosting your application on a server with CloudLinux installed and have access to cPanel, setting up a Node.js application becomes straightforward. CloudLinux&rsquo;s Node.js Selector allows you to easily manage and deploy Node.js applications with various versions, without requiring advanced server configurations. Here&rsquo;s a step-by-step guide to setting up a Node.js application using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3127","post","type-post","status-publish","format-standard","hentry","category-cpanel"],"_links":{"self":[{"href":"https:\/\/www.nettigritty.com\/kb\/wp-json\/wp\/v2\/posts\/3127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nettigritty.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nettigritty.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nettigritty.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nettigritty.com\/kb\/wp-json\/wp\/v2\/comments?post=3127"}],"version-history":[{"count":1,"href":"https:\/\/www.nettigritty.com\/kb\/wp-json\/wp\/v2\/posts\/3127\/revisions"}],"predecessor-version":[{"id":3128,"href":"https:\/\/www.nettigritty.com\/kb\/wp-json\/wp\/v2\/posts\/3127\/revisions\/3128"}],"wp:attachment":[{"href":"https:\/\/www.nettigritty.com\/kb\/wp-json\/wp\/v2\/media?parent=3127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nettigritty.com\/kb\/wp-json\/wp\/v2\/categories?post=3127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nettigritty.com\/kb\/wp-json\/wp\/v2\/tags?post=3127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}