In case you have any of this package pre-installed and don’t want to run entire script, see the script and pick the packages you don’t have currently installed. The script is fine-tuned for Discourse, and includes all the packages required for Discourse installation.

Now that we have installed Discourse dependencies, let’s move on to install Discourse itself.

Clone Discourse

Setup Database

Create role with the same name as your ubuntu system username:

sudo -u postgres createuser -s techapj

In the above command, I named the role as techapj, this means that my ubuntu system username is techapj. (It is necessary for role name to be same as system username, otherwise migrations will not run)

Bootstrap Discourse

Switch to your Discourse folder:

cd ~/discourse

Install the needed gems

source ~/.bashrc
bundle install

Now that you have successfully configured database connection, run these commands:

I find it a little bit concerning that a guide for beginners seems to be resulting in an installation that isn’t passing the tests. As a beginner, I don’t know how important it is that these tests are passed or not. Normally, one might expect it to be really important, otherwise why go to the trouble of writing the test?

Hopefully someone from the team (perhaps @techAPJ as the original author) might be able to suggest edits to the page in order to overcome whatever is causing the tests to fail.

sudo apt-get -y install advancecomp gifsicle jpegoptim libjpeg-progs optipng pngcrush pngquant jhead
Reading package lists... Done
Building dependency tree
Reading state information... Done
optipng is already the newest version (0.7.6-1).
gifsicle is already the newest version (1.88-1).
jpegoptim is already the newest version (1.4.3-1).
libjpeg-progs is already the newest version (1:9b-1ubuntu1).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
jhead : Depends: libjpeg-turbo-progs but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

If I try to manually install libjpeg-turbo-progs, this is the output:

sudo apt-get install libjpeg-turbo-progs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libjpeg9
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
libjpeg-progs
The following NEW packages will be installed:
libjpeg-turbo-progs

After that, jhead does install, and I’ve installed the rest of the packages so now I’ll run the tests.

Anyone managed to overcome these problems? I have exactly same errors as @Philip_Colmer. I checked the listed paths and the needed folders don’t exist (I only have ‘optimized’ and ‘original’ folders under ‘default’):

I have followed this guide and everything was working fine except the email. When I wanted to sign up a new user, the mail didn’t appear in mailcatcher. I looked at the admin dashboard and noticed a message informing that sidekiq wasn’t running and therefore emails wouldn’t be sent. After that, I ran bundle exec sidekiq and everything worked fine.

I was wondering whether that is a required step or it happened only to me?

This tutorial was posted on discourse.sulliops.co on May 14, 2017.
When installing Discourse for development using this tutorial, the last step is to run bundle exec rails server --binding=0.0.0.0 to bootstrap the server. However, once you run this command you cannot do anything without first stopping the server using Ctl + C. But, there is a way to bootstrap the server and be able to return to a prompt (to do something else, I suppose).
Before starting this step, you should run cd to verify…

I created a tutorial on how to use Screen to allow a user to run commands after bootstrapping Discourse for development.

Hi, I’m a complete newbie at this… it took me quite awhile to work through the steps in this post, updating bundles, etc., but I finally got everything working and entered the final command (bundle exec rails server --binding=0.0.0.0). At that point I get a bunch of output, including the error “Failed to report error: Error connecting to Redis on localhost:6379”. Any ideas what I need to do to get this working?