For various reasons, the current image of the instance needs to be saved. The user may want to reuse the image with the necessary packages pre-installed. This is where AWS’s snapshot comes in handy. With a snapshot, we can create a backup of the AMI and later use the snapshot to launch new instances with the saved AMI with the same configuration (packages, directories, files) as the original AMI.
We have an instance running in the instances section. After launching an instance follow through this article where we will back up this instance as a snapshot with step-by-step guidance.
Prerequisites
- A running EC2 instance
Step By Step Guidance
In the EC2 panel, go to Elastic Block Store> Snapshot. Then click ‘Create snapshot’.
In the create snapshot panel, select Instance as Resource type. Then select the Instance ID from the dropdown that you want to backup. Add a description if necessary.
If everything goes well, we should see a completed status. You may need to wait a few seconds for this.
To create an image from the current snapshot, select the snapshot, go to Actions, and click on ‘Create image from snapshot’
Give a name to the image, and description (if necessary), and keep everything as it is.
Then press ‘Create image’. If everything goes well you should see a success message like this.
In the Images>AMIs section you should see your newly created image, which can be used for further instance launching. As shown in the image, click on the AMI, then press Launch instance from AMI.
You should arrive at a regular ‘Launch an instance’ section with your AMI selected. The rest is like launching a regular instance (Launch and SSH (from Windows) to AWS EC2 Instance).
Congratulation! Now, you can keep a backup of your instances and reuse them to help you save time!