I am running a side-project on EC2 with an Ubuntu image because I need to do some computing intensive things there.

Now I don't need to do them each and every day right now (mostly because I do most development on weekends) and I would like to find a way how to prevent to pay EC2 24/7.

I understand that shutting down an instance requires that everything you did on that image is gone so my question is: Is there any way that I could create an image before I shut down an instance (to prevent costs) and then load that image, start a new instance and continue where I left off?

3 Answers 3


There sure is:


That said, you probably won't want to do this after each and every session. You should do this once after installing and configuring your software, and mount an elastic block device to store your data.

  • the link is a 404
    – Ka.
    Sep 6, 2017 at 8:43

As luke pointed out, creating an AMI at the end of every session will work, but it looks like a high time demand task to do so often. I will probably tackle the me situation creating a script to install the applications that I use and using EBS to store the important information.

To exemplify it:

I will create a script that will do the following:

 #/sbin/bash -e
 yum -y update
 yum -y install httpd
 yum -y install php
 yum -y install mysql 
 svn checkout [url] /var/www/html/yourrepodestination
 service httpd start

Then I will make sure that I store the data that you need, on an EBS volume and make sure that the script will connect the ebs to my dev environment.

I hope this helps. Let me know if you need me to make something more clear.




You don't need the image to change. Make your image capable of loading a dataset from elsewhere (your hard drive, a remote server, or maybe S3, for instance) on startup, and then resuming. Then make it save the dataset there when it shuts down.

You must log in to answer this question.