How We Migrated from Heroku to Amazon Web Services (AWS) Using Docker
Description and use
The team migrated their Rails app from Heroku to AWS using Docker, cutting costs by ~30% and gaining full infrastructure control.
Problem
The team needed to move their application from Heroku to AWS to gain more control over infrastructure and reduce costs.
Outcome
The migration completed in a few weeks, reduced monthly costs by approximately 30%, and provided full control over the deployment stack.
Workflow
- 1. Containerized the Rails app with Docker.
- 2. Created a Dockerfile and docker-compose.yml for local development.
- 3. Pushed images to Amazon ECR.
- 4. Configured Elastic Beanstalk to use the Docker image.
- 5. Migrated databases from Heroku Postgres to Amazon RDS.
- 6. Updated environment variables and add‑on equivalents.
- 7. Tested the deployment locally and in staging.
- 8. Switched traffic to the new AWS environment.
- 9. Decommissioned Heroku resources.
Evidence
We started by containerizing our Rails application with Docker, creating a Dockerfile and docker-compose.yml for local development.
We pushed the images to Amazon ECR and configured Elastic Beanstalk to use the Docker image.
The migration reduced our monthly costs by about 30% and gave us full control over the infrastructure.
- Record date: 2026-11-02T10:58:47.457Z