Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a spare Ubuntu machine lying around and I would like to install Discourse on it.

How do I do this? I'm running Ubuntu 13.04.

share|improve this question
1  
The instructions assume you need vagrant to install Ubuntu, and are apparently geared towards people mainly using Windows or Mac and who would benefit from a separate VM to install and play with discourse. If Seth has an "ubuntu machine lying around" with 13.04 already installed, he can just clone the git repo and set it up locally. –  roadmr Jun 4 '13 at 20:28
    
Also, it's useful for us to have instructions pertaining to Ubuntu directly on this site. Hopefully given by someone who has done this. –  Seth Jun 4 '13 at 20:31
    
Setting things up locally and manually is documented here: github.com/discourse/discourse/blob/master/docs/…. However it does seem a bit complex, the vagrant VM has all the needed services (pgsql, redis) already preconfigured so may be easier to get started with. –  roadmr Jun 4 '13 at 20:48
    
@chaskes it's not strictly required, as described in my second comment you can install and configure the needed services manually. It does look like using Vagrant is easier. –  roadmr Jun 4 '13 at 20:53
add comment

6 Answers

up vote 6 down vote accepted

The instructions assume you need vagrant to install Ubuntu, and are apparently geared towards people mainly using Windows or Mac and who would benefit from a separate VM to install and play with discourse. If Seth has an "ubuntu machine lying around" with 13.04 already installed, he can just clone the git repo and set it up locally.

Setting things up locally and manually is documented here: https://github.com/discourse/discourse/blob/master/docs/DEVELOPER-ADVANCED.md. However it does seem a bit complex, the vagrant VM has all the needed services (pgsql, redis) already preconfigured so may be easier to get started with.

That said, if you're feeling brave, you can follow these steps to install and configure things on your local Ubuntu machine.

Disclaimer, it is a complex procedure that involves many moving parts, I tested this procedure on a freshly installed 13.04 system but if things go wrong, you should be prepared to decypher error messages and fix things. You should be comfortable with:

  • Ubuntu package installation.
  • Text file editing.
  • Having some knowledge of Postgres commandline usage.
  • Being minimally familiar with Ruby, Rails and rubygems.
  • Some git doesn't hurt, but it's only used for the initial cloning phase

OK, here goes

Install needed packages:

sudo apt-get install git ruby ruby-bundler build-essential libxml2-dev libxslt1-dev redis-server postgresql libpq-dev postgresql-contrib-9.1

Create a postgresql database and grant permissions to the user who is going to run discourse (I'll assume it's named "john", it could/should be your username):

sudo -u postgres createdb discourse_development
sudo -u postgres psql -c "create user john with password 'whatever' "
sudo -u postgres psql -c "grant all privileges on database discourse_development to john"
#This is a bit of postgresql magic to add the required hstore and pg_trgm extensions
sudo -u postgres psql discourse_development -c "create extension hstore; create extension pg_trgm"

Clone the repository:

git clone https://github.com/discourse/discourse
cd discourse

Use Bundler to install ruby gems and dependencies including rails:

bundle install

You may run into dependency problems here, as other packages may be needed to build native extensions. If you get yellow text with errors in this step, look at the error messages to figure out which packages to install (with apt-get).

Configure the database data (postgres and redis):

cp config/redis.yml.sample config/redis.yml
cp config/database.yml.sample config/database.yml
# Now edit config/database.yml and in the discourse_development section add
# username: john
# password: whatever
# Follow the format for the other entries (adapter:, database:)

Run the migrations to initialize the database, then seed it:

bundle exec rake db:migrate
bundle exec rake db:seed_fu
sudo -u postgres psql discourse_development < pg_dumps/production-image.sql

then launch the development web server:

bundle exec rails s

Finally, open your browser and connect to the local dev server at

http://localhost:3000
share|improve this answer
    
Unfortunately this didn't work for me. I got errors with all the bundle commands. They seem to be caused by changes to Discourse since you posted the directions. I may try again, and I may not.. I will let you know what happens. –  Seth Jun 10 '13 at 4:18
    
Well I purged and tried again and followed the similar instructions here: 2buntu.com/1332/installing-discourse-on-ubuntu I'm really not sure why those worked.. –  Seth Jun 10 '13 at 23:08
    
The Vagrant image is the recommended setup for development as it gets you up and running tests with minimal effort. –  MikeyB Jul 20 '13 at 23:13
add comment

Cloud deployment (with Juju)

If you have a cloud provider and want to skip a lot of manual jumping around, you can use the Juju charm!

After you've successfully bootstrapped an environment, run the following:

juju deploy cs:~marcoceppi/discourse
juju deploy postgresql

Then create relations

juju add-relation discourse postgresql:db-admin

Discourse requires db-admin level access in order to enable the hstore plugin. Finally, expose discourse:

juju expose discourse

Configuration and other caveats can be found in the Charm's README. These options include configuring admins, where to fetch the Discourse source, version pinning, and other tuning options.

Disclaimer, I am the author of this charm.

share|improve this answer
1  
I actually like this answer better than mine :) (Juju FTW). My only concern would be, you're saying "if you have a cloud provider", but the OP clearly mentions he just has a spare Ubuntu machine lying around. Could you perhaps provide, or point to, instructions on how to set up this lone machine as a juju provider? (maybe set it up as a local provider, I've done this with varying degrees of success). Then this would look like the easiest way to deploy discourse. –  roadmr Jun 5 '13 at 13:43
add comment

Bare Metal

I've just completed an article describing this exact process:

http://2buntu.com/1332/installing-discourse-on-ubuntu/

In summary, you need to:

  • Install and configure PostgreSQL
  • Install Redis and Ruby 1.9.3+
  • Clone the Discourse Git repository
  • Make the appropriate config. changes
  • Run bundle exec rails server
share|improve this answer
add comment

The project itself also has documentation on how to install on Ubuntu:

share|improve this answer
    
The linked instructions are the official recommendation for production deployments. If you have any feedback or suggestions, please do let us know! –  MikeyB Jul 20 '13 at 23:14
add comment

You can use Cloud 66 EasyDeploy: https://github.com/cloud66-samples/discourse

Cloud 66 EasyDeploy

Which means you can then deploy Discourse on AWS, DigitalOcean, Rackspace, Linode or Joyent with a couple of clicks (and get a lot more like DB backups, scaling and monitoring as well!)

DISCLAIMER: I work for Cloud 66.

share|improve this answer
1  
Could you provide some instructions for doing this within your answer? –  Seth Oct 3 '13 at 16:31
    
Is this service free of cost? –  jokerdino Oct 3 '13 at 16:54
    
All you need to do to deploy Discourse with Cloud 66, is to signup for an account at cloud66.com, and use the Git URL to build a new stack. The whole process is a wizard so should be very straight forward and you can find general Cloud 66 Stack help at help.cloud66.com/getting-started/your-first-stack.html –  Khash Oct 4 '13 at 10:34
    
You can find information about features and pricing at www.cloud66.com –  Khash Oct 4 '13 at 10:36
add comment

At Bitnami we have completely Linux installers for Discourse and Ubuntu-based virtual machines and cloud images for Amazon, Azure. You can check it out at the Bitnami Discourse page

(Disclaimer, I am one of the developers of Bitnami :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.