# Day 41: Setting up an Application Load Balancer with AWS EC2

![](https://user-images.githubusercontent.com/115981550/218143557-26ec33ce-99a7-4db6-a46f-1cf48ed77ae0.png align="center")

### Task :Create an Application Load Balancer (ALB) in EC2 using the AWS Management Console.

Let's dive right in!

To create an ALB, we'll need a couple of things: EC2 instances and a target group.

1\. Creating a target group:

Go to the EC2 dashboard and click on "Target Groups" in the left panel.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686090529938/8ba7b5e4-7d65-45d7-8508-0a1ce1b7ab41.png align="center")

* Click on "Create target group."
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686090596496/74a72e5f-e73b-41b2-83c8-24b767a68bf3.png align="center")

* Select "Instances" and give your target group a name.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686090623572/cc8b5e80-0f0b-40b5-9ce9-2623dc68b0de.png align="center")

* Click "Next" and select the instances you want to add to the load balancer.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686090684992/e893f61a-8af4-4d6b-b720-84e4687667a0.png align="center")

* Create the target group.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686090799864/dd5b1963-8381-43d1-bfbe-a58c5faa3fc2.png align="center")

Creating the Application Load Balancer:

* From the left panel, select "Load Balancers."
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686090931033/8780c2ea-ed5a-4454-85e1-44cceb7e19d8.png align="center")

* Click on "Create Load Balancer" and choose "Application Load Balancer."
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686090833130/44ec6917-a9dd-4d29-9991-b582e8d5f8c3.png align="center")

* Enter a name for your load balancer and select "Internet-facing" to allow external access.
    

* Choose the desired availability zones to scale your web app.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686090970272/625ab62f-7533-43da-995a-bbcc2c80c68c.png align="center")

* For security purposes, create a new security group for the load balancer and set inbound rules accordingly.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686091035263/dcdb9562-25df-452c-9ea7-632be52cad89.png align="center")

* Select the just created security group for the load balancer.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686091139017/f0e48264-4ac1-41a8-bac9-0c6c6297f902.png align="center")

* Choose the target group you created earlier.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686091178306/5476575b-8ae0-4a8a-91c0-84bd90d7b090.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686091219369/818e753d-5b39-4f51-b7f8-affb4a3a6613.png align="center")

That's it! You've successfully created your Application Load Balancer. Make sure the state of the ALB changes to "Active" from "Provisioning." You can test the load balancing by using the DNS provided.

Remember, the ALB will handle the load balancing for your web app automatically.

That's was it for today.See you tomorrow.
