Discourse on t2.micro AWS instance

AI-generated summary

AndyML shares a method for deploying Discourse on an AWS t2.micro instance (free tier eligible), which has limited 8GB storage. To overcome storage constraints, they created a 32GB EBS volume, mounted it at /media/store, and symlinked /media/store/discourse to /var/discourse. For Docker, they used a bind mount via /etc/fstab to redirect /var/lib/docker to /media/store/docker. The setup allows the installer to run successfully, with ongoing work on integrating AWS SES for email. The 32GB EBS volume costs approximately $3/month. codinghorror thanks AndyML and notes that while t2.micro meets Discourse’s minimum 1GB RAM requirement, the official recommendation includes a dual-core CPU — though its criticality is uncertain. codinghorror asks for specific CPU model and clockspeed details of the t2.micro instance used.

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 https://docs.aws.amazon.com/quickstarts/latest/vmlaunch/step-1-launch-instance.html 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.

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?