Launch an Amazon EC2 instance - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Launch an Amazon EC2 instance

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

You incur charges for your instance 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 Amazon 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 Amazon 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

Launch EC2 instances using a launch template

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 Amazon Web Services Marketplace.

Amazon EC2 console

Launch an Amazon EC2 instance from an Amazon Web Services Marketplace AMI

Use an AMI that you specify.

Amazon CLI

Launching, listing, and deleting Amazon EC2 instances in the Amazon CLI

Use an AMI that you specify. Amazon Tools for Windows PowerShell

Launch an Amazon EC2 Instance Using 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.

Amazon CLI

EC2 Fleet and Spot Fleet

Use a Amazon CloudFormation template to specify an instance.

Amazon CloudFormation

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

Use a language-specific Amazon SDK to launch an instance. Amazon SDK

Amazon SDK for .NET

Amazon SDK for C++

Amazon SDK for Go

Amazon SDK for Java

Amazon SDK for JavaScript

Amazon SDK for PHP V3

Amazon SDK for Python

Amazon SDK for Ruby V3