How can I save costs while keeping a ready-to-use environment on EC2?

June 13, 2025 5 answers
Asked by SunnySide42
I often need to run software that requires multiple cores on AWS EC2 every few months. The problem is the setup time: I have to spend hours installing the software, which is around 1 GB in size. After I finish my computations, I want to save the environment without accruing high costs when I'm not using it for months. What's the most cost-effective way to keep my environment saved while minimizing expenses? Any suggestions would be greatly appreciated!

Answers

DockerDude
Consider turning your setup into a Docker image! You can push it to the public ECR, which is free for the first 50GB, giving you an ultra-low-cost solution.
Reply to this answer
BatchMaster
AWS Batch is another service worth exploring. It can help manage and execute batch processing without the need to keep your EC2 instances running.
Reply to this answer
CloudExplorer88
Using EFS instead of EBS could be a great option! I run a t4g.micro VM with a 10GB root EBS and no Elastic IP, so I avoid charges when it's stopped. I setup Tailscale to maintain access to my VM, and I use EFS for expandable storage. Once finished, I move data to S3 or delete it. This setup keeps costs under $1 a month.
Reply to this answer
TechieNerd99
You can create a snapshot of your EBS volume and then delete the EBS itself. Storing a snapshot for 1GB costs roughly $0.05 a month. Alternatively, consider creating an AMI from your EC2 instance, which can also help you save your setup for later use.
Reply to this answer
PackerWizard
Hashicorp Packer is a solid tool for quickly creating AMI images of your EC2 instances, allowing for a faster and easier launch next time. Just remember to stop your instances when not in use; youโ€™ll only pay for the storage.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions