Deploy discourse on Google App engine in 10 minutes
I just finished working on a discourse app running on google app engine, so I wanted to document the process here.
What’s google app engine?
Google app engine is a cloud computing platform for developing and hosting web applications in Google-managed data centers. They offer 300 USD trial for a year when you sign up and you can use that to test and pre-launch your app.
In this article, I will be using Bitnami app store, which has an inbuilt discourse app, and with just few clicks, you can get your app up and running. Although, the discourse documentation explicitly talked supports docker. I should have used that, but exploring bitnami will be fun this time.
I ran into problem during development but discourse developers couldn’t help out. So i decided to write a post about it
So, are you ready to explore
Creating your google app engine account
Sign up with your google email address and you may be eligible to have free 300 USD credit. Google will ask for details including your credit card info, you can add it, they wont charge you.
Create google project for your app
Visit cloud console
Sign in, if you are not.
Create discourse app with cloud launcher
- Click hamburger icon
2. click on cloud launcher
3. Search for discourse: click on the result, google will ask for billing info and some other information, go ahead and click it. Your app will install on your Virtual machine, you will have to be patient here, it should take you 5 minutes to install.
Getting URL after installation
After installing discourse, you will want to check out your app, the steps below guide you on how to get your app URL
- Click the hamburger icon
2. Go to google compute engine
3. You will see your discourse project you created
4. Your external IP is your app URL
Setting Up email
Discourse will not work until you have perfectly configured your email, in this project, I will be using mail-gun, they offer free 30,000 email per month, unless you running a large forum, you cant exceed the monthly quota.
**Before you proceed, make sure you have a working domain and its recommended you host your app on a sub-domain(
forum.yourdomain.com), although its possible to have it on a main domain.
Kindly head over to where you hosted your domain and create a sub-domain where your discourse app will reside, forum.discourse.com is not a bad option.
Okay, now that you have created a sub-domain where your app will be, I want you to stop now and create a free account on mandrill.
Setting Up mailgun account.
I followed this tutorial and trust me it is easy to follow, i’ll recommend it for setting up mailgun on your discourse app
Configure your discourse app SMTP
- Click on VM instance
2. Click on SSH you will see open in browser
3. Open discourse config file
$ sudo vi /opt/bitnami/apps/discourse/htdocs/config/discourse.conf:
Scroll down using ‘j’ on your keyboard and press ’I’ to paste the snippet
smtp_address = "SMTP_HOSTNAME"
smtp_port = SMTP_PORT
smtp_domain = example.com
smtp_user_name = 'SMTP_USER'
smtp_password = 'SMTP_PASSWORD'
smtp_enable_start_tls = true
Press ‘ESC’ key
Press :wq! To save and exit VIM editor.
The above commands are VIM editor commands, you can learn more here on how it works.
Don’t forget to restart your app
$ sudo /opt/bitnami/ctlscript.sh restart
Testing your email
Login as an admin by visiting your external IP, how you have can still remember how i got the login credentials? if not scroll up and read getting URL after installation.
Configuring your domain
You wont want users to visit your app with an unfriendly URL, 220.127.116.11 so we can configure our app domain to use the subdomain we created above
Edit the DNS of your sub-domain
2. Create a CNAME and add your discourse app. This might take some time usually 48 hours to propagate, depending on the hosting company, but seriously who has that time… it took me 3 minutes tho..
Removing Management Icon
sudo /opt/bitnami/apps/APPNAME/bnconfig --disable_banner 1
Don’t forget to restart your app.
I hope you had smooth experience installing discourse on google app engine, kindly share on twitter so others can benefit. Don’t forget to click the love icon. Thanks.
i wanted to avoid this thank you so i wrote this tutorial
If you face any problem, please tell me in the comment box below i’ll be happy to help