Ben Nalle
Ben Nalle

Reputation: 567

Will my web app be deleted if I stop my EC2 instance?

According to the AWS documentation "any data stored in the RAM of the host computer or the instance store volumes of the host computer is gone." Does this mean that the web application I installed on my EC2 instance will be deleted if I stop running my instance?

I apologize for the naive question. I am new to this and worried I might make a mistake.

Upvotes: 4

Views: 2987

Answers (3)

jprism
jprism

Reputation: 3424

Yes unless you have EBS volume attached to EC2. If you are using an EBS-backed instance, you can stop and restart that instance without affecting the data stored in the attached volume

Upvotes: 0

captainblack
captainblack

Reputation: 4425

Adding to John's answer, as long as you do not use an Instance Store volume, to store your web application, you are good to go.

The data in an instance store persists only during the lifetime of its associated instance. If an instance reboots (intentionally or unintentionally), data in the instance store persists. However, data in the instance store is lost under the following circumstances:

  • The underlying disk drive fails

  • The instance stops

  • The instance terminates

If however you are using an EBS volume, these conditions do not apply and you are free to start and stop your instance any number of times you want.

Upvotes: 4

John Rotenstein
John Rotenstein

Reputation: 269101

An Amazon EC2 instance is just like a normal computer. If you turn it off, anything in RAM is lost. Also, if you reboot either computer, the contents of RAM is lost (well, more like 'forgotten', but effectively the same).

Just like your home computer, if you reboot or stop/start an EC2 instance, it boots up again. Whatever software you have installed on the computer is still there. However, applications you were running will only start if you have configured a startup script to run the app again.

Typically, when software such as a web server is installed on a computer, it is configured to automatically start again when the computer is turned on/rebooted in future.

Elastic Block Store (EBS) disk volumes act just like a disk in a normal computer. If an EC2 instance is stopped and later started again, the contents of the disk is still there, unchanged.

Bottom line: It's just like a home computer. Don't panic.

Upvotes: 7

Related Questions