Discourse on t2.micro AWS instance

I’m a linux admin, somewhat familiar with AWS, and was asked to assist a team in implementing discourse on a t2.micro (free tier eligible) AWS instance. When we were done, the team requested I posted my methods here for the benefit of the community.

The t2.micro only comes with 8gb of storage so it required a little thought. After looking around in a working discourse install, I saw that, though /var/discourse would probably end up being the largest eventually, /var/lib/docker was going to be a problem during installation.

After launching the instance (outside the scope of this post - see Step 1: Launch an Amazon EC2 Instance - AWS Quick Start Guide for details) I needed to create an volume (an Elastic Block Store, or EBS Volume) and attach it to the instance I’d created. In this case I created a general EBS volume of ~32gb, attached it, and mounted it at /media/store (could have easily use /opt or something else.)

From there it was a simple matter of creating /media/store/discourse and /media/store/docker and putting them in the right place on the filesystem.

I used a symbolic link for /media/store/discourse to /var/discourse which the installer seemed okay with, but had to use a bind mount for docker. (added this to /etc/fstab, created /var/lib/docker then mounted it.)

/media/store/docker /var/lib/docker none bind 0 0

We’re still working on mail (which will need to use AWS SES) but thats how we got the installer to run on a t2.micro instance. The 32gb EBS will cost ~$3/month.

4 Likes

Thanks for sharing this!

At 1GB RAM a t2.micro is technically at the minimum requirements for Discourse, though I believe we specify a dual core CPU that is not as critical. What are the actual CPU specs, in terms of model and clockspeed?

2 Likes