Nov 15

Ubuntu 11.10 Node.js Heroku PG Install

Git + Heroku + Node.js + PostgreSQL + Ruby + Serious + Ubuntu

This post is more a personal memoir than a tutorial designed for public consumption but this worked for me installing a virtual machine from scratch on VirtualBox. The purpose is to develop Node.js applications that are deployed to Heroku.


Download latest Ubuntu (11.10) and run through the installer (no gotchas)



Need Ruby for Heroku.

Great post –


$ bash > >(curl -s  # Get RVM
$ source ~/.bashrc   # Reboot the shell
$ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion  # Install Libraries
$ rvm install 1.9.3  # Install ruby v1.9.3
$ rvm use 1.9.3
$ gem install rails



Need Git for Heroku as well.

$ sudo apt-get install git-core



Database of choice because Heroku uses it.
Decent post –

$ sudo apt-get install postgresql-9.1
$ sudo -u postgres createuser --superuser $USER
$ sudo -u postgres psql

Replace the $USER with username and $DATABASE with database name

postgres=# \password $USER
postgres=# createdb $DATABASE
$ psql

Excellent cheat sheet for psql commands –



Install Node.js and npm

$ sudo apt-get install nodejs
$ curl | sudo sh



Tying it all together.

$ gem install heroku
$ heroku login
$ heroku keys:add


Useful Bash_Aliases

alias hb='heroku pgbackups:capture --expire'
alias hbget='heroku pgbackups:url' # remember to add the .dump file (e.g. hbget b001)
alias hl='heroku logs --tail'
alias gp='git push'
alias ga='git add'
alias gaa='git add .'
alias gp='git push'
alias gpp='git push production'
alias gl='git log'
alias gs='git status'
alias gd='git diff'
alias gc='git commit -m'
alias gca='git commit -am'
alias gb='git branch'
alias gco='git checkout'
alias gra='git remote add'
alias grr='git remote rm'
alias gpu='git pull'
alias gcl='git clone'

Leave a comment

WTF is this?

This is my little space in which to play. I ramble about what it's like to...
· Run a 3:57 Mile | 3:39 1500m.
· Build sweet websites.
· Live in Wellington, NZ
  Charlottesville, VA
  Santa Cruz, CA
  Boulder, CO.
· be convicted of grammar crimes.
If you're intrigued...
This is what to expect.