These integration guides are not official documentation and the Strapi Support Team will not provide assistance with them.
Why Use Amazon?
Amazon Web Services (AWS) offers a comprehensive suite of cloud services that work seamlessly with Strapi to enhance your application's capabilities. By leveraging the Strapi and AWS integration, you can use AWS's infrastructure and tools to build scalable, reliable, and secure applications.
When you integrate Amazon with Strapi, AWS offers several key benefits:
- Scalable Storage Solutions: Amazon S3 provides highly durable and available object storage, perfect for storing media files uploaded through Strapi. This offloads media storage from your Strapi server, improving performance and reliability.
- Serverless Computing: AWS Lambda lets you run code without managing servers, ideal for extending Strapi's functionality with custom logic that scales automatically with demand.
- Enhanced Security: Services like Amazon Cognito integrate with Strapi to provide robust user authentication and authorization capabilities, including social logins and multi-factor authentication. For more on managing permissions in Strapi, consider reviewing the roles and permissions settings within the Strapi admin panel.
- Global Content Delivery: By implementing AWS S3 and CloudFront integration, you can ensure Strapi-managed content is delivered quickly to users worldwide, reducing latency and improving the user experience.
- Flexible Deployment Options: Whether you prefer traditional virtual servers (EC2), container orchestration (ECS), or serverless containers (Fargate), AWS provides multiple ways to deploy and manage your Strapi application.
This integration gives you access to Amazon's reliable infrastructure while maintaining the flexibility and ease of use that makes Strapi powerful. For detailed implementation guidance, check out the official AWS documentation.
Why Use Strapi?
Strapi is the leading open-source headless CMS offering features, like customizable APIs, role-based permissions, multilingual support, etc. It simplifies content management and integrates effortlessly with modern frontend frameworks.
Explore the Strapi documentation for more details.
Strapi 5 Highlights
The out-of-the-box Strapi features allow you to get up and running in no time: 1. Single types: Create one-off pages that have a unique content structure. 2. Draft and Publish: Reduce the risk of publishing errors and streamline collaboration. 3. 100% TypeScript Support: Enjoy type safety & easy maintainability 4. Customizable API: With Strapi, you can just hop in your code editor and edit the code to fit your API to your needs. 5. Integrations: Strapi supports integrations with Cloudinary, SendGrid, Algolia, and others. 6. Editor interface: The editor allows you to pull in dynamic blocks of content. 7. Authentication: Secure and authorize access to your API with JWT or providers. 8. RBAC: Help maximize operational efficiency, reduce dev team support work, and safeguard against unauthorized access or configuration modifications. 9. i18n: Manage content in multiple languages. Easily query the different locales through the API. 10. Plugins: Customize and extend Strapi using plugins.
Learn more about Strapi 5 feature.
See Strapi in action with an interactive demo
Setup Strapi 5 Headless CMS
We are going to start by setting up our Strapi 5 project with the following command:
🖐️ Note: make sure that you have created a new directory for your project.
You can find the full documentation for Strapi 5 here.
Install Strapi
npx create-strapi-app@latest server
You will be asked to choose if you would like to use Strapi Cloud we will choose to skip for now.
Strapi v5.6.0 🚀 Let's create your new project
We can't find any auth credentials in your Strapi config.
Create a free account on Strapi Cloud and benefit from:
- ✦ Blazing-fast ✦ deployment for your projects
- ✦ Exclusive ✦ access to resources to make your project successful
- An ✦ Awesome ✦ community and full enjoyment of Strapi's ecosystem
Start your 14-day free trial now!
? Please log in or sign up.
Login/Sign up
❯ Skip
After that, you will be asked how you would like to set up your project. We will choose the following options:
? Do you want to use the default database (sqlite) ? Yes
? Start with an example structure & data? Yes <-- make sure you say yes
? Start with Typescript? Yes
? Install dependencies with npm? Yes
? Initialize a git repository? Yes
Once everything is set up and all the dependencies are installed, you can start your Strapi server with the following command:
cd server
npm run develop
You will be greeted with the Admin Create Account screen.
Go ahead and create your first Strapi user. All of this is local so you can use whatever you want.
Once you have created your user, you will be redirected to the Strapi Dashboard screen.
Publish Article Entries
Since we created our app with the example data, you should be able to navigate to your Article collection and see the data that was created for us.
Now, let's make sure that all of the data is published. If not, you can select all items via the checkbox and then click the Publish button.
Enable API Access
Once all your articles are published, we will expose our Strapi API for the Articles Collection. This can be done in Settings -> Users & Permissions plugin -> Roles -> Public -> Article.
You should have find
and findOne
selected. If not, go ahead and select them.
Test API
Now, if we make a GET
request to http://localhost:1337/api/articles
, we should see the following data for our articles.
🖐️ Note: The article covers (images) are not returned. This is because the REST API by default does not populate any relations, media fields, components, or dynamic zones.. Learn more about REST API: Population & Field Selection.
So, let's get the article covers by using the populate=*
parameter: http://localhost:1337/api/articles?populate=*
Getting Started with Amazon
Integrating Amazon with Strapi brings powerful scalability and performance benefits to your applications. Here's how to get your Strapi application working with Amazon, focusing on S3 integration for media storage.
Configuring Strapi Environment
To begin the integration, prepare your AWS environment with the right permissions. Create an IAM user in AWS for S3 integration with permissions to perform actions like s3:PutObject
, s3:GetObject
, s3:ListBucket
, and s3:DeleteObject
on the specified bucket resources.
This IAM policy grants the minimum permissions needed for your Strapi application to upload, retrieve, list, and delete objects in your S3 bucket—following the principle of least privilege for better security.
Installing and Adjusting Settings
Install the official Strapi S3 provider plugin:
npm install @strapi/provider-upload-aws-s3
You can find detailed steps in the Amazon S3 Upload Provider setup guide.
To configure CORS on your S3 bucket for requests from your Strapi application domain, use the following settings:
1[
2 {
3 "AllowedHeaders": ["*"],
4 "AllowedMethods": ["GET", "PUT", "POST", "DELETE"],
5 "AllowedOrigins": ["https://your-strapi-domain.com"],
6 "ExposeHeaders": ["ETag"]
7 }
8]
This configuration maintains security while allowing your Strapi application to communicate with your S3 bucket.
Code Implementation
After installing the provider, set up Strapi to use the S3 provider by configuring your ./config/plugins.js
file with the appropriate provider options.
This configuration uses environment variables to store your AWS credentials—a security best practice recommended by AWS security experts. Add these variables to your .env
file:
1AWS_ACCESS_KEY_ID=your_access_key_id
2AWS_SECRET_ACCESS_KEY=your_secret_access_key
3AWS_REGION=your_bucket_region
4AWS_BUCKET_NAME=your_bucket_name
By integrating Amazon with Strapi in this way, you ensure your application remains secure and scalable. With these configurations in place, Strapi will now use Amazon S3 to store all uploaded media files. This setup improves your application's scalability and performance by offloading media storage to Amazon's robust infrastructure.
Strapi Open Office Hours
If you have any questions about Strapi 5 or just would like to stop by and say hi, you can join us at Strapi's Discord Open Office Hours Monday through Friday at 12:30 pm - 1:30 pm CST: Strapi Discord Open Office Hours
For more details, visit the Strapi documentation and Amazon documentation.