Stop vs Terminate EC2 Instance: Key Differences and When to Use Each
pauses it, preserving the instance and its data while stopping billing for compute. Terminating an EC2 instance deletes it permanently, removing all data and stopping all charges.Quick Comparison
This table summarizes the main differences between stopping and terminating an EC2 instance.
| Factor | Stop Instance | Terminate Instance |
|---|---|---|
| Instance State | Stopped (can be started again) | Terminated (cannot be restarted) |
| Billing | Stops compute charges, storage charges continue | Stops all charges immediately |
| Data on Instance Store | Lost | Lost |
| Data on EBS Volumes | Preserved | Deleted if "Delete on Termination" is true |
| Elastic IP Address | Remains associated if attached | Released unless manually detached |
| Instance ID | Remains the same when restarted | Instance ID is not reused |
Key Differences
When you stop an EC2 instance, AWS shuts it down but keeps the instance's configuration and attached EBS volumes intact. This means you can start it again later with the same settings and data on EBS volumes. While stopped, you do not pay for compute time, but you still pay for storage of EBS volumes.
In contrast, terminate deletes the instance permanently. The instance ID is removed, and by default, the root EBS volume is deleted unless configured otherwise. You cannot restart a terminated instance. Termination stops all billing immediately, including compute and storage if volumes are deleted.
Stopping is like pausing a movie—you can resume watching later. Terminating is like deleting the movie file—you lose it completely.
Code Comparison
Here is how you stop an EC2 instance using AWS CLI.
aws ec2 stop-instances --instance-ids i-1234567890abcdef0Terminate Equivalent
Here is how you terminate the same EC2 instance using AWS CLI.
aws ec2 terminate-instances --instance-ids i-1234567890abcdef0When to Use Which
Choose stop when you want to pause your instance temporarily to save compute costs but keep your data and configuration intact for later use.
Choose terminate when you no longer need the instance and want to delete it permanently to avoid all charges and free up resources.