Launch an Amazon EC2 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 Tiert2.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). You incur charges for your instance or usage that counts against your Free Tier limits while the
instance is running, even if it remains idle. For more information, see Amazon EC2 pricing
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 Get started with 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.
-
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.
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.
Depending on how you plan to connect to your instance, you might want to make certain configurations while launching your instance. These configurations could include specifying inbound security group rules for certain traffic or associating an instance profile role. For more information on the connection methods you can use to connect and their requirements, see Connect to your EC2 instance.
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.
When you're finished with an instance, to avoid incurring unnecessary costs, be sure to terminate it. For more information, see Terminate Amazon EC2 instances.
The following methods are some of the ways that you can launch an instance.
Method | Tool | Documentation |
---|---|---|
Use the launch instance wizard to specify the launch parameters. |
Amazon EC2 console |
Launch an EC2 instance using the launch instance wizard in the console |
Create a launch template and launch the instance from the launch template. |
Amazon EC2 console | |
Use an existing instance as the base. | Amazon EC2 console |
Launch an EC2 instance using details from an existing instance |
Use an AMI that you purchased from the AWS Marketplace. |
Amazon EC2 console | |
Use an AMI that you specify. |
AWS CLI |
Launch, list, and close Amazon EC2 instances for the AWS CLI |
Use an AMI that you specify. | AWS Tools for Windows PowerShell | |
Use EC2 Fleet to provision capacity across different EC2 instance types and Availability Zones, and across On-Demand Instance, Reserved Instance, and Spot Instance purchasing options. |
AWS CLI | |
Use a AWS CloudFormation template to specify an instance. |
AWS CloudFormation |
AWS::EC2::Instance in the AWS CloudFormation User Guide |
Use a language-specific AWS SDK to launch an instance. | AWS SDK |