How to Install Discourse on Alibaba Cloud Using DirectMail and CDN

Prerequisites

Step 1: Setting Up Domain Name

Step 2: Setting Up Alibaba Cloud CDN

Adding the CDN domain

Installing the SSL Certificate for CDN

Setting Back-to-Source Host

Setting the CORS HTTP header

Step 3: Get DirectMail SMTP Credentials

Add Sender Domain

Add Sender Email Address

Set SMTP password

Step 4: Running the Discourse Installer

ssh root@192.168.1.1
sudo apt-get update && apt-get upgrade -y
sudo -s

Install Docker

Install Git

apt-get install git

Download Discourse Installer

mkdir /var/discourse
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse

Run Discourse installer

./discourse-setup
Hostname for your Discourse? [discourse.example.com]:  Email address for admin account(s)? [me@example.com,you@example.com]:  SMTP server address? [smtp.example.com]:  SMTP port? [587]:  SMTP user name? [user@example.com]:  SMTP password? [pa$$word]:  Let's Encrypt account email? (ENTER to skip) [me@example.com]:

Step 5: Setting Up Alibaba Cloud CDN

cd /var/discourse
nano containers/app.yml
#DISCOURSE_CDN_URL: //discourse-cdn.example.com
DISCOURSE_CDN_URL: //cdn.example.com
./launcher rebuild app
./discourse-setup

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store