How to Deploy Discourse with Juju

by Pavel PachkovskijSeptember 2, 2013
This guide walks through the process of deployment Discourse with Juju and Rack charm.

Discourse is an open-source, next-generation discussion platform built for the next decade of the Internet. Juju is a service orchestration management tool developed by Canonical. This guide requires a configured and successfully bootstrapped Juju environment. Please walk through getting started with Juju guide if you are not familiar with the tool yet.

 

Configure Discourse

Firstly, you have to fork Discourse and prepare it for deployment with Juju. For this purpose, add config/redis.yml like shown below.

Copy config/environments/production.rb.sample to config/environments/production.rb.

Add new files to Git.

Update your repository.

Now, Discourse is ready for the deployment with JuJu.

 

Configure Juju

Create Rack charm config using discourse.yml as shown below.

Important: Discourse requires SECRET_TOKEN to be defined for sessions storage.

The Juju graphical user interface (Image credit)

More configuration and deployment options are available on the Rack charm page.

 

Deployment

Deploy Discourse with Rack charm.

Deploy and relate Redis.

Deploy and relate PostgreSQL.

Generally, you should use the db relation for PostgreSQL, but Discourse creates the hstore extension in migrations, that’s why you have to use db-admin instead.

Finally, expose Discourse.

Use juju status or juju debug-log to watch for deployment progress.

When Discourse is deployed, create, migrate, and seed the database.

Compile assets.

Restart Discourse.

Navigate to Discourse and create your account. When you are done, promote your account to admin in the Rails console.

Now, you can configure Discourse from the /admin console. To learn more details about getting started with Discourse, check out this guide.

 

Further reading

 

About the author

Pavel Pachkovskij has experience in front- and back-end development of web applications. He is proficient in Ruby, Ruby on Rails, JavaScript, CSS, etc. Pavel also worked with relational databases, such as MySQL, MariaDB, PostgreSQL, as well as NoSQL solutions, such as MongoDB and Redis. Find him on GitHub.