Launch your instance - Amazon Elastic Compute Cloud

Launch your instance

An instance is a virtual server in the AWS Cloud. You launch an instance from an Amazon Machine Image (AMI). The AMI provides the operating system, application server, and applications for your instance.

When you sign up for AWS, you can get started with Amazon EC2 for free using the AWS Free Tier. You can use the free tier to launch and use a t2.micro instance for free for 12 months (in Regions where t2.micro is unavailable, you can use a t3.micro instance under the free tier). If you launch an instance that is not within the free tier, you incur the standard Amazon EC2 usage fees for the instance. For more information, see Amazon EC2 pricing.

You can launch an instance using the following methods.

Method Documentation

[Amazon EC2 console] Use the launch instance wizard to specify the launch parameters.

Launch an instance using the old launch instance wizard

[Amazon EC2 console] Create a launch template and launch the instance from the launch template.

Launch an instance from a launch template

[Amazon EC2 console] Use an existing instance as the base.

Launch an instance using parameters from an existing instance

[Amazon EC2 console] Use an AMI that you purchased from the AWS Marketplace.

Launch an AWS Marketplace instance

[AWS CLI] Use an AMI that you select.

Using Amazon EC2 through the AWS CLI

[AWS Tools for Windows PowerShell] Use an AMI that you select.

Amazon EC2 from the AWS Tools for Windows PowerShell

[AWS CLI] Use EC2 Fleet to provision capacity across different EC2 instance types and Availability Zones, and across On-Demand Instance, Reserved Instance, and Spot Instance purchase models.

EC2 Fleet

[AWS CloudFormation] Use a AWS CloudFormation template to specify an instance.

AWS::EC2::Instance in the AWS CloudFormation User Guide

[AWS SDK] Use a language-specific AWS SDK to launch an instance.

AWS SDK for .NET

AWS SDK for C++

AWS SDK for Go

AWS SDK for Java

AWS SDK for JavaScript

AWS SDK for PHP V3

AWS SDK for Python

AWS SDK for Ruby V3

Note

To launch an EC2 instance into an IPv6-only subnet, you must use Instances built on the Nitro System.

Note

When launching an IPv6-only instance, it is possible that DHCPv6 may not immediately provide the instance with the IPv6 DNS name server. During this initial delay, the instance may not be able to resolve public domains.

For instances running on Amazon Linux 2, if you want to immediately update the /etc/resolv.conf file with the IPv6 DNS name server, run the following cloud-init directive at launch:

#cloud-config bootcmd: - /usr/bin/sed -i -E 's,^nameserver\s+[\.[:digit:]]+$,nameserver fd00:ec2::253,' /etc/resolv.conf

Another option is to change the configuration file and re-image your AMI so that the file has the IPv6 DNS name server address immediately on booting.

When you launch your instance, you can launch your instance in a subnet that is associated with one of the following resources:

  • An Availability Zone - This option is the default.

  • A Local Zone - To launch an instance in a Local Zone, you must opt in to the Local Zone, and then create a subnet in the zone. For more information, see Local Zones

  • A Wavelength Zone - To launch an instance in a Wavelength Zone, you must opt in to the Wavelength Zone, and then create a subnet in the zone. For information about how to launch an instance in a Wavelength Zone, see Get started with AWS Wavelength in the AWS Wavelength Developer Guide.

  • An Outpost - To launch an instance in an Outpost, you must create an Outpost. For information about how to create an Outpost, see Get Started with AWS Outposts in the AWS Outposts User Guide.

After you launch your instance, you can connect to it and use it. To begin, the instance state is pending. When the instance state is running, the instance has started booting. There might be a short time before you can connect to the instance. Note that bare metal instance types might take longer to launch. For more information about bare metal instances, see Instances built on the Nitro System.

The instance receives a public DNS name that you can use to contact the instance from the internet. The instance also receives a private DNS name that other instances within the same VPC can use to contact the instance. For more information about connecting to your instance, see Connect to your Windows instance.

When you are finished with an instance, be sure to terminate it. For more information, see Terminate your instance.