You can stop and start your instance if it has an Amazon EBS volume as its root device. When you stop an instance, it shuts down. When you start an instance, it is typically migrated to a new underlying host computer and assigned a new public IPv4 address.
An instance stop can be user-initiated (where you manually stop the instance) or initiated by AWS (in response to a scheduled stop event when AWS detects irreparable failure of the underlying host for your instance).
For user-initiated stops, we recommend using the Amazon EC2 console, CLI, or API instead of running the operating system stop command from your instance. When using Amazon EC2, if the instance does not cleanly shut down within a few minutes, Amazon EC2 performs a hard shut down. Furthermore, AWS CloudTrail creates an API record of when your instance was stopped.
This topic describes how to perform a user-initiated stop. For information about a stop performed by AWS, see Manage Amazon EC2 instances scheduled to stop or retire.
When you stop an instance, it is not deleted. If you decide that you no longer need an instance, you can terminate it. For more information, see Terminate Amazon EC2 instances. If you want to hibernate an instance to save the contents from the instance memory (RAM), see Hibernate your Amazon EC2 instance. For distinctions between instance lifecycle actions, see Differences between instance states.
Contents
Manually stop and start your instances
You can stop and start your Amazon EBS-backed instances (instances with EBS root devices). You can't stop and start instances with instance store root device.
Warning
When you stop an instance, the data on any instance store volumes is erased. Before you stop an instance, verify that you've copied any data that you need from the instance store volumes to persistent storage, such as Amazon EBS or Amazon S3.
To stop and start an Amazon EBS-backed instance
-
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/
. -
In the left navigation pane, choose Instances, and then select the instance.
-
On the Storage tab, verify that Root device type is EBS. Otherwise, you can't stop the instance.
-
Choose Instance state, Stop instance. If this option is disabled, either the instance is already stopped or its root device is an instance store volume.
-
When prompted for confirmation, choose Stop. It can take a few minutes for the instance to stop.
-
To start a stopped instance, select the instance, and choose Instance state, Start instance.
-
It can take a few minutes for the instance to enter the
running
state. -
If you stopped an Amazon EBS-backed instance and it appears "stuck" in the
stopping
state, you can forcibly stop it. For more information, see Troubleshoot Amazon EC2 instance stop issues.
Automatically stop and start your instances
You can automate stopping and starting instances with the following services:
- Instance Scheduler on AWS
-
You can use Instance Scheduler on AWS to automate the starting and stopping of EC2 instances. For more information, see How do I use Instance Scheduler with CloudFormation to schedule EC2 instances?
Note that additional charges apply. - AWS Lambda and an Amazon EventBridge rule
-
You can use Lambda and an EventBridge rule to stop and start your instances on a schedule. For more information, see How do I use Lambda to stop and start Amazon EC2 instances at regular intervals?
- Amazon EC2 Auto Scaling
-
To ensure you have the correct number of Amazon EC2 instances available to handle the load for an application, create Auto Scaling groups. Amazon EC2 Auto Scaling ensures that your application always has the right capacity to handle the traffic demand, and saves costs by launching instances only when they are needed. Note that Amazon EC2 Auto Scaling terminates, rather than stops, unneeded instances. To set up Auto Scaling groups, see Get started with Amazon EC2 Auto Scaling.
Find all running and
stopped instances
You can find all of your running and stopped instances across all AWS Regions on a
single page using Amazon EC2 Global
View
Find the initial and most recent launch times
When you describe an instance, the launch time for the instance is its most recent launch time. After you stop and start an instance, the launch time reflects the new instance start time. To find the initial launch time for an instance, even after stopping and starting it, view the time at which the primary network interface was attached to the instance.
To find the most recent launch time using the console, select the instance and look under Instance details on the Details tab. To find the attachment time for the primary network interface, look under Network interfaces on the Networking tab.
Using the AWS CLI, run the following describe-instances
aws ec2 describe-instances --instance-id
i-09453945dcf1529e9
--query 'Reservations[*].Instances[*].{InstanceID:InstanceId,InitialLaunch:NetworkInterfaces[0].Attachment.AttachTime,LastLaunch:LaunchTime}'
The following is example output.
{
"InstanceID": "i-09453945dcf1529e9",
"InitialLaunch": "2024-03-31T00:47:08+00:00",
"LastLaunch": "2024-06-30T00:24:06+00:00"
}