forked from TryGhost/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
Deploy Ghost to EC2
Hannah Wolfe edited this page Jun 18, 2013
·
29 revisions
- 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.
- 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
- 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
- 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
- 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
- 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
- Save the config script somewhere on your machine which is easy to find: https://gist.github.com/ErisDS/b75be8bfe12c337a17bb
- 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
- ssh into the ec2 instance again
- run:
- sudo ./ghost-ec2-config.sh
- create a file in /var/www/app.js - I used the default node.js hello world code: http://nodejs.org/#column1
- navigate to your ec2 in a browser (ec2-xx-xxx-xx-xx.[region].compute.amazonaws.com) and you should see "Hello World"