Installing Node.js on a Dreamhost Shared Server
Apr 09, 2010
UPDATE: It’s worth noting that Dreamhost does not allow long-running processes, so this will not work for most production deployment needs.
First, get the latest Node.js source onto your server. I keep my git downloads at ~/downloads/git.
If it doesn’t already exist, create your download directories and cd into it:
$ mkdir ~/downloads/git
$ cd ~/downloads/git
Then, pull down the latest Node.js source code from GitHub:
$ git clone git://github.com/ry/node.git
Since we’re on a Dreamhost shared server, we have to specify a personal directory for the node binaries to install to. This is because Dreamhost won’t allow us (for good reason) to install whatever we want into location which is shared by every other user on your server.
So, lets create our OWN /usr/local/bin directory:
$ mkdir ~/usr/local/bin
Now that we’ve got that, let’s get into the node Git repo and configure node to use our new custom bin directory:
$ ./configure --prefix=~/usr/local
If everything went well, make should handle the rest!
> ... a whole bunch of compilation output ...
$ make install
> ... more output ...
Now, you need to do one more thing to make node visible to your own scripts: add the new node binaries to your PATH! To do this you need to add the following line to two files in your home directory: .bashrc and .bash_profile.
export PATH=$PATH:/home/[YOUR USER NAME]/usr/local/bin
You’re almost done! Just save both of those files, close your connection, reconnect, and check if you can run node! You should get something like this:
$ node --version
Hot shit! Now go build some killer Node.js apps!