EC2 instance stuck in “stopping” state

Issue:
EC2 instance stuck in “stopping” state and doesn’t terminate or respond to normal stop/start actions.
Context:
This happens fairly often. Users on forums run into it when trying to stop an instance that becomes unresponsive due to high CPU usage, a kernel panic, or corrupted disk. It also happens during shutdown failures from inside the OS. AWS doesn’t let you force-stop it from the console when it’s stuck in this state for too long.
Symptoms:
- EC2 instance shows status as “stopping” for more than a few minutes.
- You can’t reboot, stop, or terminate the instance from the console.
- CLI/SDK actions return success but nothing happens.
- Instance isn’t reachable via SSH.
- No status checks fail.
Fix:
There is no way to “unstick” a stuck EC2 instance directly. The approach is to recover the root volume and re-attach it to a healthy instance. Here’s the process:
- Go to EC2 Dashboard → Volumes
Locate the root EBS volume attached to the stuck instance. - Detach the Volume
You may have to force-detach it since the instance is technically still “running.” - Create a New Temporary EC2 Instance
Use the same OS and instance type as the stuck instance if possible. - Attach the Detached Volume to the New Instance
Attach it as a secondary volume (e.g.,/dev/xvdf). - SSH into the Temporary Instance
Mount the attached volume:sudo mkdir /mnt/recovery sudo mount /dev/xvdf1 /mnt/recovery - Check for Issues in Logs
Look in/mnt/recovery/var/log(especiallysyslog,messages, orcloud-init.log) to find out what broke. - Fix Broken Configs or Delete Problematic Files
Example: if there was a startup script causing a boot loop, remove it. - Unmount and Detach Volume
sudo umount /mnt/recovery - Create a New Instance with the Fixed Volume as Root
- Snapshot the fixed volume.
- Create an AMI from it.
- Launch a new instance using that AMI.
- Terminate the Stuck Instance
Note:
If none of this works or you don’t care about the data, skip steps 1–9 and just create a replacement instance. AWS will eventually stop the broken one and you can terminate it manually later.