showing results for - "how to host node js application on godaddy"
Valerio
20 Jun 2016
1Yes this is possible. Somehow I have never seen anyone actually answer this question correctly. This works with the most basic shared hosting plans. I have successfully been able to set it up a couple different ways. I think the second is probably what you want :
2
31. cgi-node http://www.cgi-node.org/home
4
5Basically this replaces PHP on the lamp stack. You can run javascript through node like you would run PHP. This has all the same functionality of node js but is only really geared towards template rendering.
6
7    <html>
8    <body>
9     <?
10       var helloWorld = 'Hello World!'; 
11       write(helloWorld + '<br/>'); 
12     ?>
13     <?= helloWorld ?>
14    <br/>
15    <b>I can count to 10: </b>
16
17    <?
18      for (var index= 0; index <= 10; index++) write(index + ' ');  
19    ?>
20      <br/>
21      <b>Or even this: </b>
22    <?  
23      for (var index= 0; index <= 10; index++) { 
24    ?>
25        <?= index ?> 
26    <? } ?>
27
28    </body>
29</html>
30OR
31
322. Standalone Server (this works with NameCheap hosting and GoDaddy shared hosting)
33
34In your shared hosting account you will need SSH in order to do this. So you may need to upgrade or request SSH access from their customer support. Download the latest NodeJS https://nodejs.org/en/download/. The shared hosting is probably in linux 64 bit. You can check this on linux or unix by running :
35
36uname -a
37Download the Linux binaries and put the bin/node (and the bin/npm file if you want to use npm on the server) file from the download in /home/username/bin/ (create the bin folder if it doesn't exist) on the server. Put permissions 755 on the node binary. So you should have a new file here :
38
39/home/username/bin/node
40
41Open up the .htaccess file in /home/username/public_html and add the following lines :
42
43RewriteEngine on
44RewriteRule  (.*)  http://localhost:3000/$1  [P,L] 
45Create a file in /home/username/public_html and just call it app.js. Add the following lines in that file :
46
47const http = require('http');
48
49const hostname = '127.0.0.1';
50const port = 3000;
51
52const server = http.createServer((req, res) => {
53  res.statusCode = 200;
54  res.setHeader('Content-Type', 'text/plain');
55  res.end('NodeJS server running on Shared Hosting\n');
56});
57
58server.listen(port, hostname, () => {
59  console.log(`Server running at http://${hostname}:${port}/`);
60});
61SSH into the server run these commands :
62
63cd /home/username/public_html
64which node # this should return ~/bin/node
65node app.js & # This will create a background process with the server running
66If you can get this set up right this will save you a ton of money in the long run as opposed to using something like AWS or Heroku etc.
queries leading to this page
install node js on godaddy serverdoes godaddy hosting support nodejssetup node js server on godaddyhow to run node project in godaddy servergodaddy nodejs setuphow to upload node js project on godaddy hostingcan i host node js app in godaddy shared hostingdo node packages on work on godaddynode js express application deploy on godaddy servergodaddy node js hostingnodejs app godaddybuilding a node js application on godaddyhow to deploy node js application on godaddy serverhow to host nodejs app godaddynode app in godaddycreating a website using node js on godaddycan we host node js application on godaddyhow to upload you nodejs server to godaddynode js in godaddy servergodaddy free hostinggodaddy run node jsinstalling node js on godaddy shared hostinginstalling node on godaddy hostingnode js app deploy in godaddygodaddy to node serverkeeping a node js program running on godaddyhow to host node js application on godaddy webhostingcan we upload nodejs project on godaddy hostinghost node js app on godaddyupload nodejs app to godaddyrun nodejs godaddyhow to run a nodejs script in godaddy serverdoes godaddy host websites node jshost node js application in godady serverhow to host your javascript on godaddygodaddy nodejshello world nodejs app for godaddy hostinghow to install node js on godaddy servergodaddy node hostinghow to run node js on godaddy servercan you host node js website on godaddycan i deploy nodejs webiste at godady hostingdeploy nodejs application to godaddy serverhosting your nodejs server in godaddy from scratchcan godaddy host node jshow to host your nodejs server on godaddynode js deploy in godaddyhost node js on godaddy apigodaddy vps node jsgodaddy deploy nodejs applicationhow to deploy a node js app on a godaddy vps servernode js hosting godaddygodaddy node serverdoes godaddy support node jsinstall node js godaddynode js in godaddynodejs on godaddy hostsetting up nodejs on godaddy serverrun node js on godaddynodejs app on godaddysetup a node js server on go godaddy domaingodaddy how to install nodejsgodaddy node jsnode js godaddy shared hostinginstall nodejs on godaddyhost node js on godaddyhow to upload nodejs files on go godaddy hostinghosting node js app on godaddy sharedhow to deploy node in godaddy serverhow to host node js application on godaddyhow to host a website on godaddycan you use node js with godaddytransfer domain godaddy to godaddydeploy node js app on godaddyhow to host node js application on godaddy