Open In App

How To Restore EC2 From Snapshot?

Last Updated : 22 Jan, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

AWS EC2 service is one of the most widely used services which allows users to rent virtual servers commonly called EC2 instances, to run applications and workloads. EC2 instances are customizable, and scalable and provide flexibility to choose different instance types based on computing requirements. EC2 plays a central role in the cloud computing landscape. It is always a good practice to keep a backup for the EC2 instance, because if by any chance EC2 instance is deleted or stops working then you can restore all the data and configuration lost from the backup. Having a backup is one of the best practices for safeguarding the data, ensuring business continuity, or recovering from any disaster.

Now you have learned why backup is important, so let me go through the steps to recover EC2 from the snapshot.

Steps To Restore EC2 From Snapshot

Step 1: Create an EC2 instance. Follow the below video to create an EC2 instance.


Step 2: Now connect the EC2 instance. Then create some random files inside the instance for the verification of restoration.

Use this command to create some random files. This command will create 10 files.

touch abc{1..10}

create-random-files

Step 3 : Now go to the Snapshots (you can find Snapshots in the left navigation pane of EC2 dashboard) and create a Snapshot for EC2 instance .

create-snapshot

Step 4 : After creating Snapshot wait until the Snapshot is available. Then go to EC2 dashboard and terminate the EC2 instance previously created .

terminate-ec2

Step 5 : Then go to Snapshots , and in the top right corner you will find actions , click Create image from snapshot from it . Give the snapshot a name and let all the other options in default .

create-image

Step 6 : You can check whether the image is created or not by checking the AMIs .

AMI-image-check

Step 7 : In the AMIs top right corner select launch instance from AMI .


Step 8 : Then connect the EC2 instance. Here you have to write a couple of commands to locate the files . (copy the commands one by one )

sudo su
cd ..
cd home/ubuntu
ls

see-the-files

You can see all the 10 files previously created . Now you have completed all the steps to restore the EC2 from the Snapshot .

Conclusion

You have learned why backups are important for EC2 instance . You have also successfully completed all the steps on how to restore the EC2 from a Snapshot .


Next Article

Similar Reads