Automating website deployment on AWS EC2 using a simple Bash script.
This project sets up an Apache web server, copies your website file (index.html), and makes it accessible via the EC2 Public IPv4 address — all with a single command.
Deploying a website on AWS EC2 often requires multiple manual steps like updating the system, installing a web server, configuring permissions, and starting services.
This project simplifies the process by using a single Bash script (deploy.sh) that automates everything.
It is designed for beginners and developers who want a quick way to host a static website on an EC2 instance without worrying about complex configurations.
- One-command automated deployment on AWS EC2
- Installs and configures Apache web server automatically
- Copies your
index.htmlfile to the server’s web root - Makes your website accessible using the EC2 Public IPv4 address
- Beginner-friendly and lightweight project
- Amazon EC2 → For hosting the website on the cloud.
- Apache HTTP Server → As the web server to serve the HTML file.
- Bash Script → For automating the deployment process.
Follow these steps to set up and run the project on your EC2 instance:
-
Launch an EC2 instance
- Use Amazon Linux 2.
- Allow inbound rules for HTTP (port 80) and SSH (port 22).
-
Connect to your EC2 instance
ssh -i your-key.pem ec2-user@your-ec2-public-ip
-
Clone this repository
git clone https://github.com/Nishika10/AutoEC2-Web-Deployment.git cd AutoEC2-Web-Deployment -
Place your website file
- Replace the provided index.html with your own HTML file (keep the same name).
- Run the deployment script
chmod +x deploy.sh ./deploy.sh
- View your website
-
Open your EC2 Public IPv4 address in the browser:
- Connect to your EC2 instance via SSH.
- Clone this repository and place your
index.htmlfile in the project folder. - Run the deployment script:
./deploy.sh
- Once the script finishes, open your EC2 Public IPv4 address in the browser:
This project is deployed on:
- AWS EC2 (Amazon Linux 2)
- Apache Web Server for serving static content
- Bash Script (
deploy.sh) to automate the entire process
With a single command, the script installs Apache, configures it, copies your website file (index.html), and makes the site accessible using your EC2 Public IPv4 address.
Here’s an example of the deployed website:
- Gained hands-on experience with AWS EC2 and deploying a website on the cloud.
- Learned how to automate server setup using Bash scripting.
- Understood the importance of Apache configuration for hosting static websites.
- Improved knowledge of cloud infrastructure automation.
This project is licensed under the MIT License - see the LICENSE file for details.
Nishika Jaiswal
Aspiring Cloud & DevOps Engineer
