It looks like Heroku themselves have a fork that they are maintaining with updated instructions for running on Heroku. I haven't tried it yet, but there is a discussion about it on Discourse Meta
I'm finding it much more difficult to maintain my discourse instance on heroku than I'd anticipated, and as a result, it hasn't been getting much attention. As I understand, per sam from discourse, discourse on heroku should be working straight out of discourse's main repo without a need for my (outdated) fork. If anyone has tried, please let me know and I'll just start directing people back there, since this repo is getting a lot more traffic than I expected ;)
Last updated for version 0.8.5
If you follow this guide, you should be able to run fully-functional Discourse on Heroku for free (up to a point)
git clone git://github.com/swrobel/discourse-heroku.git discourse
heroku apps:create [YOUR_APP_NAME]
heroku addons:add heroku-postgresql:dev --version=9.2
might as well use Postgres 9.2 although discourse will work with 9.1, which is Heroku's default at time of writing
heroku addons:add mandrill:starter rediscloud:20 memcachier:dev scheduler newrelic:standard
mandrill is for email delivery, although the free mailgun or sendgrid plans will work as well (just update the appropriate config vars). memcachier is for rails cache storage.
heroku labs:enable user-env-compile
This will enable asset precompilation to complete successfully.
The first time this is uploaded to heroku - asset precompilation will fail because there is no database setup.
--INSERT INSTRUCTIONS FOR FORCING RELOAD ON HEROKU-- (to be done after rake db:migrate is run)
rake secret
- copy the output
heroku config:add SECRET_TOKEN=<paste here>
- copy your API key from your Heroku account
heroku config:add HEROKU_API_KEY=<paste here>
heroku config:add SMTP_SERVER=smtp.mandrillapp.com SMTP_PORT=587 HEROKU_APP=<heroku_app_name>
heroku config:add RUBY_GC_MALLOC_LIMIT=90000000
(per Discourse team's recommendation)heroku config:add MANDRILL_USERNAME=<your mandrill email>
heroku config:add MANDRILL_APIKEY=<your mandrill api key>
git push heroku master
heroku run rake db:migrate
heroku run rake db:seed_fu
heroku addons:open scheduler
Set up the scheduled tasks as follows:
TASK | FREQUENCY
--------------------------------------------
rake enqueue_digest_emails | Daily
rake category_stats | Daily
rake periodical_updates | Every 10 minutes
rake version_check | Daily
You must create an original admin user. To do this, first create a user account using the web-gui. An activation email will be sent to your inbox. You may need to copy the activation link address and replace the domain portion of it with your apps domain name (HEROKU_APP_NAME.herokuapp.com)
Next run heroku run console
user = User.first
user.admin = true
user.moderator = true (this is optional)
user.save
Confirmation emails sent from your application will refer to an EC2 instance for the host name by default, which won't work.
To fix this, enter the admin section by visiting /admin. You may need to create an account and set its admin flag to be true.
Next, click 'Site Settings', and enter your-app-name.herokuapp.com
in the force_hostname
field.
This is the one non-free area. You can get S3 storage for free if you fall under the free tier for 12 months, but you may have to pay for S3 storage. This should be fairly cheap anyway, all things considered. Run the following:
heroku config:add AWS_ACCESS_KEY_ID=<your_access_key> AWS_SECRET_ACCESS_KEY=<your_secret_key>
navigate to http://<your-app>.herokuapp.com/admin/site_settings
- Check the box for
enable_s3_uploads
- Paste your bucket into
s3_upload_bucket
I will try to roughly update this repo every 2 weeks, or when there's a new Discourse point release (although at this point versioning is pretty arbitrary). I'm rebasing rather than merging to maintain a clean tree, so you're going to have to force-pull and force-push to heroku.
git pull --force
git push --force heroku master