discourse #0

Supports: xenial


Discourse is a from-scratch reboot, an attempt to reimagine what a modern Internet discussion platform should be today, in a world of ubiquitous smartphones, tablets, Facebook, and Twitter.


This charm provides a simple way to deploy a basic Discourse install with sane defaults that is able to scale horizontally.


Discourse requires a Postgres database and some form of frontend web server. It requires outbound access to rubygems.org, cache.ruby-lang.org and github.com to fetch the Discourse code itself and ruby dependencies. Outbound access to Amazon S3 is required for various components of Discourse itself to work properly, i.e. user icons and backups to S3. Outbound SMTP access on port 25 must be open to allow Discourse to send registration mail to new users, including administrators during the setup process.

Example Usage

Assuming the above requirements are met, deployment is straightforward:

juju deploy cs:discourse
juju deploy cs:apache2
juju deploy cs:postgresql
juju config discourse hostname="discourse.example.com"
juju config discourse admin-users="me@example.com"
juju add-relation discourse:website apache2:balancer
juju add-relation discourse:db postgresql:db

The apache2 charm does require some configuration to take advantage of the balancer the Discourse charm provides, at minimum it will require enabling the apache modules and a virtual host template configured for the balancer:

juju config apache2 enable_modules="headers,proxy"
juju config apache2 vhost_http_template=$(base64 -w0 ./apache2-template)

Where the file ./apache2-template contains something like this:

<VirtualHost *:80>

ServerName {{ servername }}
CustomLog /var/log/apache2/{{ servername }}-access.log combined
ErrorLog /var/log/apache2/{{ servername }}-error.log
ProxyRequests off
<Proxy *>
    Order Allow,Deny
    Allow from All

ProxyPreserveHost on
ProxyPass / balancer://discourse/
ProxyPassReverse / balancer://discourse/


This will make Discourse available via HTTP at the hostname discourse.example.com and send a registration mail to me@example.com with a link allowing that user to log in and set up the Discourse software via the web UI.


(string) Comma separated list of email addresses for admin users of Discourse.
(string) Path to the root of the ruby app.
(string) Commit hash or branch tag of the source repo to clone.
(string) A deploy key is an SSH key that is stored on the server and grants access to a repository.
(string) Hostname for your forum
(string) Proxy server to use for downloading gems/sources.
(boolean) This should be set to true to ensure that a deploy key is deployed if necessary
(string) A string that will be prepended to instance name to set the host name in nagios. So for instance the hostname would be something like: juju-myservice-0 If you're running multiple environments with the same services in them this allows you to differentiate between them.
(string) Comma separated list of nagios servicegroups for the Nagios checks.
(string) Comma separated list of git URLs for Discourse plugins.
(string) Repository to fetch Discourse codebase from
(string) Default mirror to pull Ruby from, choose one closest to your datacenter.
(string) Ruby Version to use for your application.