View and manage IP addresses for Lightsail resources
You can communicate with your Lightsail instance, and other Lightsail resources, using their IP addresses. For example, using the public IP address of your instance, you can check the network status of your instance (using PING), establish an SSH connection to your instance, and route traffic to your instance from a custom domain name. There are many more things you can do with the IP address of your Lightsail resources.
Lightsail instances, container services, and load balancers support both the IPv4 and IPv6 addressing protocols. These resources use the IPv4 addressing protocol by default; you can't disable this behavior. You can optionally enable IPv6 for your instances, container services, and load balancers.
In this guide, we cover what you need to know about IP addresses in Lightsail.
Contents
Private and public IPv4 addresses for instances
When you create a Lightsail instance, it is assigned a public and a private IPv4 address. The public IP address is accessible to the internet, while the private IP address is accessible only to resources in your Lightsail account in the same AWS Region.
Note
The private IP address of your instance can be accessible to other AWS resources in the same AWS Region, but outside of your Lightsail account, if you enable VPC peering. For more information, see Set up Amazon VPC peering to work with AWS resources outside of Lightsail.
The IP addresses of your instance are displayed in the following areas of the Lightsail console:
-
The following example shows the public IP address of an instance on the Lightsail home page.
-
The following example shows the public and private IP addresses of an instance in the header area of the instance management page.
-
The following example shows the public and private IP addresses of an instance on the Networking tab of the instance management page.
Keep the following in mind when using the IPv4 addresses of your instances:
-
The public IP address of your instance might change. Give your instance an IP address that never changes by attaching a static IP to it. For more information, see the Static IP addresses for instances section of this guide.
-
Lightsail uses IPv4 addresses by default. However, You can optionally enable IPv6 for some Lightsail resources that were created before January 12, 2021. Resources created on or after January 12, 2021, have IPv6 enabled by default. For more information, see the IPv6 for instances, container services, CDN distributions, and load balancers section of this guide.
-
Add rules to your instance firewall to control the traffic that is allowed to connect to it. For more information, see Instance firewalls.
Static IPv4 addresses for instances
The default public IPv4 address that is assigned to your instance when you create it will change when you stop and start your instance. You can optionally create and attach a static IPv4 address to your instance. The static IPv4 address replaces the default public IPv4 address of your instance, and it stays the same when you stop and start your instance. You can attach one static IP to an instance. For more information, see Create a static IP and attach it to an instance.
After you create a static IP, and attach it to your instance, it is displayed in the following areas of the Lightsail console:
-
The following example shows the static IP address of an instance on the Lightsail home page. The thumbtack icon signifies that the public IP address is static.
-
The following example shows the static IP address of an instance in the header area of the instance management page. The thumbtack icon signifies that the public IP address is static.
-
The following example shows the static IP address of an instance on the Networking tab of the instance management page. The default public IP address is no longer listed, and it has been replaced by the static IP address. The thumbtack icon signifies that the public IP address is static.
-
You can view all of the static IPs that you've created by going to the Networking tab of the Lightsail home page as shown in the following example.
IPv6 for instances, container services, CDN distributions, and load balancers
IPv6 is enabled by default for Lightsail instances, container services, CDN distributions, and load balancers created on or after January 12, 2021. You can optionally enable IPv6 for those resources that were created before January 12, 2021. When you enable IPv6 for a specific resource, Lightsail automatically assigns an IPv6 address to that resource; you cannot choose or specify the IPv6 address yourself. For more information, see Enable or disable IPv6.
You can also create an IPv6-only instance. An IPv6-only instance can communicate publicly over IPv6 only and does not have a public IPv4 address. For more information, see Configure IPv6-only networking for Lightsail instances
Your instance's IPv6 address is displayed in the following areas of the Lightsail console:
-
The following example shows the IPv6 address of an instance on the Lightsail home page.
-
The following example shows the IPv6 address of a resource in the header area of the resource's management page.
-
The following example shows the IPv6 address of a resource on the Networking tab of the resource management page.
Keep the following in mind when you enable and use IPv6 for your resources:
-
Your resources can communicate over IPv4 and IPv6 (in dual-stack mode) when you enable IPv6 for a resource, or over IPv4 only.
-
When you enable IPv6 for a resource, Lightsail automatically assigns an IPv6 address to that resource; you cannot choose or specify the IPv6 address yourself. When you enable IPv6 for a resource, it begins accepting network traffic over the IPv6 protocol.
-
The IPv6 address for an instance persists when you stop and start your instance. It's released only when you delete your instance, or disable IPv6 for your instance. You cannot get the IPv6 address back after you perform either of those actions.
-
All IPv6 addresses that are assigned to your instances are public and reachable over the internet. There are no private IPv6 addresses that are assigned to your instances.
-
IPv4 and IPv6 addresses for instances are independent of each other; you must configure instance firewall rules separately for IPv4 and IPv6. For more information, see Instance firewalls.
-
Not all instance blueprints available in Lightsail are automatically configured for IPv6 when IPv6 is enabled. Instances that use the following blueprints require additional configuration steps after you enable IPv6 for them:
-
cPanel – For more information, see Configure IPv6 for cPanel instances.
-
Debian 8 – For more information, see Configure IPv6 for Debian 8 instances.
-
GitLab – For more information, see Configure IPv6 for GitLab instances.
-
Nginx – For more information, see Configure IPv6 for Nginx instances.
-
Plesk – For more information, see Configure IPv6 for Plesk instances.
-
Ubuntu 16 – For more information, see Configure IPv6 for Ubuntu 16 instances.
Note
PrestaShop does not currently support IPv6 addresses. You can enable IPv6 for the instance, but the PrestaShop software will not respond to requests over the IPv6 network.
-