Elastic IP for EC2

Beginner
7 min read
Updated: Nov 2026
5 examples
EC2 / Networking

Definition and Usage

An Elastic IP is a static public IPv4 address allocated to your AWS account. Associating one with an EC2 instance gives you a predictable address for SSH, HTTP, or DNS records.

What problem does it solve?

Auto-assigned public IPv4 addresses can change when you replace an instance or across some stop/start workflows. An Elastic IP stays with your account until you release it, so allow lists and DNS A records change less often.

When should you use Elastic IP?

Use it for single-instance labs, SSH admin access, and simple DNS pointing at one VM. For scaled HTTP traffic, prefer an Application Load Balancer or CloudFront and point DNS there instead.

What you will do

Allocate an Elastic IP in the EC2 console, associate it with a running instance from the launch guide, then confirm the public IPv4 on the Instances page.

IPv4 vs IPv6

This walkthrough is the classic IPv4 Elastic IP flow. VPC IPv6 uses different patterns (for example /56 prefixes)—see a dedicated IPv6 on VPC guide when you standardize on IPv6.

Stable address, same Region.

Allocate and associate in the same Region as the instance. Elastic IPs are not global floating addresses across Regions.

Idle Elastic IPs can bill.

AWS typically does not charge for an Elastic IP hour while it is associated with a running instance. You are usually charged when it is allocated but not attached to a running instance. Confirm rates on the EC2 pricing pages.

Next after association.

SSH with PuTTY (or OpenSSH) using the new public IPv4, then upload with FileZilla.

Core Concepts

Terms you will use while attaching a static address:

ConceptMeaning
Elastic IP (EIP)Static public IPv4 allocated to your account in a Region
AllocateReserve an address from Amazon’s pool into your account
AssociateBind the EIP to an instance (or ENI) private IP
DisassociateUnbind so you can remap or release the address
ReleaseReturn the address to AWS; you lose that IPv4
ENIElastic Network Interface — the EIP attaches here
Auto-assigned public IPEphemeral IPv4 that can change across stop/start without EIP
RemapMove the same public IPv4 to a replacement instance

Prerequisites

Have these ready before you allocate:

  • An AWS account with permission to allocate and associate Elastic IPs.
  • A running EC2 instance in the same Region (for example from the EC2 launch guide).
  • Console access to Amazon EC2 in that Region.

Examples

Allocate an Elastic IP, associate it with your instance, and confirm the public IPv4.

Example 1 — Open Elastic IPs

Start from the EC2 console Network & Security section.

  1. Open the EC2 console.
  2. In the left navigation under Network & Security, choose Elastic IPs.
  3. Choose Allocate Elastic IP address.
EC2 console Elastic IPs section and allocate button
Amazon EC2

How It Works

  1. Elastic IPs are Region-scoped—confirm the Region matches your instance.
  2. Allocate reserves an address into your account before any association.
  3. The list view shows allocated addresses and whether they are associated.
  4. Quotas apply per Region; request an increase only if you truly need more static IPv4s.

Example 2 — Allocate the Address

Review the allocation options, then confirm.

  1. Review the allocation options (defaults are fine for many tutorials).
  2. Choose Allocate.
Allocate Elastic IP address confirmation in EC2
Amazon EC2

How It Works

  1. Allocate pulls a public IPv4 from Amazon’s pool into your account.
  2. Until you associate, the address is idle and may incur hourly charges.
  3. Defaults (Amazon pool, standard settings) are enough for a first lab.
  4. Release later if you abandon the lab—see release unused Elastic IPs.

Example 3 — Start Association

Bind the new address to a resource from the Actions menu.

  1. Select the new Elastic IP in the list.
  2. Open the Actions menu and choose Associate Elastic IP address.
Actions menu Associate Elastic IP address
Amazon EC2

How It Works

  1. Associate maps the public IPv4 to a network interface.
  2. You can disassociate later to remap the same address to another instance.
  3. One EIP → one ENI at a time; it does not load-balance across instances.
  4. ENI details are covered further in a network interfaces guide.

Example 4 — Choose the Instance

Pick your running EC2 instance and complete the association.

  1. For Resource type, choose Instance.
  2. Pick your instance and the private IP to bind (usually the primary address).
  3. Choose Associate.
Associate Elastic IP dialog choosing EC2 instance
Amazon EC2

How It Works

  1. Instance mode is the simplest path for a single-VM lab.
  2. Primary private IP is the usual bind target on the primary ENI.
  3. After Associate, SSH and HTTP clients should use the Elastic IP (or its DNS name).
  4. Security groups still apply—open ports as in the launch guide.

Example 5 — Verify on the Instance

Confirm the public IPv4 on the Instances page.

  1. Return to Instances.
  2. Confirm the instance shows the Elastic IP as its Public IPv4 address (or check the Networking tab).
  3. Use that address for PuTTY / SSH and later DNS records.
EC2 instance list showing public Elastic IP
Amazon EC2

How It Works

  1. The public IPv4 column should now match the Elastic IP you allocated.
  2. Stop/start with the association kept usually preserves that public IPv4.
  3. DNS A records should point at this stable address, not an ephemeral one.
  4. Tear down labs: disassociate and release so idle EIPs do not keep billing.

Edge Cases & Pitfalls

Most EIP issues are Region mismatch, idle billing, or assuming one IP can hit many instances.

region

EIP and instance in different Regions

You cannot associate across Regions. Switch the console Region so both resources match.

billing

Charges while the instance is stopped

An Elastic IP attached to a stopped instance is typically treated as unused and can bill. Release or reassociate when you tear down labs.

scale

Expecting one EIP to hit a fleet

One EIP maps to one ENI. Use an ALB or similar for multi-instance HTTP.

dns

A record still points at the old IP

After association, update Route 53 (or your DNS host) to the Elastic IP and wait for TTL.

quota

Allocate fails with a limit error

Default Elastic IP quotas are low. Release unused addresses or request a Service Quotas increase.

ssh

SSH still times out after association

EIP does not open ports. Confirm the security group allows TCP 22 from your IP and the instance is Running.

Key Takeaways

  • Allocate then Associate: EC2 → Elastic IPs → bind to your instance.
  • Stable IPv4: use EIP when DNS or firewalls need a fixed address.
  • Remap when needed: disassociate and attach to a replacement instance.
  • Release idle addresses: unattached EIPs can bill and consume quota.

One line: allocate an Elastic IP, associate it with your running instance, release it when the lab ends.

Frequently Asked Questions

An Elastic IP is a static public IPv4 address allocated to your account. You can associate it with an EC2 instance (or certain other resources) and remap it to another instance when you need to change targets without updating DNS.
When an Elastic IP is associated with a running EC2 instance, there is typically no separate hourly charge for the Elastic IP itself. AWS charges for Elastic IP addresses that are allocated but not associated with a running instance, for example when they are unattached or attached to a stopped instance. Check current EC2 pricing for your Region.
By default, the auto-assigned public IPv4 can change across stop/start cycles. Associating an Elastic IP gives you a stable public IPv4 that moves with the association you configure.
A single Elastic IP associates to one network interface at a time. To spread traffic across many instances, use a load balancer or other routing tier instead of sharing one Elastic IP across multiple targets simultaneously.
Disassociate if needed, then release them in the EC2 console so idle addresses do not accrue charges and do not count against your Region quota.
Often no for end-user HTTP/HTTPS. Point DNS at the load balancer (or CloudFront) instead. Elastic IP is still useful for SSH admin access or small single-instance labs.

Next: SSH with PuTTY

With a stable public IPv4, open a shell from Windows using PuTTY and your key pair before you upload code with SFTP.

PuTTY and EC2 →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful