This is how to deploy Strapi on AWS without hand-building the server: a pre-configured AMI, launched through CloudFormation, with HTTPS and database backups already wired up. You get a working admin panel in about ten minutes. The rest of the article covers what to pick, what to change, and the two things that trip people up.
What you get when you deploy Strapi on AWS
Strapi is an open source headless CMS written in Node.js. You model content types in the admin panel, and it generates REST endpoints for them (and GraphQL with a plugin). Your front end, whether Next.js, a mobile app or a static site, just calls the API. The official REST API docs cover the query syntax.
Running it yourself on AWS makes sense when you want the content and the database in your own account, no per-seat pricing, and the freedom to add custom plugins. If you would rather not run servers at all, a managed CMS is the honest answer, and I say more on that below.
Is the Strapi AMI the best CMS for AWS?
People searching for the best headless CMS on AWS usually end up choosing between four things. Here is how I would split them.
| Option | Strapi | Directus | Contentful / Sanity | WordPress (headless) |
|---|---|---|---|---|
| You host it | Yes | Yes | No, managed SaaS | Yes |
| Starts from | Content types in an admin UI | An existing SQL database | A hosted content model | Posts and pages |
| API | REST, GraphQL via plugin | REST and GraphQL | REST and GraphQL | REST, GraphQL via plugin |
| Cost shape | Server cost only | Server cost only | Per seat, per usage tier | Server cost only |
| Best fit | Developer-led content APIs | Data-first apps and internal tools | Teams with no ops capacity | Editors who already know WordPress |
Strapi and Directus are the two real self-hosted contenders, and the licensing details differ enough to matter. Our Strapi vs Directus comparison goes through it, and there is a separate walkthrough for deploying Directus on AWS (or Directus on Google Cloud). For a wider list, see the best open source headless CMS options. And if the site is really a blog, Ghost or WordPress may be less work than any headless setup.
Before you launch
- An AWS account with permission to create EC2, IAM and CloudFormation resources.
- A domain on Route 53 if you want SSL to set itself up. Otherwise you will run the certificate script by hand, which is a one-liner below.
- Enough vCPU quota for a t3.small. Brand-new accounts sometimes have none, and increasing the vCPU quota is not instant.
- An EC2 key pair for SSH, and an S3 bucket for the database backups.
Quick video guide
How to install Strapi on AWS
1. Subscribe and launch the CloudFormation template
Open the Strapi AMI in AWS Marketplace, click Continue to Subscribe, accept the terms and choose the CloudFormation fulfilment option for your region. Then pick Launch CloudFormation.
2. Fill in the stack parameters
- Stack name and DeploymentName: anything unique, such as
strapi. - Admin Email: used for the Let's Encrypt certificate.
- DomainName: a public domain hosted on Route 53, for example
cms.yourdomain.com. - InstanceType: t3.small is the recommended default.
- KeyName and S3Bucket: your key pair and the backup bucket.
- SSHLocation: change the default 0.0.0.0/0 to your own IP.
Leave the VPC and subnet CIDR blocks alone, choose "Roll back all stack resources" under failure options, tick the IAM acknowledgement and submit.
3. Point DNS at the instance
When the stack reaches CREATE_COMPLETE (5-10 minutes), copy PublicIp from the Outputs tab and create an A record for your domain, in Route 53 or any other DNS provider.
4. Create the admin account
Open DashboardUrl, or DashboardUrlIp if DNS has not propagated yet, and fill in the first-run admin form. That first account owns the admin panel, so use a strong password; later accounts are created from inside it.
502 Bad Gateway right after launch
Wait about five minutes and refresh. The proxy answers before the application has finished starting. If it is still a 502 after ten, check DNS and the certificate before anything else.
5. Generate the certificate by hand, if needed
Automatic SSL only works when the domain is on Route 53 and already pointing at the instance. If it did not issue, SSH in and run the script:
ssh -i <your key name> ubuntu@<Public IP address> sudo /root/certificate_generate_standalone.sh It asks for the admin email and issues the certificate.
Running it after launch
- Backups: the stack writes database backups to your S3 bucket. Restore one into a throwaway instance once, so you know it works before you need it.
- Media uploads: by default they live on the instance disk. If you will have lots of images, point the upload provider at S3 and keep the server disposable.
- Sizing: watch memory in CloudWatch. Strapi on a t3.small is fine for an editorial team of a few people and a modest API load. Heavy API traffic belongs behind a cache or CDN, not on a bigger box.
- Security: restrict SSH to your IP, keep the OS patched, and review which public roles can read which content types in the admin panel. The default permission set is the usual source of accidental data exposure.
- Removal: delete the CloudFormation stack to stop billing. The S3 backups stay.
The API reference lives in the Strapi docs and the source on GitHub. For help with sizing, custom plugins or migrating an existing project, talk to the Meetrix team.
Frequently Asked Questions
How do I deploy Strapi on AWS?
Subscribe to the Strapi AMI on AWS Marketplace, launch its CloudFormation template with your domain and email, point DNS at the PublicIp output, then open the DashboardUrl to create the admin account. It takes 5-10 minutes.
What is the best headless CMS on AWS?
It depends on the team. Strapi suits developers who want a content-first admin and REST or GraphQL APIs. Directus fits when you already have a SQL schema. Contentful and Sanity are managed, so there is nothing to host.
What instance size does Strapi need on AWS?
A t3.small is the recommended starting point for this AMI. Strapi's admin build is memory hungry, so move to t3.medium if the admin panel is slow or you add many plugins and large media libraries.
Why do I see 502 Bad Gateway after the stack finishes?
Strapi is still starting up. Wait about five minutes after CREATE_COMPLETE and refresh. If it persists, check that the DashboardUrl uses your domain and that DNS already points at the instance.
How do I generate the SSL certificate manually?
SSH in with ssh -i your-key ubuntu@PublicIp, then run sudo /root/certificate_generate_standalone.sh and follow the prompts. DNS must already point at the instance or Let's Encrypt validation will fail.
Is Strapi free to self-host on AWS?
The Strapi Community edition is open source and free. On AWS you pay for the EC2 instance, storage and the Marketplace software charge. Paid Strapi plans add enterprise features such as SSO and audit logs.
Ready to Deploy Your Own Strapi Instance?
Get started in minutes with our pre-configured AMI and take full control of your content management and API creation.
Deploy Strapi from AWS Marketplace