How we moved from Heroku to AWS using Docker
Description and use
Migrating an application from Heroku to AWS using Docker improved scaling control and reduced hosting costs.
Problem
The team needed to migrate a production application from Heroku to AWS while maintaining deployment speed and cost efficiency.
Outcome
The migration completed with minimal downtime, improved control over scaling, and a reduction in monthly hosting costs.
Workflow
- 1. Containerize the application using Docker and create a Dockerfile.
- 2. Push the image to Amazon ECR (Elastic Container Registry).
- 3. Configure an ECS task definition pointing to the ECR image.
- 4. Set up an ECS service with desired number of tasks and load balancer.
- 5. Migrate the PostgreSQL database from Heroku Postgres to Amazon RDS.
- 6. Update environment variables and secrets in AWS Parameter Store or Secrets Manager.
- 7. Test the deployment in a staging environment.
- 8. Cut over traffic from Heroku to the new AWS ECS service.
- 9. Decommission Heroku resources.
- Record date: 2026-10-17T04:56:05.273Z