Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matt-mcmahon/1888722 to your computer and use it in GitHub Desktop.
Save matt-mcmahon/1888722 to your computer and use it in GitHub Desktop.
My procedure for installing node.js on ubuntu server.
# Prerequisites:
sudo apt-get install g++ make libssl-dev git-core pkg-config
# pkg-config: is needed so that configure will be able to verify that openssl is
# installed.
# curl: is handy, but not needed for node.js to work.
# Install into user-specific local bin:
mkdir ~/local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
# Download Source for Node
mkdir ~/src
cd ~/src
git clone https://github.com/nodejs/node.git
# Install Node:
cd ~/src/node
git checkout v6.3.0 #or latest stable version
./configure --prefix=~/local
make install
@matt-mcmahon
Copy link
Author

I frequently setup VMs for development, and like to have node installed for tooling, if nothing else. This gist is just a reminder of what I do to get node up and running. It's based on Isaacs' original gist, with some tweaks and additions to work on Ubuntu.

@matt-mcmahon
Copy link
Author

Discovered a couple of other "bugs" in the script after installing node as the very first thing on Ubuntu 12.04 server.

  1. make, pkg-config were not installed by default, so they were added.
  2. Added a note to checkout the latest stable version, and not just what's in the repo at the time of the pull (which isn't always stable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment