Create And Deploy A Webapp On AWS Using CLI

mabis12

Abisola Adesegun

Posted on October 18, 2024

Create And Deploy A Webapp On AWS Using CLI

Table of Contents
Step 1: Create an instance
Step 2: Connect the instance using Public IP Address
Step 3: Install Apache
Step 4: Deploy web application
Step 5: Verify the deployment
Step 6: Clean up
Step 7: Conclusion

Creating and deploying a web app using GitHub repo and AWS involves a few key steps, including setting up your AWS environment, configuring GitHub Actions, and automating the deployment process. Below is a general guide to achieve this.

Step 1: Create an instance

  • Click instances on the left pane then click launch and configure it.

Image description

  • Select Ubuntu as the image

Image description

  • Generate the key-pair

Image description

Image description

  • Allow ssh and HTTP traffic from the internet

Image description

  • Leave Networking, storage and others at default

Image description

  • Launch the instance then click the instance id and we have:

Image description

  • Select the instance created to see all the instance info

Image description

Image description

Step 2: Connect the instance using Public IP Address
Open your VS Code, select bash and run the below code

Image description

Image description

Step 3: Install Apache

  • Update the independences in the VM

Image description

Image description

  • Then install the Apache running the below command

Image description

Image description

  • Start and enable Apache

Image description

Image description

Image description

Step 4: Deploy web application

  • Confirm that git is installed by running:

Image description

Image description

  • Clone the git

Image description

  • Enter into Apache file

Image description

Image description

  • Move everything in this direcory to html directory

Image description

Image description

Step 5: Verify the deployment
Verify on a new browser using the Public IP Address

Image description

Step 6: Clean up
Select the instance, go to Instance State and select Terminate

Image description

Image description

Step 7: Conclusion
You have successfully created and deployed a web application on AWS using the AWS CLI. This method allows you to automate your deployment.

💖 💪 🙅 🚩
mabis12
Abisola Adesegun

Posted on October 18, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related