When you launch an instance, you must select a configuration, known as an Amazon Machine Image (AMI). An AMI contains the information required to create a new instance. For example, an AMI might contain the software required to act as a web server: for example, Linux, Apache, and your web site.
To launch an instance:
Open the Amazon EC2 console.
In the navigation bar at the top of the screen, the current region is displayed. Select the region for the instance. This choice is important because some Amazon EC2 resources can be shared between regions, while others can’t. Select the region that meets your needs. For more information, see Resource Locations.
Launch instance start
From the Amazon EC2 console dashboard, click Launch Instance.
On the Choose an Amazon Machine Image (AMI) page, choose an AMI as follows:
Select the type of AMI to use in the left panel:
A selection of popular AMIs to help you get started quickly. To ensure that you select an AMI that is eligible for the free tier, click Free tier only in the left panel. (Notice that these AMIs are marked Free tier eligible.)
The private AMIs that you own, or private AMIs that have been shared with you.
An online store where you can buy software that runs on AWS, including AMIs. For more information about launching an instance from the AWS Marketplace, see Launching an AWS Marketplace Instance.
The AMIs that AWS community member have made available for others to use. To filter the list of AMIs by operating system, select the appropriate check box under Operating system. You can also filter by architecture and root device type.
Check the Root device type listed for each AMI. Notice which AMIs are the type that you need, either ebs (backed by Amazon EBS) or instance-store (backed by instance store). For more information, see Storage for the Root Device.
Check the Virtualization type listed for each AMI. Notice which AMIs are the type that you need, either hvm or paravirtual. For example, some instance types require HVM. For more information, see Linux AMI Virtualization Types.
Choose an AMI that meets your needs, and then click Select.
On the Choose an Instance Type page, select the hardware configuration and size of the instance to launch. Larger instance types have more CPU and memory. For more information, see Instance Types.
To remain eligible for the free tier, select the t2.micro instance type.
By default, the wizard displays current generation instance types, and selects the first available instance type based on the AMI that you selected. To view previous generation instance types, select All generations from the filter list.
(If you are new to AWS and would like to set up an instance quickly for testing purposes, you can click Review and Launch at this point to accept default configuration settings, and launch your instance. Otherwise, to configure your instance further, click Next: Configure Instance Details.)
On the Configure Instance Details page, change the following settings as necessary (expand Advanced Details to see all the settings), and then click Next: Add Storage:
Number of instances: Enter the number of instances to launch.
Purchasing option: Select Request Spot Instances to launch a Spot Instance. For more information, see Spot Instances.
Your account may support the EC2-Classic and EC2-VPC platforms, or EC2-VPC only. To find out which platform your account supports, see Supported Platforms. If your account supports EC2-VPC only, you can launch your instance into your default VPC or a nondefault VPC. Otherwise, you can launch your instance into EC2-Classic or a nondefault VPC.
You must launch a T2 instance into a VPC. If you don’t have a VPC, you can let the wizard create one for you.
To launch into EC2-Classic:
Network: Select Launch into EC2-Classic.
Availability Zone: Select the Availability Zone to use. To let AWS choose an Availability Zone for you, select No preference.
To launch into a VPC:
Network: Select the VPC, or to create a new VPC, click Create new VPC to go the Amazon VPC console. When you have finished, return to the wizard and click Refresh to load your VPC in the list.
Subnet: Select the subnet into which to launch your instance. If your account is EC2-VPC only, select No preference to let AWS choose a default subnet in any Availability Zone. To create a new subnet, click Create new subnet to go to the Amazon VPC console. When you are done, return to the wizard and click Refresh to load your subnet in the list.
Auto-assign Public IP: Specify whether your instance receives a public IP address. By default, instances in a default subnet receive a public IP address and instances in a nondefault subnet do not. You can select Enable or Disable to override the subnet’s default setting. For more information, see Public IP Addresses and External DNS Hostnames.
IAM role: If applicable, select an AWS Identity and Access Management (IAM) role to associate with the instance. For more information, see IAM Roles for Amazon EC2.
Shutdown behavior: Select whether the instance should stop or terminate when shut down. For more information, see Changing the Instance Initiated Shutdown Behavior.
Enable termination protection: Select this check box to prevent accidental termination. For more information, see Enabling Termination Protection for an Instance.
Monitoring: Select this check box to enable detailed monitoring of your instance using Amazon CloudWatch. Additional charges apply. For more information, see Monitoring Your Instances with CloudWatch.
EBS-Optimized instance: An Amazon EBS-optimized instance uses an optimized configuration stack and provides additional, dedicated capacity for Amazon EBS I/O. If the instance type supports this feature, select this check box to enable it. Additional charges apply. For more information, see Amazon EBS–Optimized Instances.
Tenancy: If you are launching your instance into a VPC, you can select Dedicated tenancy to run your instance on isolated, dedicated hardware. Additional charges apply. For more information, see Dedicated Instances in the Amazon VPC User Guide.
Network interfaces: If you are launching an instance into a VPC and you did not select No Preference for your subnet, you can specify up to two network interfaces in the wizard. Click Add IP to assign more than one IP address to the selected interface. For more information about network interfaces, see Elastic Network Interfaces (ENI). If you selected the Public IP check box above, you can only assign a public IP address to a single, new network interface with the device index of eth0. For more information, see Assigning a Public IP Address.
Kernel ID: (Only valid for paravirtual (PV) AMIs) Select Use default unless you want to use a specific kernel.
RAM disk ID: (Only valid for paravirtual (PV) AMIs) Select Use default unless you want to use a specific RAM disk. If you have selected a kernel, you may need to select a specific RAM disk with the drivers to support it.
Placement group: A placement group is a logical grouping for your cluster instances. Select an existing placement group, or create a new one. This option is only available if you’ve selected an instance type that supports placement groups. For more information, see Placement Groups.
User data: You can specify user data to configure an instance during launch, or to run a configuration script. To attach a file, select the As file option and browse for the file to attach.
On the Add Storage page, you can specify volumes to attach to the instance besides the volumes specified by the AMI (such as the root device volume). You can change the following options, then click Next: Tag Instance when you have finished:
Type: Select instance store or Amazon EBS volumes to associate with your instance. The type of volume available in the list depends on the instance type you’ve chosen. For more information, see Amazon EC2 Instance Store and Amazon EBS Volumes.
Device: Select from the list of available device names for the volume.
Snapshot: Enter the name or ID of the snapshot from which to restore a volume. You can also search for public snapshots by typing text into the Snapshot field. Snapshot descriptions are case-sensitive.
Size: For Amazon EBS-backed volumes, you can specify a storage size. Note that even if you have selected an AMI and instance that are eligible for the free tier, you need to keep under 30 GiB of total storage to stay within the free tier.
Linux AMIs require GPT partition tables and GRUB 2 for boot volumes 2 TiB (2048 GiB) or larger. Many Linux AMIs today use the MBR partitioning scheme, which only supports up to 2047 GiB boot volumes. If your instance does not boot with a boot volume that is 2 TiB or larger, the AMI you are using may be limited to a 2047 GiB boot volume size. Non-boot volumes do not have this limitation on Linux instances.
If you increase the size of your root volume at this point (or any other volume created from a snapshot), you need to extend the file system on that volume in order to use the extra space. For more information about extending your file system after your instance has launched, see Expanding the Storage Space of an EBS Volume on Linux.
Volume Type: For Amazon EBS volumes, select either a General Purpose (SSD), Provisioned IOPS (SSD), or Magnetic volume. For more information, see Amazon EBS Volume Types.
If you select a Magnetic boot volume, you’ll be prompted when you complete the wizard to make General Purpose (SSD) volumes the default boot volume for this instance and future console launches. (This preference persists in the browser session, and does not affect AMIs with Provisioned IOPS (SSD) boot volumes.) We recommended that you make General Purpose (SSD) volumes the default because they provide a much faster boot experience and they are the optimal volume type for most workloads. For more information, see Amazon EBS Volume Types.
Some AWS accounts created before 2012 might have access to Availability Zones in us-east-1, us-west-1, or ap-northeast-1 that do not support SSD volumes such as Provisioned IOPS (SSD) and General Purpose (SSD). If you are unable to create an SSD volume (or launch an instance with an SSD volume in its block device mapping) in one of these regions, try a different Availability Zone in the region. You can verify that an Availability Zone supports General Purpose (SSD) and Provisioned IOPS (SSD) volumes by creating a 1 GiB General Purpose (SSD) volume in that zone.
IOPS: If you have selected a Provisioned IOPS (SSD) volume type, then you can enter the number of I/O operations per second (IOPS) that the volume can support.
Delete on Termination: For Amazon EBS volumes, select this check box to delete the volume when the instance is terminated. For more information, see Preserving Amazon EBS Volumes on Instance Termination.
Encrypted: Select this check box to encrypt new Amazon EBS volumes. Amazon EBS volumes that are restored from encrypted snapshots are automatically encrypted. Encrypted volumes may only be attached to supported instance types. (Encrypted boot volumes are not supported at this time.)
On the Tag Instance page, specify tags for the instance by providing key and value combinations. Click Create Tag to add more than one tag to your resource. Click Next: Configure Security Group when you are done.
On the Configure Security Group page, use a security group to define firewall rules for your instance. These rules specify which incoming network traffic is delivered to your instance. All other traffic is ignored. (For more information about security groups, see Amazon EC2 Security Groups for Linux Instances.) Select or create a security group as follows, and then click Review and Launch.
To select an existing security group:
Click Select an existing security group. Your security groups are displayed. (If you are launching into EC2-Classic, these are security groups for EC2-Classic. If you are launching into a VPC, these are security group for that VPC.)
Select a security group from the list.
(Optional) You can’t edit the rules of an existing security group, but you can copy them to a new group by clicking Copy to new. Then you can add rules as described in the next procedure.
To create a new security group:
Click Create a new security group. The wizard automatically defines the launch-wizard-x security group.
(Optional) You can edit the name and description of the security group.
The wizard automatically defines an inbound rule to allow to you connect to your instance over SSH (port 22) for Linux or RDP (port 3389) for Windows.
This rule enables all IP addresses (0.0.0.0/0) to access your instance over the specified port. This is acceptable for this short exercise, but it’s unsafe for production environments. You should authorize only a specific IP address or range of addresses to access your instance.
You can add rules to suit your needs. For example, if your instance is a web server, open ports 80 (HTTP) and 443 (HTTPS) to allow Internet traffic.
To add a rule, click Add Rule, select the protocol to open to network traffic, and then specify the source. Select My IP from the Source list to let the wizard add your computer’s public IP address. However, if you are connecting through an ISP or from behind your firewall without a static IP address, you need to find out the range of IP addresses used by client computers.
On the Review Instance Launch page, check the details of your instance, and make any necessary changes by clicking the appropriate Edit link.
When you are ready, click Launch.
In the Select an existing key pair or create a new key pair dialog box, you can choose an existing key pair, or create a new one. For example, select Choose an existing key pair, then select the key pair you created when getting set up.
To launch your instance, select the acknowledgment check box, then click Launch Instances.
If you select the Proceed without key pair option, you won’t be able to connect to the instance unless you choose an AMI that is configured to allow users another way to log in.