Skip to main content
Amazon Web Services offers reliable, scalable, and inexpensive cloud computing services. AWS is also one of the most popular choices for hosting a Spree application. We recommend using AWS ECS Fargate to host your Spree application via Docker image.

Required AWS Services

To fully run your Spree application on AWS, you will need the following services:

Docker Image

You can use the official Docker image (ghcr.io/spree/spree) directly, or build your own from your Rails application’s Dockerfile. To build and deploy a custom image to AWS ECR via GitHub Actions:
This action requires secrets to be set in your GitHub repository. You can find the full list of secrets in the AWS ECS Deploy Task Definition GitHub Actions repository.

Environment Variables

Store secrets in AWS Secrets Manager and reference them in your task definitions. Non-sensitive configuration goes in the environment array directly. For a full list of available variables, see Environment Variables.

Secrets Manager

Create the following secrets in AWS Secrets Manager: Optional secrets for email delivery, file storage, and error tracking:
S3 file storage credentials are not needed as environment variables when your ECS task role has the appropriate S3 permissions. Use IAM roles instead of access keys when possible.

ECS Task Definitions

You will need two ECS task definitions: one for the web service and one for the worker service. Save these as .aws/web-task-definition.json and .aws/worker-task-definition.json in your repository.

Web Service

Worker Service

Production Sizing

The task definitions above are sized for production. Here is a summary and scaling guidance:

Auto Scaling

Use ECS Service Auto Scaling to scale the web service based on CPU or memory utilization:

After Deployment

Admin Dashboard

Access your admin panel at:
Default credentials are created during db:seed. Change them immediately after first login.

Database Migrations

The GitHub Actions workflow above runs migrations automatically on deploy. To run migrations manually:

Next Steps