- You need to create an AWS EC2 server (Ubuntu 14.04) with add an EBS.
- Make sure you have port 80 opened in the inbound section of the security groups.
- Follow instructions to make your server secure. (optional)
- I have mounted my EBS at /mnt/data and I am using /mnt/data/blog/current as the root directory for the ghost application.
- Install nginx
- Here’s my nginx config. It’s pretty barebones just to make stuff work. You can copy it as it is or make more advanced changes to it.
-
Install node version manager on the server and install node v0.10.42.
-
Install pm2 globally on the node server
-
Install ghost to your local machine. Follow the instructions here.
-
Initiate a git repo
Make sure your you ignore the files not required
- Add capistrano to your project to help with deployments.
I am using ruby 2.1.5 using rvm in my local environment
The Gemfile looks like this
Initialize capistrano
Only the production environment was of relevance for me, so I deleted config/deploy/staging.rb
The config/deploy/production.rb should looks like this
The config/deploy.rb looks like this
Add a file /lib/tasks/pm2.cap. This basically takes care of monitoring your node application.
- Add capistrano-npm and pm2.cap to the Capfile
Add a start.sh script to your project root
- If there are no errors your ghost blog should be available at the public ip of your EC2 instance