{"id":5234,"date":"2020-07-28T02:11:19","date_gmt":"2020-07-28T02:11:19","guid":{"rendered":"https:\/\/blog.ssdnodes.com\/blog\/?p=5234"},"modified":"2025-05-18T19:38:58","modified_gmt":"2025-05-18T19:38:58","slug":"install-discourse","status":"publish","type":"post","link":"https:\/\/www.ssdnodes.com\/blog\/install-discourse\/","title":{"rendered":"How To Install Discourse On Ubuntu"},"content":{"rendered":"\n<p>In this Discourse installation guide, we're going to walk you through the process of installing Discourse \u2013\u00a0our <a href=\"https:\/\/www.ssdnodes.com\/blog\/best-forum-software\" class=\"rank-math-link\">favorite forum software<\/a> \u2013 on <a href=\"https:\/\/releases.ubuntu.com\/\" class=\"rank-math-link\" target=\"_blank\" rel=\"noopener\">Ubuntu's latest releases<\/a>.<\/p>\n\n\n<h2 class=\"wp-block-heading\"><strong>Server Requirements<\/strong><\/h2>\n\n\n<p>The minimum server requirements to install Discourse are:<\/p>\n\n\n<ul class=\"wp-block-list\"><li>10 GB of free disk space<\/li><li>Single-core CPU<\/li><li>64 bit Linux compatible with <a href=\"https:\/\/www.ssdnodes.com\/blog\/getting-started-docker-vps\/\" class=\"rank-math-link\">Docker<\/a> which you will need in order to install Discourse<\/li><li>A Ubuntu server with a minimum of 1 GB RAM\u00a0<\/li><\/ul>\n\n\n<p>We should add that even though 1 GB of RAM is the minimum technical requirement for the install, it is recommended that you host your forum on a server with at least 2 GB.  <\/p>\n\n\n<p>This is because the 1 GB minimum requirement needs a <a href=\"https:\/\/linuxize.com\/post\/how-to-add-swap-space-on-ubuntu-18-04\/\" class=\"rank-math-link\" target=\"_blank\" rel=\"noopener\">Swap file<\/a> for Discourse to work on Ubuntu 20.04 and 18.04.\u00a0<\/p>\n\n\n<p>Fortunately, if you're looking to start growing your community \u2013 we, at <strong>SSD Nodes, offer extremely affordable <a href=\"https:\/\/www.ssdnodes.com\/pricing\/\" class=\"rank-math-link\">VPS hosting perfect for Discourse<\/a>. <\/strong><\/p>\n\n\n<p>The software requirements for installing Discourse are as follows:<\/p>\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.postgresql.org\/download\/\" target=\"_blank\" rel=\"noopener\">PostgreSQL 10+<\/a><\/li><li><a href=\"https:\/\/redis.io\/download\" target=\"_blank\" rel=\"noopener\">Redis 2.6+<\/a><\/li><li><a href=\"https:\/\/www.ruby-lang.org\/en\/downloads\/\" target=\"_blank\" rel=\"noopener\">Ruby 2.5+&nbsp;<\/a><\/li><\/ul>\n\n\n<p>To proceed further with the Discourse installation, you also need to:<\/p>\n\n\n<ol class=\"wp-block-list\"><li>Install Docker<\/li><li>Register a domain name or subdomain (such as \"forum.example.com\") with an A record that points to your server's IP address.<\/li><li>An SMTP server for Discourse emails \u2013 you can check out this <a class=\"rank-math-link\" href=\"https:\/\/github.com\/discourse\/discourse\/blob\/master\/docs\/INSTALL-email.md\" target=\"_blank\" rel=\"noopener\">list of recommended email providers for Discourse<\/a>. <\/li><\/ol>\n\n\n<h2 class=\"wp-block-heading\">Step 1 \u2013\u00a0<strong>Installing Discourse<\/strong><\/h2>\n\n\n<p>Before you can actually download &amp; install Discourse, you need to create the <code>\/var\/discourse<\/code>\u00a0directory to house all Discourse-related files. This can be done using the following command: <\/p>\n\n\n<pre class=\"wp-block-preformatted\">sudo mkdir \/var\/discourse<\/pre>\n\n\n<p>And last but not least, you can now clone the official Discourse Docker image into the directory you've just created using the command below:<\/p>\n\n\n<pre class=\"wp-block-preformatted\">git clone https:\/\/github.com\/discourse\/discourse_docker.git \/var\/discourse<\/pre>\n\n\n<p>And that's it \u2013\u00a0you've successfully installed Discourse! \ud83c\udf89 <\/p>\n\n\n<p>Now it's time to set up your new forum...<\/p>\n\n\n<h2 class=\"wp-block-heading\">Step 2 \u2013\u00a0<strong>Setting Up Discourse<\/strong><\/h2>\n\n\n<p>In order to properly set up Discourse, you now need to run the following command to navigate to the directory containing your Discourse installation's files: <\/p>\n\n\n<pre class=\"wp-block-preformatted\">cd \/var\/discourse<\/pre>\n\n\n<p>And now you can launch the included setup script using the following command:<\/p>\n\n\n<pre class=\"wp-block-preformatted\">.\/discourse-setup<\/pre>\n\n\n<p>During the Discourse setup, you'll be prompted to enter the following information:<\/p>\n\n\n<ul class=\"wp-block-list\"><li><strong>Hostname for your Discourse?<\/strong><\/li><\/ul>\n\n\n<p>Here you will need to enter the hostname you've chosen for your Discourse forum \u2013\u00a0such as <code>community.example.com.<\/code> Replacing \"community\" with your preferred subdomain and \"example.com\" with your actual domain. <\/p>\n\n\n<p style=\"background-color:#fffcdf\" class=\"has-background\">If you do not wish to host Discourse on a subdomain, you can also just enter the root domain (\"example.com\") in this case.<\/p>\n\n\n<ul class=\"wp-block-list\"><li><strong>Email address for admin account?<\/strong><\/li><\/ul>\n\n\n<p>Here you insert the email address for your Discourse admin account. The email you choose to enter does not have to be related to the domain you use for discourse \u2013 you can use any address you see fit. <\/p>\n\n\n<p>It is important to note that this email address will serve as the Discourse administrator email address by default right after a user registers with it. This email address will also be required later on when you\u2019ll set up Discourse through the web control panel.<\/p>\n\n\n<ul class=\"wp-block-list\"><li><strong>SMTP Server Settings<\/strong><\/li><\/ul>\n\n\n<ol class=\"wp-block-list\"><li>SMTP Server Address<\/li><li>SMTP User Name<\/li><li>SMTP Port<\/li><li>SMTP Password<\/li><\/ol>\n\n\n<p>Here you will have to use the details of your SMTP server.\u00a0We recommend using <a href=\"https:\/\/sendgrid.com\/\" class=\"rank-math-link\" target=\"_blank\" rel=\"noopener\">SendGrid<\/a> as it works extremely well with Discourse &amp; allows you to send up to 100 emails per day for free, forever.<\/p>\n\n\n<p>Once you complete this process, a Discourse environment configuration file named <strong>app.yml <\/strong>will be automatically generated. <\/p>\n\n\n<p>If you ever need to change or edit these settings after the initial setup, you can run the following command<\/p>\n\n\n<pre class=\"wp-block-preformatted\">sudo nano \/var\/discourse\/containers\/app.yml<\/pre>\n\n\n<p>The bootstrap process itself takes only a few minutes. After it\u2019s done, your server will be prepared for launching the Discourse software. You can do it by running the following commands:<\/p>\n\n\n<pre class=\"wp-block-preformatted\">sudo .\/launcher bootstrap app<br>sudo .\/launcher start app<\/pre>\n\n\n<h2 class=\"wp-block-heading\">Step 3 \u2013\u00a0<strong>Registering Your Admin Account<\/strong><\/h2>\n\n\n<p>Now that you've completed the Discourse installation and initial setup process, you can access your forum using your browser. <\/p>\n\n\n<p>When you do, you'll see the following welcome message. <\/p>\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"500\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/welcome-to-discourse.png\" alt=\"discourse-splash-screen\" class=\"wp-image-5260\" srcset=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/welcome-to-discourse.png 657w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/welcome-to-discourse-300x228.png 300w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/figure><\/div>\n\n\n<p style=\"background-color:#fffcdf\" class=\"has-background\">If you are met with a \u201c502 Bad Gateway\u201d error, this most likely means that Discourse hasn't finished bootstrapping. Simply refresh the page after a couple of minutes to solve this error.<\/p>\n\n\n<p>Next, you'll need to click \"Register\" to create a new admin account using the email address you entered earlier. <\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"834\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-admin-account-1024x834.png\" alt=\"register-discourse-admin-account\" class=\"wp-image-5264\" srcset=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-admin-account-1024x834.png 1024w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-admin-account-300x244.png 300w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-admin-account-768x625.png 768w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-admin-account.png 1277w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n<p>Using the above form, you'll need to enter the following information to register your Discours admin account:<\/p>\n\n\n<ul class=\"wp-block-list\"><li><strong>Email<\/strong>: This is an expanding menu that will allow you to pick your previously registered email address.<\/li><li><strong>Username: <\/strong>This box lets you fill in a unique short username with no spaces.<\/li><li><strong>Password<\/strong>: This box lets you determine a password of at least 15 characters.<\/li><\/ul>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"542\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-confirm-email-1024x542.png\" alt=\"discourse-confirm-email\" class=\"wp-image-5265\" srcset=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-confirm-email-1024x542.png 1024w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-confirm-email-300x159.png 300w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-confirm-email-768x407.png 768w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-confirm-email.png 1286w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n<p>After completing the registration form, you'll be asked to confirm the email address. To do so, simply check your inbox for a confirmation email that will wrap up the admin registration process. <\/p>\n\n\n<p>In the unlikely event that you run into any issues or are unable to receive an email to confirm your admin account, refer to this <a href=\"https:\/\/meta.discourse.org\/t\/troubleshooting-email-on-a-new-discourse-install\/16326\" class=\"rank-math-link\" target=\"_blank\" rel=\"noopener\">Discourse email troubleshooting guide<\/a>. <\/p>\n\n\n<p>Once you've finished registering your admin account, you'll be taken to the next step of the setup wizard which will allow you to configure some additional basic settings such as your preferred default language. <\/p>\n\n\n<p>If you wish to skip this, for now, you can click <strong>Maybe Later. <\/strong><\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1014\" height=\"1024\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-language-selection-1014x1024.png\" alt=\"\" class=\"wp-image-5267\" srcset=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-language-selection-1014x1024.png 1014w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-language-selection-297x300.png 297w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-language-selection-150x150.png 150w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-language-selection-768x776.png 768w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/discourse-language-selection.png 1279w\" sizes=\"auto, (max-width: 1014px) 100vw, 1014px\" \/><\/figure>\n\n\n<p>Once you either complete or skip the setup wizard, you will be redirected to your brand new Discourse forum where you'll see the <a href=\"https:\/\/github.com\/discourse\/discourse\/blob\/master\/docs\/ADMIN-QUICK-START-GUIDE.md\" class=\"rank-math-link\" target=\"_blank\" rel=\"noopener\">Discourse Admin Quick Start Guide<\/a>. This guide contains additional information about what to do next and how you can further customize your Discourse installation. <\/p>\n\n\n<h2 class=\"wp-block-heading\"><strong>Upgrading Discourse<\/strong><\/h2>\n\n\n<p>You've now successfully installed and configured your Discourse forum! When it's time to upgrade Discourse, it's good to know that the process has been simplified and no longer requires using the git pull command thanks to <strong>easy one-click upgrades.<\/strong><\/p>\n\n\n<p>You can now simply head to your Discourse admin area where you'll be notified when it's time to upgrade and can easily do so by clicking <strong><em>Click here to upgrade. <\/em><\/strong><\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"244\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/upgrade-discourse-1-1024x244.png\" alt=\"discourse-one-click-upgrade\" class=\"wp-image-5270\" srcset=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/upgrade-discourse-1-1024x244.png 1024w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/upgrade-discourse-1-300x72.png 300w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/upgrade-discourse-1-768x183.png 768w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/07\/upgrade-discourse-1.png 1141w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n<p>You can however still alternatively, use the manual git pull command by running the three commands:<\/p>\n\n\n<pre class=\"wp-block-preformatted\">cd \/var\/discourse\ngit pull\n.\/launcher rebuild app<\/pre>\n\n\n<h2 class=\"wp-block-heading\">Conclusion \u2013\u00a0Time To Invite People To Your New Forum<\/h2>\n\n\n<p>Now that you've successfully completed the Discourse installation process, it's time for the hard part \u2013\u00a0growing your community. <\/p>\n\n\n<p>If you're starting your first community or looking to migrate to faster &amp; more affordable hosting \u2013 we make it really easy to get started with Discourse, so\u00a0feel free to have a look at <a href=\"https:\/\/ssdnodes.com\/pricing\" class=\"rank-math-link\" target=\"_blank\" rel=\"noopener\">our available plans<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Discourse installation guide, we&#8217;re going to walk you through the process of installing Discourse \u2013\u00a0our favorite forum software \u2013 on Ubuntu&#8217;s latest releases. Server Requirements The minimum server requirements to install Discourse are: 10 GB of free disk spaceSingle-core CPU64 bit Linux compatible with Docker which you will need in order to install  &#8230;<\/p>\n","protected":false},"author":20,"featured_media":5236,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[18,30],"tags":[225,185],"class_list":["post-5234","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-tutorials","tag-discourse","tag-ubuntu"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/5234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/comments?post=5234"}],"version-history":[{"count":3,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/5234\/revisions"}],"predecessor-version":[{"id":13062,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/5234\/revisions\/13062"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media\/5236"}],"wp:attachment":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media?parent=5234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/categories?post=5234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/tags?post=5234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}