Install latest version of node to use without sudo

Explains the steps I followed to install node from source on Ubuntu server.

This is just kept as a reference, jump to the resources to get the link to a more detailed article.

Ensure we can build/curl

// Update package manager
sudo apt-get update

// Install compiler
sudo apt-get install build-essential

// Get curl
sudo apt-get install curl

Install node and npm

// Add ~/local/bin to your path
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

// Create two new directories
mkdir ~/local ~/node-latest-install

// Download and untar nodejs in latest install folder
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1

// Start installation limited to local user
./configure --prefix=~/local
make install

// Download npm
curl https://npmjs.org/install.sh | sh

Resouces