Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why node.js can't run on shared hosting? [closed]

First thing: I searched all of the known web hosting companies for shared hosting of nodejs but I didn't find anyone. Then I came to know that nodejs cannot run on a shared host system. I want to know why?

Second thing: I am a normal guy with a normal budget. Choosing a vps or deicated server or cloud hosting makes the node run, but its out of my pocket money range as compared to the PHP shared hosting services, so should I learn node.js?

like image 780
Yousuf Memon Avatar asked Jul 08 '13 14:07

Yousuf Memon


People also ask

Can I use nodeJS on shared hosting?

You can run node. js server on a typical shared hosting with Linux, Apache and PHP (LAMP).

Does Godaddy shared hosting support nodeJS?

Yes, I have Shared hosting on Godaddy. Is their any tips i can run node.

How do I permanently run node js server?

js application locally after closing the terminal or Application, to run the nodeJS application permanently. We use NPM modules such as forever or PM2 to ensure that a given script runs continuously. NPM is a Default Package manager for Node.

Is node js free for commercial use?

Once a team downloads and modifies Node. js, they have the freedom to copyright their version of the software at any time and apply a more restrictive license on their own work. The majority of Node. js projects remain open source and enterprises use it for frameworks, libraries, and tools.


1 Answers

Theoretically it can, but practically it depends on hosting provider to have such infrastructure in place.

Node comparing to classic web platforms is self-sustainable platform. In case with PHP (for example), it runs on with of apache or nginx (or any other), and PHP it self is just script language with some libraries that does not do much apart of logic implementation, and requires web server solution. Web server creates socket to listen specific ports for traffic, will do its own magic and will execute PHP to process requests.

In meantime node.js creates own socket, and binds it to own port. That gives it much more low-level access, so it is web server it self. You can't bind to one port two applications, so it already unsharable.
There are services (web servers) that allow you to create proxy to route traffic to your node.js process but that is not as efficient in some cases, and shared hosting does not provide such functionality.

As node.js is still fairly young as well as is well, different, it still did not hit majority of shared hosting services. There are some available services online to host your node.js applications in a 'shared' manner.

Additionally you can rent EC2 Micro instance on AWS for free (Free Tier) for one year, which gives you plenty possibilities and time to try and test different stuff. You'll get semi-dedicated system, where you can do pretty much anything (install software, modify OS configurations, and much more), where shared hosting would not allow you to do so.

like image 144
moka Avatar answered Sep 25 '22 07:09

moka