In this article, I will show you how to install node.js
on shared hosting
if you just purchased new shared hosting and there is not node.js installed.
Don't worry in this step-by-step guide you will learn to install node.js
with SSH
without sudo
or root
access.
I am a Windows user, for connecting to the server via SSH
i will use putty software that's free and easy to use.
I assume that you have already installed putty
if not just google you will see lots of tutorials on How to install putty on windows.
How to use putty?
search putty in your window's search bar and click on putty
to execute.
You will see the following screen
Enter the following values in putty for connecting to the server
1.Enter Your Server/cPanel IP Address in * hostname (or IP address field*
- By Default
Port 22
is used if you have not default case you You Can Find Your Port Number in Server Details - Click on
Open Button
if everything is correct you will see a black screen asking forLogin as
enter your username here make sure to enter correct user nameEnter password
Enter the correct password for username. *password will not be visible just type your password and hit enter If You Enter the Correct cPanel Username and Password then you will see the next screen with your username.
Now you are connected to Server successfully let's install node.js on shared hosting
Run the following command to download node.js you can download any version of node.js
by changing the to a specific version. i am downloading v8.10.0
wget https://nodejs.org/dist/v8.10.0/node-v8.10.0-linux-x64.tar.gz
Now we have downloaded node.js
on our server let's Extract Node JS Files by using the following command
tar xvzf node-v8.10.0-linux-x64.tar.gz
Let's rename the folder to nodejs
mv node-v8.10.0-linux-x64 nodejs
Let's install Node.js
and npm
type the following commands
one by one
mkdir ~/bin
-
cp nodejs/bin/node ~/bin
cd ~/bin
-
ln -s ../nodejs/lib/node_modules/npm/bin/npm-cli.js npm
#That's it. Node.js and npm installed on your hosting you can verify that by runningnode -v
if yo seenode.js
version it's mean you have successfully installed node.js on shared/vps hosting.
Thanks for reading :-) can you write your thoughts? and help me to improve my content by your valued suggestions? or if you have any querry please comment bellow.
Top comments (1)
Great and easy can we do same with the latest version or we should stay with V8 only ?