Is it possible to retain IP address when stopping/starting an AWS EC2 instance?

Assign an Elastic IP to your instance. That IP is yours until you release it. Stop, start, terminate, reassign to a different instance, you can do whatever you like.

Elastic IPs are free, but cost a small amount if they're not attached to a running instance.

There's no way to retain the automatically assigned public IP through a stop / start cycle.


You seem to quote the wrong part of AWS documentation. Take a look here (from your same link):

  • EC2-Classic: We disassociate any Elastic IP address that's associated with the instance. You're charged for Elastic IP addresses that aren't associated with an instance. When you restart the instance, you must associate the Elastic IP address with the instance; we don't do this automatically.
  • EC2-VPC: The instance retains its associated Elastic IP addresses. You're charged for any Elastic IP addresses associated with a stopped instance.

So, it seems that using an EC2-VPC instance with an Elastic IP address you can stop/reboot the instance and retain the assigned public IP address