Several tools will be needed. Run the following command:
apt-get install make g++ libssl-dev gitIt is recommended to download the source from the node.js website. The git repository source may not be stable, considering it receives changes after the latest mainstream version. To download it from the website, run these commands:
cd /tmp
wget http://nodejs.org/dist/v0.10.32/node-v0.10.32.tar.gz
tar -xvf node-v0.10.32.tar.gz
cd node-v0.10.32If you really must use the unstable mainstream version, run the following command:
git clone https://github.com/joyent/node
cd nodeUpon success, you can proceed to the next step.
Depending on your server, you may want to replace X it with the number of CPUs in your server. If your VPS has 2 virtual CPUs, you would replace X them with 2. This will help speed up the building process.
./configure
make -jXIf everything was successful, you can now run the following command to install Node.js onto your system:
make installOnce it is installed, run node -v and check the version output. If a version is displayed similar to v0.10.32 (the version will vary), Then you have successfully installed Node.js. Congratulations.