We launched a Discourse forum for the Inventables Community last month. It is a real hit with our customers and is quickly gaining popularity. The best part about Discourse (at least for developers) is that it is open source and built on a familiar stack of technologies (Rails, Postgres, Redis). So let’s start hacking on it!

Setting it up locally wasn’t as straightforward as I thought it would be. There are several different guides up, and it is not clear exactly which one you should use for production vs. development. After a few hours of trying to get it set up directly on my Mac (bad idea), I tried the guide to set it up on Vagrant.

Vagrant works together with VirtualBox to create a simple way to provision a development environment in code. You create a Vagrantfile that specifies exactly what your environment needs.

First, install VirtualBox and install Vagrant.

Then a few commands to get it started:

git clone <DISCOURSE_REPO>
cd discourse

# setup vagrant discourse box
# this may take some time (a few minutes?)
vagrant up

# enter vagrant box
vagrant ssh

bundle install
bundle exec rake db:migrate

# start the server
bundle exec rails s
# now discourse is accessible at localhost:4000


The Vagrantfile source shows why:
...