This document outlines how to set up your AWS environment for deploying Ghost CMS.
We've configured an IAM user with the necessary permissions to deploy and manage Ghost:
- User:
clintwith Admin access - Custom policy:
GhostDeploymentPolicywith permissions for:- EC2 instance management
- S3 bucket operations
- IAM role management
The policy JSON is stored in ghost-policy.json.
Created a new key pair for SSH access to EC2 instances:
# Key details
Key name: ghost-key
Key file: ~/.ssh/ghost-key.pem
Permissions: 400 (read-only for owner)Always keep this key secure and never share it.
This script creates and launches an EC2 instance with Ghost prerequisites:
- Ubuntu 20.04 LTS
- t2.micro instance type (free tier eligible)
- Security group with ports 22, 80, 443 and 2368 open
- Pre-installation of Node.js, Nginx, and Ghost CLI
Usage:
./deploy-ghost-ec2.shCreates an S3 bucket for Ghost media storage with:
- Unique bucket name based on timestamp
- Versioning enabled
- Public read access for media content
- Proper folder structure for Ghost
Usage:
./setup-s3-storage.shLists all AWS resources related to your Ghost deployment:
- EC2 instances
- Security groups
- S3 buckets
- Key pairs
Usage:
./list-resources.shCleans up all AWS resources created for Ghost:
- Terminates EC2 instances
- Deletes security groups
- Empties and removes S3 buckets (with confirmation prompt)
Usage:
./cleanup-resources.sh-
Verify AWS Configuration
aws configure list
-
Deploy EC2 Instance
./deploy-ghost-ec2.sh
-
Set Up S3 Storage
./setup-s3-storage.sh
-
SSH Into Your Instance
ssh -i ~/.ssh/ghost-key.pem ubuntu@YOUR_INSTANCE_IP -
Complete Ghost Setup
cd /var/www/ghost ghost install -
Monitor Resources
./list-resources.sh
-
Clean Up When Done
./cleanup-resources.sh
- If permissions errors occur, verify your IAM policies are correctly attached
- For connectivity issues, check security group rules
- If instance doesn't start properly, check EC2 console for system logs
- The t2.micro instance is free tier eligible (if under 750 hours/month)
- S3 has costs based on storage and data transfer
- Always clean up unused resources to avoid unexpected charges