Install Discourse on Amazon Web Services (AWS) with Lightsail, SES, and Route 53

:information_source: This topic covers how to install Discourse using the official install instructions using AWS services for the DNS provider (Route 53), email provider (SES), and Cloud Server provider (Lightsail).

Cloud server

Lightsail

  • The default of 1 GB RAM works fine for small Discourse communities. We recommend 2 GB RAM for larger communities.

^ $5/m you can get a server that meets the minimum Discourse requirement, I use $10/m one but thought $5/m will also work.

image

Mail server

You can’t get the secret key back, but if you lost it you can create a new one to use.

Domain

Step by step set up

  1. following the route 53 doc to purchase a domain.

If you got an ‘unable to process’ email on this step, AWS may need to review your account first, fire a support case to let them notify you when your account is reviewed and able to start purchasing.

  1. set up DNS record

Enter route 53 console

select Hosted zones → create hosted zone → fill your domain name in → scroll down, click create hosted zone

Click on the domain name, adding an A record with the value of your lightsail cloud server ip address, it can be found in your lightsail console. (Red block)

  1. set up SES

Enter SES console

select Verified identities → create identity → fill your domain name in (type domain) → scroll down, click create identity

create identity → fill an email address that you will use to register the admin account in (type email address)-> scroll down, click create identity


Since we register the domain in route 53, the verification will take like ~5 minutes, you will get an email for verifying the email address.

When they are both verified, click on the domain name, find Publish DNS records, copy paste the DNS pair to your route 53, under the hosted zone your just create in step 2

Go to SMTP settings and click create SMTP credential, follow the steps, and download a CSV file including the SMTP user name and password.
image

SMTP endpoint is also listed below on this page.

  1. Configure DIscourse

The above steps cover steps 1-3 in the official install instructions. Continue to follow steps 4-6.

Hostname for your Discourse? [discourse.example.com]: // your domain 
Email address for admin account(s)? /[me@example.com,you@example.com]: //the one you verified in SES Verified identities
SMTP server address? [smtp.example.com]:  //SMTP endpoint
SMTP port? [587]: //use default
SMTP user name? [user@example.com]: //in your downloaded CSV file
SMTP password? [pa$$word]: //in your downloaded CSV file
Let's Encrypt account email? (ENTER to skip) [me@example.com]: //use default
Optional Maxmind License key () [xxxxxxxxxxxxxxxx]: //use default

Waiting for installation, then you can register admin account with the one your provide above in settings

  1. After installation

When you are ready to introduce your community to new users, apply for SES production access.

In Use case description, explain how you plan to use Amazon SES to send email. To help us process your request, you should answer the following questions:

How do you plan to build or acquire your mailing list?

How do you plan to handle bounces and complaints?

How can recipients opt out of receiving email from you?

How did you choose the sending rate or sending quota that you specified in this request?

It’s recommended to follow the apply guide in the URL but it doesn’t guarantee approval, if you got a rejection email, try adding screenshots of the new user register list and told them the new user is waiting for the activation email.

3 Likes

can anyone please update proper step by step tutorial to host discourse on AWS Lightsail with SES.

Do you have reason to believe that something is wrong?

3 Likes

I found the guide here super helpful for doing a test-run of the SES configs

just copy/paste the script shown there to a new script file, modify the endpoint (e.g. email-smtp.us-east-1.amazonaws.com ), and it seems to work just fine. For some reason, the telnet method does not seem to work with SES, not sure why.

oh yea for that guide also I did this too to “make a configuration set”, not sure if it was actually required or not for Discourse but I did it anyway just to be able to test the SES as described in the script Creating configuration sets in SES - Amazon Simple Email Service

here is another thing that tripped me up; Publishing an MX record for Amazon SES email receiving - Amazon Simple Email Service

For the required DNS MX Record to apply to your domain, AWS SES provides the “Value” of the record in a format like this;

10 inbound-smtp.region.amazonaws.com

However, my domain registrar gave me an error that “the Value must be a hostname”, aka it did not like the "10 " that was prefixed in there. The AWS Console did not directly tell you what that meant or what to do with it, so as per the docs linked there, you need to do this for your DNS Registrar;

The management consoles of some DNS providers include separate fields for the record Value and the record Priority. If this is the case for your DNS provider, enter 10 for the Priority value, and enter the incoming mail endpoint URL for the Value.

Should look like this in your domain Registrar dashboard;

1 Like

as a follow up, perhaps we could expand this post to include setup for AWS Cloudfront CDN? Since it fits well with the rest of the AWS stack described here. I got it running by following the advice from this post

but a more thorough guide would be great to include