{"id":1050,"date":"2021-06-02T20:22:00","date_gmt":"2021-06-02T20:22:00","guid":{"rendered":"https:\/\/hosting-marketers.com\/news\/?p=1050"},"modified":"2022-09-23T23:13:44","modified_gmt":"2022-09-23T23:13:44","slug":"deploy-node-js-on-our-shared-servers","status":"publish","type":"post","link":"https:\/\/hosting-marketers.com\/news\/2021\/06\/02\/deploy-node-js-on-our-shared-servers\/","title":{"rendered":"Deploy Node.js on our shared servers"},"content":{"rendered":"\n[et_pb_section][et_pb_row][et_pb_column type=&#8221;4_4&#8243;][et_pb_text]<!-- divi:heading {\"level\":4} -->\n<h4><strong>Version Control with Git<\/strong><\/h4>\n<!-- \/divi:heading -->\n\n<!-- divi:paragraph -->\n<p>Before we can&nbsp;configure 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 clone the repository onto your server and deploy from there. Either method meets the requirement to get the application onto the server. In this example, we\u00e2\u20ac\u2122ll be using cPanel\u00e2\u20ac\u2122s native Git support to clone the application onto your server and then deploy it.<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:paragraph -->\n<p>Within the cPanel user account that you\u00e2\u20ac\u2122d like to host the application on, under the \u00e2\u20ac\u0153<strong>Files<\/strong>\u00e2\u20ac\u009d tab, select the \u00e2\u20ac\u0153<strong>Git<\/strong>&nbsp;<strong>Version<\/strong>&nbsp;<strong>Control<\/strong>\u00e2\u20ac\u009d option. This will bring you to a page where you can create a Git repository. In this example, we\u00e2\u20ac\u2122ll be using the&nbsp;<a href=\"https:\/\/github.com\/socketio\/chat-example\" target=\"_blank\" rel=\"noreferrer noopener\">chat example&nbsp;<\/a>repository to deploy a simple chat application.<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:paragraph -->\n<p>To keep your application data secure be sure not to clone or upload into the<strong>&nbsp;public_html<\/strong>&nbsp;folder since this makes the code itself potentially accessible from the web. CloudLinux strives to keep your data safe, and during deployment, it\u00e2\u20ac\u2122s not a requirement that your application data be publicly accessible.<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:paragraph -->\n<p>Here\u00e2\u20ac\u2122s an example of the Git page, before the clone is completed.<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:image {\"id\":21812} -->\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/res.cloudinary.com\/lwgatsby\/f_auto\/www\/uploads\/2019\/02\/Git-Repo-create.png?w=640&#038;ssl=1\" alt=\"git clone example\" class=\"wp-image-21812\"\/><\/figure>\n<!-- \/divi:image -->\n\n<!-- divi:paragraph -->\n<p>Once you click on \u00e2\u20ac\u0153<strong>Create<\/strong>\u00e2\u20ac\u009d this will bring you back to the repository page showing the full path of the application being deployed. This page is important, so save that path for later.<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:heading {\"level\":4} -->\n<h4><strong>Application Configuration<\/strong><\/h4>\n<!-- \/divi:heading -->\n\n<!-- divi:paragraph -->\n<p>With the application files in place on the server, we are ready to configure Node.js to launch that application from the web. &nbsp;From cPanel on the same account under the \u00e2\u20ac\u0153<strong>Software<\/strong>\u00e2\u20ac\u009d tab, select&nbsp;<strong>\u00e2\u20ac\u0153Setup<\/strong>&nbsp;<strong>Node.js<\/strong>&nbsp;<strong>App<\/strong>\u00e2\u20ac\u009d. On this setup screen, you\u00e2\u20ac\u2122ll select \u00e2\u20ac\u0153<strong>Create<\/strong>&nbsp;<strong>Application<\/strong>\u00e2\u20ac\u009d to bring up the options for choosing the Node.js version as well as whether to use a&nbsp;<strong>Development<\/strong>&nbsp;or&nbsp;<strong>Production<\/strong>&nbsp;environment.Notes on Choosing Development vs. Production:<strong>Development<\/strong>&nbsp;generally has different application hooks in the code of the application, depending on how this environment variable is set. As a general rule,&nbsp;<strong>Production<\/strong>&nbsp;is going to have more levels of caching, as well as minimal logging. So, for a Development environment set, you can expect the inverse, with fewer levels of application caching, and more verbose logging and error message output.<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:paragraph -->\n<p>Example: In production, you may only see an error page, but in development, you may see a full stack trace on an application error, letting you know exactly where the error took place inside the code.<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:paragraph -->\n<p>Here\u00e2\u20ac\u2122s an example of an application that\u00e2\u20ac\u2122s ready to be saved:<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:image {\"id\":21813} -->\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/res.cloudinary.com\/lwgatsby\/f_auto\/www\/uploads\/2019\/02\/App-setup.png?w=640&#038;ssl=1\" alt=\"create node.js application\" class=\"wp-image-21813\"\/><\/figure>\n<!-- \/divi:image -->\n\n<!-- divi:paragraph -->\n<p>Node.js applications, in general, depend on several environment variables. These can be added by using the \u00e2\u20ac\u0153<strong>Add<\/strong>&nbsp;<strong>Variable<\/strong>\u00e2\u20ac\u009d button near the bottom right of the page. Your Node.js production or development variable is already set separately in the top section using the \u00e2\u20ac\u0153<strong>Application<\/strong>&nbsp;<strong>Mode<\/strong>\u00e2\u20ac\u009d, so it is not necessary to set it again in the Environment variables section.<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:paragraph -->\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. This might be<strong>&nbsp;index.js<\/strong>,&nbsp;<strong>app.js<\/strong>&nbsp;or any number of variations; it depends on the application.<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:paragraph -->\n<p>Once you\u00e2\u20ac\u2122ve saved your application, you\u00e2\u20ac\u2122ll need to resolve its package dependencies. &nbsp;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\u02dc<strong>NPM<\/strong>&nbsp;<strong>Install<\/strong>\u00e2\u20ac\u009d button. &nbsp;(This step will require your domain to resolve to an IP address, or the installation script will have an error) . NPM will read the contents of the package.json file and install the needed packages into a virtual environment specific to the application.<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:paragraph -->\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\u0153<strong>npm<\/strong>\u00e2\u20ac\u009d and \u00e2\u20ac\u0153<strong>node<\/strong>\u00e2\u20ac\u009d commands to make additional changes manually, allowing for a great deal of customization:&nbsp;<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:image {\"id\":21814} -->\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/res.cloudinary.com\/lwgatsby\/f_auto\/www\/uploads\/2019\/02\/enter.virtual.environment.png?w=640&#038;ssl=1\" alt=\"enter virtual environment command\" class=\"wp-image-21814\"\/><\/figure>\n<!-- \/divi:image -->\n\n<!-- divi:heading {\"level\":4} -->\n<h4><strong>Application Deployment<\/strong><\/h4>\n<!-- \/divi:heading -->\n\n<!-- divi:paragraph -->\n<p>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! CloudLinux makes this effortless: on the same page where you configured your application, click \u00e2\u20ac\u0153<strong>Run<\/strong>&nbsp;<strong>JS<\/strong>&nbsp;<strong>Script<\/strong>\u00e2\u20ac\u009d. This will execute the application startup file that you defined earlier during setup. As Node.js applications have several options, this can bring up another menu with different options to select depending on the application that you\u00e2\u20ac\u2122re running. In general, you\u00e2\u20ac\u2122ll want to select the \u00e2\u20ac\u0153<strong>Start<\/strong>\u00e2\u20ac\u009d option next.&nbsp;Finally, you can select the \u00e2\u20ac\u0153<strong>Open<\/strong>\u00e2\u20ac\u009d option to visit your page, and see your application!<\/p>\n<!-- \/divi:paragraph -->\n\n<!-- divi:paragraph -->\n<p>CloudLinux\u00e2\u20ac\u2122s Node.js Selector has many advantages over manual deployment. &nbsp;It allows for several applications to be run under the same user, accessed under the \u00e2\u20ac\u0153<strong>Setup<\/strong>&nbsp;<strong>Node.js App<\/strong>\u00e2\u20ac\u009d page in your cPanel account. Phusion passenger is used for application handoffs, so you won\u00e2\u20ac\u2122t need to set up any .htaccess redirects to tell the web server to forward to the applications port. &nbsp;With Node.js Selector this is all handled for you.<\/p>\n<!-- \/divi:paragraph -->[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p><!-- 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_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_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},"jetpack_post_was_ever_published":false},"categories":[2],"tags":[],"class_list":["post-1050","post","type-post","status-publish","format-standard","hentry","category-hosting-marketers-news"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p9Yxzd-gW","jetpack-related-posts":[{"id":801,"url":"https:\/\/hosting-marketers.com\/news\/2019\/07\/05\/how-to-deploy-an-app-nodejs-through-cpanel\/","url_meta":{"origin":1050,"position":0},"title":"how to deploy an APP NodeJS Through cPanel","author":"Admin","date":"July 5, 2019","format":false,"excerpt":"how to setup or deploy an app on nodejs with our cpanel","rel":"","context":"In &quot;deploy app nodejs cpanel&quot;","block_context":{"text":"deploy app nodejs cpanel","link":"https:\/\/hosting-marketers.com\/news\/category\/deploy-app-nodejs-cpanel\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/node2.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/node2.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/07\/node2.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1141,"url":"https:\/\/hosting-marketers.com\/news\/2022\/08\/27\/node-js-creating-an-application-on-our-cpanel-application-manager\/","url_meta":{"origin":1050,"position":1},"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":539,"url":"https:\/\/hosting-marketers.com\/news\/2015\/09\/01\/node-js-some-information\/","url_meta":{"origin":1050,"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":107,"url":"https:\/\/hosting-marketers.com\/news\/2009\/09\/07\/dns-issue\/","url_meta":{"origin":1050,"position":3},"title":"Why it takes so long to see my site using the domain? Is it a DNS propagation issue?","author":"Admin","date":"September 7, 2009","format":false,"excerpt":"You've registered your domain name, paid for hosting with a web hosting company, and started uploading your site to the server. If this is all done, why can't you see your site when you browse to your domain? What is this DNS propagation people keep telling you about? In order\u2026","rel":"","context":"In &quot;DNS propagation&quot;","block_context":{"text":"DNS propagation","link":"https:\/\/hosting-marketers.com\/news\/category\/dns-propagation\/"},"img":{"alt_text":"dns propagation","src":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2009\/09\/CMD03-300x176.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":112,"url":"https:\/\/hosting-marketers.com\/news\/2009\/09\/22\/red5-tutorial-and-red5-hosting\/","url_meta":{"origin":1050,"position":4},"title":"Red5 Tutorial and Red5 Hosting","author":"Admin","date":"September 22, 2009","format":false,"excerpt":"Red 5 is a pretty amazing server software written in java. The Red 5 development team has put in tons of effort to make it a open source alternative to Adobe FMS ? Flash Media Server. Red 5 is a perfectly suitable technology for ?Video On Demand? applications, streaming, publishing,\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":1050,"position":5},"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":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/1050","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=1050"}],"version-history":[{"count":4,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/1050\/revisions"}],"predecessor-version":[{"id":1159,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/1050\/revisions\/1159"}],"wp:attachment":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/media?parent=1050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/categories?post=1050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/tags?post=1050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}