Skip to content

Instantly share code, notes, and snippets.

@aaronsmulktis
Last active October 26, 2018 22:09
Show Gist options
  • Save aaronsmulktis/c26011fc0297fca5499d215f09e9d5e4 to your computer and use it in GitHub Desktop.
Save aaronsmulktis/c26011fc0297fca5499d215f09e9d5e4 to your computer and use it in GitHub Desktop.
Discourse on AWS

Setting up Discourse on AWS

Reference: http://stroupaloop.com/blog/discourse-setup-using-aws/

VPC with a Single Public Subnet Create subnet for each availability zone Create security group for VPC Update inbound rules:

  • SSH (22) - anywhere
  • HTTP (80) - anywhere
  • HTTPS (443) - anywhere
  • Custom TCP (5432) - anywhere
  • Customer TCP (6379 - anywhere

Create subnet group in RDS add all subnets Launch DB Postgres Instance (Multi-AZ..) t2.small - 100gb choose VPC group, port 5432

Setup Redis cache subnet group (no cluster mode) add all subnets Launch cache Redis cluster port 6379 - m3.medium

Setup SMTP (mailgun, sendgrid)

Launch EC2 instance (maybe don't use Ubuntu 16.04, 14.* may have less errors) Allocate new public IP t2.medium - 100gb

Go to VPC select Route Tables select Routes Add Route 0.0.0.0/0 >> internet gateway

If CloudFlare is enabled for this hostname, disabled it

Once in server: sudo apt-get update && sudo apt-get upgrade

Maybe: apt-get install grub-common grub-pc (select all boot drives using spacebar, hit enter)

sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring sudo reboot # requires ssh back into server sudo apt-get install git wget -qO- https://get.docker.io/ | sh sudo usermod -aG docker ubuntu sudo mkdir /var/docker sudo git clone https://github.com/discourse/discourse_docker.git /var/docker cd /var/docker sudo cp samples/web_only.yml containers/app.yml sudo cp samples/redis.yml containers/redis.yml sudo cp samples/data.yml containers/data.yml

Maybe: add LETSENCRYPT_ACCOUNT_EMAIL: you@example.com

Run ./discourse-setup (Answer questions)

sudo ./launcher bootstrap app sudo ./launcher start app

If no activation email is received, try these:

./launcher enter app rails r "SiteSetting.notification_email = 'discourse@yoursite.com'" exit

tail shared/web-only/log/rails/production.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment