Easy Guide to Install Node.js on Hosted Server
Most of hosting companies are not allowed to access for installing npm and node.js on hosted server.
1]:- The first thing to do is to install NVM on your server, for installing npm, you need to SSH access from your terminal (Command line).
Using your terminal run the following command line to access your server using SSH
When it asks for your cpanel password, Login to your cPanel normally to enter the password. The first step will be done with this.
2:- Once you’re logged in, now you are on your hosting server, but you don’t have access to your root.
From your /home folder, follow the instructions (Just copy/paste code line by line):
curl https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.gz | tar xz
mv node-v10.16.3-linux-x64/ nodejs
cp nodejs/bin/node ~/bin
ln -s ../nodejs/lib/node_modules/npm/bin/npm-cli.js npm
3:- Use the following two command lines to check the version of Node js and npm. If you want to check that everything installed properly working or not, run below commands line.
We have explained in the above step to install node.js on hosted server. When you try to install node js on cpanel latest version, we’ll get the following error.
yatko@sg [~/bin]# node –version
node: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.10′ not found (required by node)
node: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.3′ not found (required by node)
node: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9′ not found (required by node)
node: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11′ not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.7′ not found (required by node)
To install node.js on hosted server, you can use the latest version of node js it easy for installation without error. To avoid getting the above error and able to use install node js and npm on hosting server
4:- Installation of nvm on server
Navigate to the NVM treasury and get the latest version out there. Copy/paste below command line to add NVM install and run this first
If successful run, Now you need to load NVM by arising the below command:
Finally installing Node JS is done by running nvm install
nvm install stable
How to Choose Node.js Hosting?
You want to install node js on hosting server, then there will be to select the right web hosting service provider that offers to install and run node js application on the server.
There are a number of hosting providers available in the world but most of the web hosting service provider is able to install node js in vps hosting and npm on hosting server.
We listed some features that help you choose the right linux shared hosting companies to install node.js on cpanel application.
- Support Languages and Frameworks
- Help Center
- Limit of the Host application
- Check automatically hosting scalability.
- System Administration by Red Hat
- Subdomains on rhcloud.com
- Limit of the Host application
- Shared SSL on rhcloud.com
- Custom Domains
- Documentation & Guides
- Developer Community
Hopefully, this information is helpful to choose the right Node.js hosting service provider and that can install node.js on shared hosting server.