We recently completed a migration from a Next.js blog to Ghost CMS, but instead of using Ghost's managed hosting, we built our own infrastructure on AWS.
While this could have been doing easier and faster using Ghost hosting... well, this is more fun. The result is a production-grade content platform that runs entirely on AWS services with everything defined as infrastructure as code through CDK.
What We Built
The architecture uses ECS Fargate for containerized Ghost instances, Aurora Serverless for the MySQL database, CloudFront for global content delivery, and S3 for image storage. Beyond the core hosting, we implemented automated content workflows with Lambda functions, time-gated access for paid members, webhook integrations for external services, and custom llms.txt
generation.
The entire infrastructure deploys through AWS CDK with TypeScript. Every component is version-controlled, reproducible, and can be spun up in any AWS account. We structured the code as reusable constructs that handle specific aspects of the deployment, from database configuration to CDN caching strategies.
Why Document This
Setting up Ghost on AWS properly requires solving numerous interconnected challenges. The official Ghost documentation assumes managed hosting or simple VPS deployments. AWS's container services add layers of complexity around networking, secrets management, and service discovery. Combining these technologies requires specific knowledge that isn't well documented elsewhere.
We encountered and solved issues with CloudFront caching with Ghost's member authentication, WAF rules that blocked legitimate webhook traffic, and several other niche problems. We also added some custom features using Ghosts's excellent flexibility. This series will document those solutions and features.
What's Coming
Over the next several weeks, we'll publish detailed implementation guides for each component of the infrastructure. The first post will cover the core AWS infrastructure setup with complete CDK code. Subsequent posts will dive into specific topics like storage configuration, email setup, content migration tools, and advanced features we've implemented.
Each post will include working code and troubleshooting guides based on actual production experience. The goal is to provide everything needed to replicate this infrastructure, whether you adopt the complete platform or just specific components.
This series is for developers who want to run Ghost professionally on AWS, teams already invested in AWS infrastructure, and anyone interested in modern containerized application deployment patterns. While Ghost is the application we're hosting, many of the patterns and solutions apply to any containerized web application on AWS.
