# Steps to Enable Horizontal Auto Scaling for AWS Web Applications

### Introduction

AWS Auto Scaling monitors your applications and automatically adjusts capacity to maintain steady, predictable performance at the lowest possible cost. Using AWS Auto Scaling, it’s easy to setup application scaling for multiple resources across multiple services in minutes.

Horizontal auto scaling in AWS is a way to scale a system by adding more machines or servers to an auto scaling group.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722210017215/1c56dd39-4f23-4851-8952-5a6aa7aee15d.png align="center")

### Follow these steps to horizontally auto scale an AWS web application

1. Open the **AWS Management Console** and navigate to the **EC2 dashboard**.
    
2. Create an instance and host a website, you can use an [EC2 instance with Windows](https://arishahmad.hashnode.dev/hosting-your-website-on-amazon-ec2-with-windows-a-complete-guide) or an [EC2 instance with Linux](https://arishahmad.hashnode.dev/hosting-your-website-launching-aws-ec2-instance-with-linux).
    
3. Create an Image of this instance, you can use [Create AMIs from EC2 Instances](https://arishahmad.hashnode.dev/create-amazon-machine-images-amis-from-ec2-instances-an-easy-guide).
    
4. In the left navigation panel, choose **Auto Scaling Groups** under **Auto Scaling.**
    
5. Click **Create Auto Scaling group**.
    
6. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722196777803/ec2dd906-7d71-4e81-acfd-9f0ba0bd4cea.png align="center")
    
    Write a suitable name for the Auto scaling group.
    
7. Scroll down and click **Create a launch template**. A new tab will open up.
    
8. Write a suitable name for the template.
    
9. Scroll and click on **My AMIs** under **Application and OS Images (Amazon Machine Image).**
    
10. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722200501954/b15d697d-2ad7-4b23-89ad-0d9e3cb13573.png align="center")
    
    Select the newly created AMI.
    
11. Select any free tier instance type (Example: t2.micro).
    
12. Select any **Key pair**.
    
13. Select any **Security group** under **Network settings**
    
14. Now click on **Create the launch template**.
    
15. Please go ahead and return to the previous tab and refresh the launch template.
    
16. Now you can select the newly created launch template from the drop-down.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722200727179/f68eed56-c419-430d-844f-dd6c68b9dd24.png align="center")
    
17. Click **Next**.
    
18. Under **Network** select all the **availability zones** in which you want your instances.
    
19. Now click **Next**.
    
20. Scroll and hit **Next**.
    
21. Under the Group Size set **Desired capacity** to 3.
    
    **Desired capacity:** Represents the initial capacity of the Auto Scaling group at the time of creation. An Auto Scaling group attempts to maintain the desired capacity. It starts by launching the number of instances that are specified for the desired capacity, and maintains this number of instances as long as there are no scaling policies or scheduled actions attached to the Auto Scaling group.
    
22. Under Scaling set **Min desired capacity** to 2 and **Max desired capacity** to 5.
    
    **Minimum desired capacity:** This represents the minimum group size. When scaling policies are set, they cannot decrease the group's desired capacity lower than the minimum capacity.
    
    **Maximum desired capacity:** Represents the maximum group size. When scaling policies are set, they cannot increase the group's desired capacity higher than the maximum capacity.
    
23. Now click on the **Target tracking scaling policy**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722201427034/0785705f-12be-4651-960e-1299985e1bd3.png align="center")
    
24. Now scroll and hit **Next**.
    
25. Now click **Next** -&gt; **Next**.
    
26. Review all the changes made.
    
27. Click on **Create auto scaling group**.
    
28. You can go to the instances to check the creation on the EC2 instance with the same hosted website. To check, hit the **Public IPv4 address** of all the new instances.
    
29. To delete the auto-scaling group, select the group -&gt; **Actions** -&gt; **Delete** -&gt; type delete -&gt; **Delete.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722202226799/df951f43-c60d-4b0d-953a-7566e05e31bc.png align="center")
    
30. To delete the template, select the launch template -&gt; **Actions** -&gt; **Delete template** -&gt; type delete -&gt; **Delete**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722202291401/94057f9c-ed36-4fba-8da8-7a88d26ce808.png align="center")
