How To Install Discourse In AWS Lightsail

  • Home
  • /
  • How To Install Discourse In AWS Lightsail
How To Install Discourse In AWS Lightsail

How To Install Discourse In AWS Lightsail

A w s 27 Feb 2021 Siva Nadesan
Table of Contents

Overview

In this article we will see How To Install Discourse In AWS Lightsail. Discourse is modern open source discussion/forum software. AWS Lightsail is an easy-to-use virtual private server (VPS) that offers you everything needed to build an application or website, plus a cost-effective, monthly plan.

Prerequisite

Assumption is that you already have a domain and will be creating a sub domain for discourse. This blog uses AWS Route 53 and Mailjet, but the process is same for other domain registrars as well.

You can get the SPF and DKIM in Mailjet from here

Create AWS Lightsail

  • Navigate to AWS Lightsail

    post thumb
  • Create an instance
    ⏩ Select a Region (us-east-1)
    ⏩ Select a platform (Linux/Unix)
    ⏩ Select a blueprint (Ubuntu 20.04 LTS)
    ⏩ Create key pair
    ⏩ Choose your instance plan (1 GB / 1vCPU / 40 GB SSD)
    ⏩ Identify your instance

  • Wait for couple of minutes for the instance to come online. After the instance is online, navigate to networking section and add a rule to open the inbound traffic on HTTPS port 443.

    post thumb

Create domain for discourse

  • In Route 53, navigate to your hosted zone

    post thumb
  • Add a record (say discourse.entechlog.com) of record type A using the public IP address of instance created in AWS Lightsail.

    post thumb

Install Discourse

  • SSH into to the server from the AWS Lightsail web UI

    post thumb
  • Clone discourse Docker Image into /var/discourse

    sudo -s
    git clone https://github.com/discourse/discourse_docker.git /var/discourse
    cd /var/discourse
    
  • Launch the discourse setup

    ./discourse-setup
    
  • Answer the following questions for your subdomain and email server information. Its good to create a application specific password and configure email using it.

    You can get the email host and credentials for Mailjet from here

    post thumb
  • Update /var/discourse/containers/app.yml to change the SiteSetting.notification_email at the bottom of the app.yml to the email address of your domain.

    post thumb
  • Discourse should be available in the subdomain after the installation finishes.

    post thumb
  • Validate the configuration by running below command

    ./discourse-doctor
    

    If the validation fails, check the log in /var/discourse/shared/standalone/log/rails/production.log for any error. Update /var/discourse/containers/app.yml to fix the issue and rebuild the app by running ./launcher rebuild app

  • Register and verify the admin account for discourse.

    post thumb post thumb

  • After the verification, follow the on screen instructions to do the initial configuration post thumb

  • After the intial configuration, you will be routed to discourse landing page post thumb

Hope this was helpful. Did I miss something ? Let me know in the comments and I’ll add it in !

References



About The Authors
Siva Nadesan

Siva Nadesan is a Principal Data Engineer. His passion includes data and blogging about technologies. He is also the creator and maintainer of www.entechlog.com

LinkedIn

Share: