How to Create EC2 Launch Templates in AWS


In AWS, a Launch Template is a reusable configuration that defines how an EC2 instance should be created. It allows you to save common instance settings—such as the AMI, instance type, key pair, security groups, and storage volumes etc. —and use them whenever you launch a new instance.

Launch Templates are especially useful when working with Auto Scaling Groups, where all instances need to follow the same setup. They are also helpful for testing and development, where you may need to create identical EC2 instances multiple times.

Launch Templates also support versioning, which means you can update the configuration later without changing or breaking instances that are already running. In addition, a Launch Template can be shared across teams or AWS accounts (with the right permissions), making it easier to maintain consistent setups in larger environments.

Overall, Launch Templates help reduce manual work, avoid configuration mistakes, and keep EC2 deployments consistent.

In this guide, I will teach you how to create EC2 Launch Templates in AWS.

Creating Your First Launch Template

Step 01: Sign in to AWS Management Console

As covered in my previous guide on launching EC2 instances, start by logging into the AWS Management Console and searching for 'EC2' in the services menu.

If you're doing this for the first time, here's what it looks like:




Once you're on the EC2 Dashboard, look at the left navigation menu and scroll down until you see, "Launch Templates" under the "Instances" section, and click on it.


This will take you to the interface for creating and managing new launch templates. If you are doing this for the first time, unlike the image shown below your created launch template list will be empty. From here click on the yellow button "Create launch template" on the top right corner which will take you to the launch template creation interface.

First, you need to give your template a name. Enter a suitable name for your template in the "Launch template name" field.  While you can leave the rest of the fields in the "Launch template name and description" section empty as name is the only required field, here is what they do. 
  • Template version description: For adding a short description of what this specific version of template is used for.
  • Auto Scaling guidance: Select this if you are planning to use this launch template for auto scaling, as it will inform you on what settings are required for a template to be used for auto scaling.
  • Template tags: Similar to when creating an EC2 instance, you can add tags that allow you to uniquely identify your launch template.
  • Source template: This option allows you to create the new template based on another existing launch template.

Now we need to select an OS image (Amazon Machine Image) for the template. There are multiple options when selecting an OS image. While you can create a launch template without an AMI (useful for very generic base templates), almost all real-world uses — especially with Auto Scaling Groups — require selecting a valid AMI.
  • Don't include in launch template: Create the launch template without selecting an OS image (if you are creating the launch template for auto scaling, selecting an OS image is required).


  • Recently launched: Select an image from the images you recently used when launching EC2 instances


  • Currently in use: Select an image from the images used for EC2 instances which are currently in use.



  • Quick Start: Select an OS image from the most commonly used images.


Then it is time to select an "Instance type" which decides the CPU and RAM allocated to an instance created using this template, and the hourly charge. You can leave it without selecting one as well so that you can set it up during the instance creation, but it is better to select one if your intent is to create multiple EC2 instances with the same configuration over and over again.


After that you should configure a "Key pair" to securely connect to your EC2 instance. If you leave this without including one, make sure to configure it during the EC2 instance launch because otherwise you might encounter issues when connecting to your new EC2 instances created based on this template.


In the section "Network settings", you can configure the Subnet, Availability Zone, Firewall (Security groups).
  • Subnet: Configure this if you want all the EC2 instances created using this template to be in a specific subnet (you can leave it not selecting one).
  • Availability Zone: Configure this if you want all the EC2 instances created using this template to be in a specific availability zone such as us-east-1a or us-east-1b etc. (you can leave it not selecting one)
Note: Region is a specific geographical area, while an availability zone is a collection of one or more datacenters within that specific region
  • Firewall (Security Group): This defines the firewall rules for your EC2 instances created using this launch template. While it might be ok to not select a subnet or an availability zone, it is important to add a security group as this decides whether you can connect to your instance or not.
You can skip the advanced network configuration for now.


Storage volume defines the capacity of the storage volumes attached to an instance, and whether they are encrypted or not. Depending on the OS image (AMI) you chose in previous steps, AWS provides a default setting. 

  • When a Linux AMI is selected

  • When a Windows AMI is selected
  • When no AMI is selected
You can leave the "Resource Tags" and "Advanced Configurations" with their default values. 
Note: The expandable Advanced details section at the bottom (you can skip it for your first simple template) is where many production-ready setups happen! 
You can configure things like:
  • User data — Add scripts (e.g., bash or PowerShell) that run automatically when the instance starts, great for installing software or configuring services.
  • IAM instance profile — Attach an IAM role so your applications can securely access other AWS services (like S3 or DynamoDB) without hardcoding credentials.
  • Detailed monitoring — Enable finer-grained CloudWatch metrics (1-minute intervals instead of 5).
  • Instance market options — Request Spot Instances for cost savings, or set up a mix of On-Demand and Spot for Auto Scaling Groups.
  • Instance metadata options — Control access to instance metadata service (IMDSv2) for better security (highly recommended to require IMDSv2).

  • Capacity Reservations or other advanced networking/storage tweaks.
These options make your templates much more powerful for real-world scaling, automation, and cost optimization.

Now click "Create launch template" button in the summary section on the top right hand corner.

Wait until the launch template is created, and click on the template ID to access and manage it.


You can manage the created template- launch an instance, modify the template, or delete the template etc. - by clicking on the "Actions" button and selecting the action you want.

Now, you have created your launch template and can use it for quickly creating multiple EC2 instances with set configurations, or for auto scaling purposes. If you think this guide was helpful please leave a comment and share this with others. 


Comments