Skip to content

Deploy Ghost to EC2

Hannah Wolfe edited this page Jun 18, 2013 · 29 revisions

How to setup an EC2 instance

  1. Create an AWS account if you don't already have one. This requires you to login to http://aws.amazon.com/ with your amazon username and password, and then enter credit card details. You shouldn't have to pay anything.
  2. Navigate through "My Account/Console" > "AWS Management Console" > "EC2", or just click here: https://console.aws.amazon.com/ec2/v2/home?region=us-west-2
  3. Configure your default security group to have ssh, http, and https for all incoming IPs (don't forget to press apply at the end): http://docs.aws.amazon.com/gettingstarted/latest/wah-linux/getting-started-security-group.html
  4. Get your key (.pem file) and save it in ~/.ssh with the name ghostdeploy.pem http://docs.aws.amazon.com/gettingstarted/latest/wah-linux/getting-started-create-key-pair.html
  5. Hit "Launch Instance"
  • use the classic wizard
  • choose Ubuntu Server 12.04.2 LTS
  • change nothing on the Launch Instances, Advanced Instance Options, or Storage Device Configuration screens
  • on the Key-Value screen, enter a sensible name value
  • on the Key Pairs screen, choose the Key Pair you setup and saved earlier
  • on the Security Groups screen, choose the default security group that you updated earlier
  • Hit Launch! You should now have an ec2 instance. You should have a public DNS something like ec2-xx-xxx-xx-xx.[region].compute.amazonaws.com. Your username will be ubuntu
  1. Check everything is ok by sshing to the ec2 instance with the following command, and then exit
    • ssh -i ~/.ssh/ghostdeploy.pem ubuntu@ec2-xx-xxx-xx-xx.[region].compute.amazonaws.com

Configuring EC2 for Ghost

  1. Save the config script somewhere on your machine which is easy to find: https://gist.github.com/ErisDS/b75be8bfe12c337a17bb
  2. Send the config file to ec2 with the following command:
  • scp -i ~/.ssh/ghostdeploy.pem /path/to/ghost-ec2-config.sh ubuntu@ec2-xx-xxx-xx-xx.[region].compute.amazonaws.com
  1. ssh into the ec2 instance again
  2. run:
  • sudo ./ghost-ec2-config.sh
  1. create a file in /var/www/app.js - I used the default node.js hello world code: http://nodejs.org/#column1
  2. navigate to your ec2 in a browser (ec2-xx-xxx-xx-xx.[region].compute.amazonaws.com) and you should see "Hello World"

Deploying Ghost to EC2

Clone this wiki locally