How to allocate Elastic IP address to Amazon EC2 Instances

Three types of IP addresses can be assigned to Amazon EC2 instance: private IP, public IP, and elastic IP. The private IP address is used for internal communication between instances that are in the same VPC. It is assigned by Amazon DHCP and it is a static IP address.

The public address is reachable via the Internet, it is dynamic and assigned by Amazon. Whenever we deploy a new instance, Amazon will take an IP address from IANA (Internet Assigned Numbers Authority) and assign it to the Amazon EC2 instance. As it is a dynamic public IP address, whenever you stop or start the EC2 instance, Amazon will provide you with a new public address.

Imagine the scenario where we are running a web server on the Amazon EC2 instance that needs to be restarted due to installed updates. Once it is restarted, Amazon will assign a new public address and our web server will not be reachable. In order to avoid unnecessary inconvenience, we will allocate an elastic IP address to Amazon account and running EC2 instance(s). The elastic IP address is a static public address that stays always the same regardless if we are stopping an Amazon EC2 instance.

All the mentioned IP addresses (private, public, elastic) can be seen under the Description tab of every Amazon EC2 instance.

In this article, we will explain to you how to allocate an Elastic IP address to the Amazon account and assign it to running Amazon EC2 instance. Please follow the procedure below.

  1. Login into AWS Management Console
  2. Click on Services and then click on EC2

Under Resources, you can see more information about available Amazon EC2 resources in a certain region. In our case, we have one running instance and none of the elastic IPs. We will not go through other resources, but EC2 and Elastic IPs.

  1. Click on Elastic IPs
  2. Click on Allocate Elastic IP address at the top right side of the window.
  3. Under Allocate Elastic IP address click on The elastic IP address can be allocated from Amazon’s pool or you can bring your public IPv4 or customer’s owned pool. Elastic IPs does not support IPv6 addresses. In our case, we will assign an IP address from Amazon’s pool.
  4. Click on Associate this Elastic IP address at the top right side of the window. You can see that Amazon has allocated Elastic IP, and we need to confirm it.
  5. Under Associate Elastic IP address, search for the running instance that should get an elastic IP address and choose the private IP address that will be associated with Elastic IP address, and then select Associate. If you associate an Elastic IP address to an instance that already has an Elastic IP address associated, this previously associated Elastic IP address will be disassociated but still allocated to your account.

As per Amazon’s documentation, if the Elastic IP address is already associated with a different instance, it is disassociated from that instance and associated with the specified instance. If you associate an Elastic IP address with an instance that has an existing Elastic IP address, the existing address is disassociated from the instance but remains allocated to your account.

  1. The elastic IP address is successfully associated with the instance.
  2. Go back to EC2 instance (for example, click on EC2 or click on Services – EC2). As you can see there is one Elastic IPs associated with Amazon account and running instance.

If you click on running instance, you will also what Elastic IP address is associated with it.

Jasmin Kahriman


Hi, I'm Jasmin. Thank you for reading the article below. I am a System Engineer and IT Trainer with over 10 years of experience. I am holding multiple IT certifications focused on IT Infrastructure, including CompTIA A+, Network+, Server +, CNIP, MTA, MCP, MCSA, MS, IT Academy and many others. I'm happy to share my knowledge and skills through addressing tech issues and writing how-to's in a way that it can be followed by everyone.

Expert Tip

How to allocate Elastic IP address to Amazon EC2 Instances

If the issue is with your Computer or a Laptop you should try using Restoro which can scan the repositories and replace corrupt and missing files. This works in most cases, where the issue is originated due to a system corruption. You can download Restoro by clicking the Download button below.

Download Now

I'm not interested