DEV Community

Cover image for Create And Deploy A Webapp On AWS Using CLI
Abisola Adesegun
Abisola Adesegun

Posted on

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.

Image of Datadog

Learn how to monitor AWS container environments at scale

In this eBook, Datadog and AWS share insights into the changing state of containers in the cloud and explore why orchestration technologies are an essential part of managing ever-changing containerized workloads.

Download the eBook

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more