Why can you not host node on a shared server?

Bruce Gust
Bruce Gust used Ask the Experts™
on
What is it about Node that makes it difficult if not impossible to host on a shared server?

I'm assuming it's because you have to be able to log directly into the server using SSH, but why? What is it about Node that requires that kind of approach?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi,

I read some article that said that is possible but when I read on the hosting web company faq it's not possible...
(Maybe earlier version can be installed)

Now it require cloud VPS or a dedicated server with root access  https://www.siteground.com/kb/node-js-available/
for example with Siteground https://www.siteground.com/node.js-hosting.htm

You better contact your hosting company and ask them.

Here is a list of popular plateforms
https://geekflare.com/nodejs-hosting-platform/
Bruce GustPHP Developer

Author

Commented:
Hello, lenamtl!

Thanks for the input!

I'm not as concerned about which servers can accommodate Node or what sort of chutes and ladders you need to jump through in order to make it happen. I wanted to know what it is about Node that makes it a challenge.

Why is Node something that can't be loaded up on to a server like you would a JQuery library and be done? What is it about Node that makes it distinctive in that way?
Hi,

Theoretically it can but in fact it depends on hosting provider.
See a2hosting they have a plans (to set node from Cpanel) https://www.a2hosting.com/nodejs-hosting
( I have never use their service, it is just an example that show it is possible)

Some articles suggest some way to do it , I have not tried these methods so I don't know if this is really possible ...
http://blog.codoplex.com/how-to-deploy-nodejs-app-in-godaddy-shared-hosting/
https://medium.com/@mayomi1/how-to-host-a-node-js-app-on-shared-host-52e12a62a259

I would ask the hosting company they may have a way for you to install and use it
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Bruce GustPHP Developer

Author

Commented:
Again, lenamtl, I'm not asking if I "can" or "how..."

I'm asking what is it about Node that makes it distinct from any other JavaScript library that you can't simply upload a library and be able to run Node. Why do you need access to the server?
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
Hey Bruce,

In a nutshell, Node is a "full runtime environment", and in order to use it, you must set it up (install it) on the server. It then creates a server-side environment that your Node applications run in (in very basic terms, think about it like a server - it sits on the remote system, serving your applications when needed. Alternatively, think about it like a mini operating system running on a remote computer). It's not just a simple library - it's a full environment so you can't just upload a file.

jQuery is a just client-side library (a convenience-wrapper around standard Javascript) that you load up as part of your webpage. You can the call those functions within your page.

The difficulties in setting it up on a shared-hosting platform are generally just down to what you do and don't have access to. If you are allowed to SSH in (many don't allow that), then you'll probably find yourself in a chroot jail with limited access to functionality.

Simplified answer : Node.JS is a server-side environment, jQuery is a client-side library :)
leakim971Multitechnician
Top Expert 2014

Commented:
what about hosting your application on heroku :
https://devcenter.heroku.com/articles/getting-started-with-nodejs
Hi,

@Bruce, sorry I thought that you knew that Node is server side
I know this can be confusing because it is called Javascript runtime...
Bruce GustPHP Developer

Author

Commented:
I'm explaining this back to you using your explanations and terms that I'm grabbing from the internet.

First off, the term "runtime" refers to what's happening when a program is being executed. Interpreted code is going to spit out a result at runtime.

Compiled code at runtime, on the other hand,  is going to first create a program written in assembly language which then produces your result. In other words, there's a layer of "construction" going on in compiled code - a program is being built. And it's from that program that you're going to get whatever action or data you're shooting for.

With Node, you have "compiled code," yet. But more than just that, it's full runtime enviornment. It's like a mini operating system in and of itself. It's not just a library and that's why when you're trying to run a Node.js app on your server, you have to first install that "mini operating system" on your server and that's going to sometime necessitate access that's not always available on a shared hosting environment.

Is that correct?
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
Hey Bruce,

Yeah - that's a pretty good grasp of the high-level systems.

The runtime environment is a collection of systems that are needed for a program to execute. This may include environment settings, folder
structures, other programs, files, libraries etc. In order for a program to run, it needs the correct runtime environment. Node.Js is a runtime environment that allows your app to run. This environment is setup on the server and may need access to programs, settings, files etc that a shared hosting provider just doesn't give you.

With an interpreted language such as PHP, there is no compilation. Your script is passed off to an interpreter at runtime, which then tells the computer what to do.

With a compiled language, the source code is run through a compiler (the build process) and this generates a machine readable program that tells the computer what to do at runtime (when it's executed).

With Node.Js, the code is actually compiled at runtime by the V8 Javascript Engine (which is installed as part of the runtime environment setup on the server).
Bruce GustPHP Developer

Author

Commented:
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial