<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Oluwatobiloba Oludare</title>
    <description>The latest articles on DEV Community by Oluwatobiloba Oludare (@oluwatobiloba_oludare1).</description>
    <link>https://dev.to/oluwatobiloba_oludare1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3231086%2F111fa266-6173-4be1-86fb-f1e59d60ea16.jpg</url>
      <title>DEV Community: Oluwatobiloba Oludare</title>
      <link>https://dev.to/oluwatobiloba_oludare1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oluwatobiloba_oludare1"/>
    <language>en</language>
    <item>
      <title>How I Containerized and Deployed a Dynamic Web Application on AWS using Docker &amp; Amazon ECS (Fargate)</title>
      <dc:creator>Oluwatobiloba Oludare</dc:creator>
      <pubDate>Wed, 25 Mar 2026 15:11:40 +0000</pubDate>
      <link>https://dev.to/oluwatobiloba_oludare1/how-i-containerized-and-deployed-a-dynamic-web-application-on-aws-using-docker-amazon-ecs-1e4i</link>
      <guid>https://dev.to/oluwatobiloba_oludare1/how-i-containerized-and-deployed-a-dynamic-web-application-on-aws-using-docker-amazon-ecs-1e4i</guid>
      <description>&lt;p&gt;As part of my DevOps learning journey, I worked on a hands-on project where I containerized a dynamic web application and deployed it on AWS using Docker and Amazon ECS (Fargate).&lt;/p&gt;

&lt;p&gt;This project helped me move from theory to real-world cloud implementation, covering networking, security, containerization, and deployment.&lt;/p&gt;

&lt;p&gt;In this article, I will walk through the exact steps I took.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Overview
&lt;/h2&gt;

&lt;p&gt;The goal was to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Containerize a dynamic web application using Docker&lt;/li&gt;
&lt;li&gt;Store the image in Amazon ECR&lt;/li&gt;
&lt;li&gt;Deploy the container using Amazon ECS (Fargate)&lt;/li&gt;
&lt;li&gt;Use an Application Load Balancer for traffic routing&lt;/li&gt;
&lt;li&gt;Securely connect to an RDS MySQL database&lt;/li&gt;
&lt;li&gt;Configure a production-like cloud environment&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Architecture Overview
&lt;/h2&gt;

&lt;p&gt;User → ALB → ECS (Fargate Containers) → RDS (MySQL Database)&lt;/p&gt;

&lt;p&gt;Supporting services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VPC (Networking)&lt;/li&gt;
&lt;li&gt;Security Groups (Access control)&lt;/li&gt;
&lt;li&gt;Secrets Manager (Credentials)&lt;/li&gt;
&lt;li&gt;ECR (Container registry)&lt;/li&gt;
&lt;li&gt;Route 53 (DNS)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81f5w108f3xt5reyzxgc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81f5w108f3xt5reyzxgc.png" alt=" " width="800" height="1422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; &lt;br&gt;
The user’s browser sends a request to the domain name, which is resolved by Route 53. The request is routed to an Application Load Balancer in the public subnet. The load balancer forwards the request to ECS containers running in private subnets through a target group. The container processes the request and communicates with the RDS database if needed, then the response travels back through the load balancer to the user.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔐 Step 1: Create a Secure VPC
&lt;/h2&gt;

&lt;p&gt;I started by creating a custom VPC with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Public subnets (for ALB)&lt;/li&gt;
&lt;li&gt;Private subnets (for ECS tasks and RDS)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This ensures that sensitive resources are not exposed to the internet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4hawj2rng3gw8i78jbl9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4hawj2rng3gw8i78jbl9.png" alt=" " width="800" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Configure Security Groups
&lt;/h2&gt;

&lt;p&gt;I implemented strict access control:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ALB Security Group&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allow HTTP (80) and HTTPS (443) from the internet&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Container Security Group&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allow traffic only from ALB&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;RDS Security Group&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allow MySQL (3306) only from:&lt;/li&gt;
&lt;li&gt;ECS containers&lt;/li&gt;
&lt;li&gt;Migration server&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Migration Server (EC2)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH access only via controlled security group&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;This setup ensures a secure, production-like environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft6uj211dksmd0cbmt87k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft6uj211dksmd0cbmt87k.png" alt=" " width="800" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Set Up RDS MySQL Database
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Created a DB subnet group using private subnets across multiple AZs&lt;/li&gt;
&lt;li&gt;Launched a MySQL database (Free Tier)&lt;/li&gt;
&lt;li&gt;Enabled auto-generated credentials&lt;/li&gt;
&lt;li&gt;Attached the appropriate security group&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I used MySQL because the application required structured data, relationships, and strong consistency. It works well with Amazon RDS and is easy to manage. The tradeoff is that it’s less flexible and harder to scale horizontally compared to NoSQL databases like MongoDB, so I would choose those alternatives for highly scalable or unstructured workloads.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F87u30mqjeicmqlzulnm1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F87u30mqjeicmqlzulnm1.png" alt=" " width="800" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Store Credentials in AWS Secrets Manager
&lt;/h2&gt;

&lt;p&gt;Instead of hardcoding credentials:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stored database username &amp;amp; password securely&lt;/li&gt;
&lt;li&gt;Created a named secret&lt;/li&gt;
&lt;li&gt;Allowed access via IAM roles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This improves security and best practices.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F510d54demrfmt1ifkd1e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F510d54demrfmt1ifkd1e.png" alt=" " width="800" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Data Migration Setup (EC2)
&lt;/h2&gt;

&lt;p&gt;To migrate application data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Launched an EC2 instance in a private subnet&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Attached an IAM role with access to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Secrets Manager&lt;/li&gt;
&lt;li&gt;S3&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Used &lt;strong&gt;user-data scripts&lt;/strong&gt; to automate migration&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3s9bwb0799eesedkomw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3s9bwb0799eesedkomw.png" alt=" " width="800" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚙️ Step 6: Configure AWS CLI
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Created an IAM user with required permissions&lt;/li&gt;
&lt;li&gt;Generated access keys&lt;/li&gt;
&lt;li&gt;Configured locally using:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws configure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 7: GitHub Integration
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Generated SSH key:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Added public key to GitHub&lt;/li&gt;
&lt;li&gt;Created a private repository and uploaded application code&lt;/li&gt;
&lt;li&gt;Generated a &lt;strong&gt;Personal Access Token (PAT)&lt;/strong&gt; and stored it securely&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsmenv1cm1e7hahm4jj4n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsmenv1cm1e7hahm4jj4n.png" alt=" " width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft360r3oyweanforerswc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft360r3oyweanforerswc.png" alt=" " width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🐳 Step 8: Dockerize the Application
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Created a Dockerfile for the application&lt;/li&gt;
&lt;li&gt;Structured project directory properly&lt;/li&gt;
&lt;li&gt;Built Docker image&lt;/li&gt;
&lt;li&gt;Pushed image to Amazon ECR&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This step converts the app into a portable container.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8xbjwzz8uop9sr2cs1g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8xbjwzz8uop9sr2cs1g.png" alt=" " width="800" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Step 9: Create Target Group
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Target type: IP&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configured health checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP codes: 200, 301, 302&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffkn1feprebw4y0s7ekc2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffkn1feprebw4y0s7ekc2.png" alt=" " width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 🔟: Create Application Load Balancer (ALB)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Internet-facing&lt;/li&gt;
&lt;li&gt;Attached to public subnets&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configured:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP → HTTPS redirect&lt;/li&gt;
&lt;li&gt;HTTPS listener with SSL certificate&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Linked to target group&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9blxhw55yrv4wmg8gcqs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9blxhw55yrv4wmg8gcqs.png" alt=" " width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 11: Create IAM Roles
&lt;/h2&gt;

&lt;p&gt;Created multiple roles for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ECS Task Execution&lt;/li&gt;
&lt;li&gt;ECS Task Role (S3, Logs, Secrets access)&lt;/li&gt;
&lt;li&gt;Load Balancer integration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This ensures least privilege access control.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7alqickxb7x47f51hn8k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7alqickxb7x47f51hn8k.png" alt=" " width="800" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 12: Create ECS Cluster (Fargate)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Launch type: Fargate (serverless)&lt;/li&gt;
&lt;li&gt;Enabled Container Insights&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhptfzlf8n9i0kaan7hl5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhptfzlf8n9i0kaan7hl5.png" alt=" " width="800" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 13: Create Task Definition
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Linked to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ECR image&lt;/li&gt;
&lt;li&gt;Task role&lt;/li&gt;
&lt;li&gt;Execution role&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Defined container configuration&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 14: Deploy ECS Service
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Used Fargate launch type&lt;/li&gt;
&lt;li&gt;Deployed in private subnets&lt;/li&gt;
&lt;li&gt;Disabled public IP&lt;/li&gt;
&lt;li&gt;Attached ALB&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enabled auto-scaling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Min: 1&lt;/li&gt;
&lt;li&gt;Max: 2&lt;/li&gt;
&lt;li&gt;CPU target: 70%&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzbyk6hd6qkx7c193811p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzbyk6hd6qkx7c193811p.png" alt=" " width="800" height="379"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 15: Configure Domain (Route 53)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Created DNS record&lt;/li&gt;
&lt;li&gt;Mapped domain to ALB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxcbs9dy8s5jwmhbabuz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxcbs9dy8s5jwmhbabuz.png" alt=" " width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv3d3b8evwiyh5fh1v07b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv3d3b8evwiyh5fh1v07b.png" alt=" " width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the application is publicly accessible 🎉&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F56s8nzp4ybr1wkc8c77f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F56s8nzp4ybr1wkc8c77f.png" alt=" " width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Things I Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;How to design a secure VPC architecture&lt;/li&gt;
&lt;li&gt;Importance of security groups and IAM roles&lt;/li&gt;
&lt;li&gt;How to containerize applications using Docker&lt;/li&gt;
&lt;li&gt;Deploying containers using ECS Fargate&lt;/li&gt;
&lt;li&gt;Using Secrets Manager for secure credential handling&lt;/li&gt;
&lt;li&gt;Integrating multiple AWS services in a real project&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Problem It Solved
&lt;/h2&gt;

&lt;p&gt;This project addresses key challenges commonly found in traditional application deployments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lack of scalability → Applications fail under increased traffic&lt;/li&gt;
&lt;li&gt;Single point of failure → Downtime when a server crashes&lt;/li&gt;
&lt;li&gt;Security vulnerabilities → Public databases and hardcoded credentials&lt;/li&gt;
&lt;li&gt;Manual infrastructure management → High operational overhead&lt;/li&gt;
&lt;li&gt;Inconsistent environments→ Deployment failures across stages&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ❌ Challenges I Faced
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Debugging security group rules between ECS and RDS&lt;/li&gt;
&lt;li&gt;Handling Docker build and push errors&lt;/li&gt;
&lt;li&gt;Configuring ALB listeners correctly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each challenge improved my troubleshooting skills significantly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Would Improve Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Add CI/CD pipeline (GitHub Actions)&lt;/li&gt;
&lt;li&gt;Use Terraform for Infrastructure as Code&lt;/li&gt;
&lt;li&gt;Implement monitoring with CloudWatch &amp;amp; alerts&lt;/li&gt;
&lt;li&gt;Introduce auto-scaling based on traffic&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This project helped me transition from theory to real-world DevOps practice**. It gave me a deeper understanding of how cloud infrastructure, containers, and networking work together.&lt;/p&gt;

&lt;p&gt;If you’re learning DevOps or AWS, I highly recommend building something like this — it changes everything.&lt;/p&gt;

&lt;h2&gt;
  
  
  👋 About Me
&lt;/h2&gt;

&lt;p&gt;I’m currently transitioning into DevOps and sharing my learning journey publicly. Follow me for more hands-on cloud, Docker, and Kubernetes content.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>containers</category>
      <category>tutorial</category>
      <category>ecs</category>
    </item>
    <item>
      <title>How to Deploy a Dynamic Web Application on AWS (Beginner-Friendly Guide)</title>
      <dc:creator>Oluwatobiloba Oludare</dc:creator>
      <pubDate>Sat, 21 Feb 2026 21:39:02 +0000</pubDate>
      <link>https://dev.to/oluwatobiloba_oludare1/how-to-deploy-a-dynamic-web-application-on-aws-beginner-friendly-guide-4nhp</link>
      <guid>https://dev.to/oluwatobiloba_oludare1/how-to-deploy-a-dynamic-web-application-on-aws-beginner-friendly-guide-4nhp</guid>
      <description>&lt;p&gt;Deploying a dynamic web application on AWS can feel overwhelming at first especially with so many services involved. In this guide, I’ll walk through a simple, practical approach to deploying a dynamic web app using core AWS services.&lt;/p&gt;

&lt;p&gt;This is perfect for beginners learning cloud computing and DevOps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a Dynamic Web Application?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unlike static websites, dynamic web applications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Process user input&lt;/li&gt;
&lt;li&gt;Connect to databases&lt;/li&gt;
&lt;li&gt;Generate content in real time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Examples include:&lt;/strong&gt; Login systems, Dashboards, E-commerce sites&lt;/p&gt;

&lt;p&gt;Web apps built with PHP&lt;/p&gt;

&lt;p&gt;AWS Services We’ll Use:&lt;/p&gt;

&lt;p&gt;To deploy a dynamic web app, we typically need:&lt;br&gt;
🔹 Compute: EC2 – Hosts the application server&lt;br&gt;
🔹 Database: RDS – Stores application data&lt;br&gt;
🔹 Networking &amp;amp; Security : VPC – Network environment and Security Groups &lt;br&gt;
🔹 Storage: S3 &lt;br&gt;
🔹 Route 53&lt;br&gt;
🔹 Application Load Balancer&lt;br&gt;
🔹 Auto-scaling group&lt;/p&gt;

&lt;p&gt;🪜 &lt;strong&gt;Step-by-Step Deployment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Select appropriate Region.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Create VPC and enable DNS hostname.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzfhwehsm7z7u16h1hmeq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzfhwehsm7z7u16h1hmeq.png" alt=" " width="800" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.  Create all these Security Groups:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;-For ec2 instance connect endpoint (EICE) - No inbound rules- use ssh and limit it to vpc CIDR&lt;/p&gt;

&lt;p&gt;-For application load balancer (alb-Sg) - select vpc - allow http &amp;amp; https for anywhere &lt;/p&gt;

&lt;p&gt;-For Webserver security group (web-sg)- select vpc - allow http &amp;amp; https, limit to alb-sg - allow ssh, limit to eice.&lt;/p&gt;

&lt;p&gt;-Security group to database (db-sg) -- select vpc - Allow MySQL, limit it to webserver-sg - again allow MySQL, limit it dm-sg. &lt;/p&gt;

&lt;p&gt;-Security group for data migration (dms) - select vpc- allow ssh, limit it to eice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flr1rgwy9age67893ufow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flr1rgwy9age67893ufow.png" alt=" " width="800" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Create instance connect endpoint&lt;/strong&gt; in private subnet - select ec2 instance connect endpoint - select vpc - Use eice-sg - select private subnet -private-app-az2 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3276zhrxkala1shcej02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3276zhrxkala1shcej02.png" alt=" " width="800" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Create S3 bucket and upload the application code accordingly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz07evzgla8ekaf0j1len.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz07evzgla8ekaf0j1len.png" alt=" " width="800" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Create IAM Policy&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select S3 - grant S3: GetObject &amp;amp; S3: ListBucket.  -

&lt;ul&gt;
&lt;li&gt;under Resources - you can limit it using the ARN (but for practice select all)
-- Click on add  more permission 
-- select Secret Manager --  grant permission - GetSecretValue &amp;amp; DescribeSecret.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmadexfopukbqzrf8dayn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmadexfopukbqzrf8dayn.png" alt=" " width="800" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Create Role&lt;/strong&gt;- select Ec2 as use case - select the policy you just created -- name your role.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Forji6sqlaod0txpphgga.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Forji6sqlaod0txpphgga.png" alt=" " width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Create Subnet group&lt;/strong&gt; -- select vpc - select your two AZ  -- select your two private Subnets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fehchslvqmhsu3no7qw4p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fehchslvqmhsu3no7qw4p.png" alt=" " width="800" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9.  Create Database RDS&lt;/strong&gt;-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select Standard create &lt;/li&gt;
&lt;li&gt;Select MySQL&lt;/li&gt;
&lt;li&gt;Select the latest mysql database engine version
&lt;/li&gt;
&lt;li&gt;Select the free tier&lt;/li&gt;
&lt;li&gt;Name your DB instance Identifier &lt;/li&gt;
&lt;li&gt;Select managed in AWS Secrets Manager
&lt;/li&gt;
&lt;li&gt;Select include previous generation classes &lt;/li&gt;
&lt;li&gt;Select instance type -- Select your Subnet group
&lt;/li&gt;
&lt;li&gt;Use db-sg as the security group
&lt;/li&gt;
&lt;li&gt;Select your AZ &lt;/li&gt;
&lt;li&gt;Under configuration give the initial database name.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34md9klwxn71w3d2ivde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34md9klwxn71w3d2ivde.png" alt=" " width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, Migrating data into RDS database:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10.  Create Ec2 instance&lt;/strong&gt; -- select without key pair -- select private subnet private app az2 -- select dms-sg  - attach your role under instance profile. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zsjcfwu00e55h88i9ph.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zsjcfwu00e55h88i9ph.png" alt=" " width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connect to the ec2 instance using the management console and use the migration script accordingly. Check out for the scripts to migrate data to RDS database here:  &lt;a href="https://github.com/Oluwatobiloba-Oludare/Dynamic-Web-Application-on-AWS" rel="noopener noreferrer"&gt;https://github.com/Oluwatobiloba-Oludare/Dynamic-Web-Application-on-AWS&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2x5mebtbji0sl1j5v87.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2x5mebtbji0sl1j5v87.png" alt=" " width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; After successfully migrating the data, you can terminate the Ec2 instance. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;13.  Create another ec2 instance in private subnet for webserver&lt;/strong&gt; -- select without a keypair -- use web-sg  -- attach the S3 role under instance profile. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvgerwuns3fsam9s7zy7k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvgerwuns3fsam9s7zy7k.png" alt=" " width="800" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14.  Use the Deployment Script accordingly.&lt;/strong&gt; (Check out the script in this github:  &lt;a href="https://github.com/Oluwatobiloba-Oludare/Dynamic-Web-Application-on-AWS" rel="noopener noreferrer"&gt;https://github.com/Oluwatobiloba-Oludare/Dynamic-Web-Application-on-AWS&lt;/a&gt; )&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15.  Create Target group&lt;/strong&gt; -- select instance - select VPC -- Under Advance Health check, enter 200,301,302 -- select the instance and include and create.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxyns80n24uavn95fyyjs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxyns80n24uavn95fyyjs.png" alt=" " width="800" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16.  Create Application Load balancer&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;select vpc - select the two AZ in your VPC -- select public subnet for the two AZ -- Use ALB-sg -- Under Listener, select  Redirect to URL and select full URL -&lt;/li&gt;
&lt;li&gt;Add another listener -- select https -- select target group -- under default SSL, select your certificate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhpo65yclvb2kbq3nn3m8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhpo65yclvb2kbq3nn3m8.png" alt=" " width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17.  Create a Record in our Domain name-&lt;/strong&gt;   use www -- Alias -- select region -- select Application and classic load balancer &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fajvbotrq8dw2umhjfjvz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fajvbotrq8dw2umhjfjvz.png" alt=" " width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3hvry2amsypce2lamjm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3hvry2amsypce2lamjm.png" alt=" " width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, use your domain name to check your website on the internet. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Congratulations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1s1coxntxgx9on1z8bz5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1s1coxntxgx9on1z8bz5.png" alt=" " width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now, let's be prepare for sudden traffic by setting up our auto-scaling group.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18. Create AMI&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the ec2 instance running and select actions and select image and templates and select create image 
-- select Tag image and snapshots together 
-- under Key, type Name and input your AMI name.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2v7l2hdxsyyr1jpwa99j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2v7l2hdxsyyr1jpwa99j.png" alt=" " width="800" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;19. Create Launch template&lt;/strong&gt;&lt;br&gt;
-- select Auto scaling guidelines &lt;br&gt;
-- select My AMIs and select owned by me &lt;br&gt;
-- select t2 micro -- select web sg.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nkcxrz9b9ybmra59ldq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nkcxrz9b9ybmra59ldq.png" alt=" " width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can terminate the ec2 instance. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;20. Create Auto scaling group&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select vpc - select the two private app &lt;/li&gt;
&lt;li&gt;Select attach to an existing load balancer &lt;/li&gt;
&lt;li&gt;Select target group &lt;/li&gt;
&lt;li&gt;Select the two Health checks &lt;/li&gt;
&lt;li&gt;Select the number of scaling you want &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmprjhshp3i97cpfychd4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmprjhshp3i97cpfychd4.png" alt=" " width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✍️ &lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Learning AWS becomes easier when you build real projects. Deploying a dynamic web application is one of the best beginner exercises to understand how cloud services work together.&lt;/p&gt;

&lt;p&gt;If you are learning AWS, I highly recommend trying this hands-on project.&lt;/p&gt;

&lt;p&gt;Follow along for more practical AWS, Docker, and cloud learning posts.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>automation</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Create a Secure VPC on AWS- STEP BY STEP</title>
      <dc:creator>Oluwatobiloba Oludare</dc:creator>
      <pubDate>Thu, 16 Oct 2025 13:50:19 +0000</pubDate>
      <link>https://dev.to/oluwatobiloba_oludare1/how-to-create-a-secure-vpc-on-aws-step-by-step-32ai</link>
      <guid>https://dev.to/oluwatobiloba_oludare1/how-to-create-a-secure-vpc-on-aws-step-by-step-32ai</guid>
      <description>&lt;p&gt;In this article, I will walk you through how I built the setup step-by-step, what I learned along the way, and why this project strengthened my understanding of AWS and cloud infrastructure security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a VPC?&lt;/strong&gt;&lt;br&gt;
A VPC (Virtual Private Cloud) is a logically isolated section of the AWS Cloud where you can launch resources like EC2 instances, databases, and load balancers in a private, secure network that you control.&lt;/p&gt;

&lt;p&gt;You decide the IP address range, create subnets, and define rules that manage how traffic moves within and outside your network.&lt;/p&gt;

&lt;p&gt;Think of it as your own private data center hosted inside AWS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tools and Services I Used&lt;/strong&gt;&lt;br&gt;
Here are the AWS components I worked with in this project:&lt;br&gt;
&lt;strong&gt;VPC *&lt;em&gt;– To create a private network&lt;br&gt;
**Subnets *&lt;/em&gt;– Divided into public and private zones&lt;br&gt;
**Internet Gateway (IGW)&lt;/strong&gt; – To allow internet access for public resources&lt;br&gt;
&lt;strong&gt;NAT Gateway **– To allow private resources to access the internet securely (for updates, downloads, etc.)&lt;br&gt;
**Route Tables&lt;/strong&gt; – To control how traffic flows&lt;br&gt;
&lt;strong&gt;Security Groups and Network ACLs (NACLs)&lt;/strong&gt; – To define inbound and outbound rules for security&lt;br&gt;
&lt;strong&gt;EC2 Instances&lt;/strong&gt; – To test and verify the setup&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step Setup&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Step 1: Create a VPC&lt;/strong&gt;&lt;br&gt;
I started by creating a new VPC with a CIDR block of 10.0.0.0/16, which gives me up to 65,536 private IP addresses. This range acts as the foundation for all the subnets I created later&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frd49r049f56xn1637875.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frd49r049f56xn1637875.png" alt=" " width="605" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Create Subnets (Public and Private)&lt;/strong&gt;&lt;br&gt;
To separate resources and improve security, I created:&lt;/p&gt;

&lt;p&gt;Public Subnet – for resources that need internet access (like web servers)&lt;br&gt;
Private Subnet – for backend systems such as databases or application servers that should not be accessible directly from the internet&lt;/p&gt;

&lt;p&gt;Each subnet had its own CIDR range:&lt;/p&gt;

&lt;p&gt;Public Subnet: 10.0.1.0/24&lt;br&gt;
Private Subnet: 10.0.2.0/24&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjdflyc4rbetpu2ilxyr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjdflyc4rbetpu2ilxyr.png" alt=" " width="601" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0so3qxyyfejj06ynnqhq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0so3qxyyfejj06ynnqhq.png" alt=" " width="612" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3: Attach an Internet Gateway (IGW)&lt;br&gt;
The Internet Gateway connects the public subnet to the internet. I created internet gateway, then I attached it to my VPC and updated the public route table to direct all outbound traffic (0.0.0.0/0) to the IGW.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4wpu71o9521hnmejdf17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4wpu71o9521hnmejdf17.png" alt=" " width="800" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Set Up a NAT Gateway&lt;/strong&gt;&lt;br&gt;
The NAT Gateway (Network Address Translation) allows resources in the private subnet to access the internet securely (for software updates or package installations) while keeping them hidden from incoming traffic.&lt;/p&gt;

&lt;p&gt;I placed the NAT Gateway inside the public subnet and attached an Elastic IP to it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30g6d90hw5ebln0sp2r3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30g6d90hw5ebln0sp2r3.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Create and Configure Route Tables&lt;/strong&gt;&lt;br&gt;
I created two route tables:&lt;/p&gt;

&lt;p&gt;Public Route Table – Linked to the public subnet and directed internet traffic to the IGW.&lt;br&gt;
Private Route Table – Linked to the private subnet and directed traffic through the NAT Gateway.&lt;/p&gt;

&lt;p&gt;This ensures that:&lt;/p&gt;

&lt;p&gt;Public subnet resources (like web servers) can communicate with the internet.&lt;br&gt;
Private subnet resources (like databases) can reach the internet for updates, but cannot be accessed directly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbomnfmbzaemc6v20q44h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbomnfmbzaemc6v20q44h.png" alt=" " width="800" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgnqvxc59gyjfaue5kdao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgnqvxc59gyjfaue5kdao.png" alt=" " width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5c0kvffglrkz19gp04tg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5c0kvffglrkz19gp04tg.png" alt=" " width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also edited the association to linked the private and public route to the subnets accordingly. &lt;/p&gt;

&lt;p&gt;Step 6: Launch EC2 Instances to Test&lt;br&gt;
I launched one EC2 instance in the public subnet and another in the private subnet to test communication:&lt;/p&gt;

&lt;p&gt;From my public instance, I could SSH into it using the Elastic IP.&lt;br&gt;
From there, I could connect to the private instance through its private IP — confirming that the network worked perfectly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnva0it3ji59i7esl2jph.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnva0it3ji59i7esl2jph.png" alt=" " width="800" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv3ez2i6mj4o13ss1wtht.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv3ez2i6mj4o13ss1wtht.png" alt=" " width="609" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 7 : Configure Security Groups&lt;br&gt;
Security groups act as virtual firewalls for EC2 instances.&lt;/p&gt;

&lt;p&gt;For the public subnet, I allowed:&lt;/p&gt;

&lt;p&gt;Inbound: HTTP (port 80), HTTPS (port 443), and SSH (port 22)&lt;br&gt;
Outbound: All traffic (default)&lt;/p&gt;

&lt;p&gt;For the private subnet, I allowed only:&lt;/p&gt;

&lt;p&gt;Inbound: Traffic from the public subnet’s security group (e.g., for database connections)&lt;br&gt;
Outbound: All traffic (so the instance can reach the internet via NAT)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs3p9xbfkhqoefz2xf3z1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs3p9xbfkhqoefz2xf3z1.png" alt=" " width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhq0mrgciop4d7gpystjj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhq0mrgciop4d7gpystjj.png" alt=" " width="800" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 7: Add Network ACLs (NACLs)&lt;br&gt;
NACLs provide an additional layer of network security at the Subnet Level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I created NACLs for both subnets:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Public subnet NACL: Allows inbound/outbound HTTP, HTTPS, and SSH.&lt;br&gt;
Private subnet NACL: Allows only internal communication and outbound connections through NAT.&lt;/p&gt;

&lt;p&gt;Each rule has a rule number (like 100, 200, etc.) to control priority — lower numbers are evaluated first.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F24k330sp7odp19368i7h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F24k330sp7odp19368i7h.png" alt=" " width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2q68bzy204zu5dlxm09n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2q68bzy204zu5dlxm09n.png" alt=" " width="800" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr7ywev5cqp86tamhgb6e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr7ywev5cqp86tamhgb6e.png" alt=" " width="800" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Learned&lt;/strong&gt;&lt;br&gt;
This project helped me understand how AWS networking and security really work in practice. Some key takeaways:&lt;/p&gt;

&lt;p&gt;How public and private subnets help build secure architectures&lt;br&gt;
How route tables control data flow within a VPC&lt;br&gt;
The role of NAT Gateways and Internet Gateways in network design&lt;br&gt;
How Security Groups and NACLs work together for defense in depth&lt;br&gt;
How to think like a DevOps engineer, focusing on scalability and security from the ground up&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenges I Faced During the Project.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. CIDR Block Confusion&lt;/strong&gt;&lt;br&gt;
At first, I struggled to understand how to choose CIDR blocks correctly without overlapping IP ranges. I learned that each subnet must have a unique portion of the VPC’s IP range (for example, 10.0.1.0/24 and 10.0.2.0/24), and planning this ahead helps avoid routing issues later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Internet Access Not Working for Private Instances&lt;/strong&gt;&lt;br&gt;
Initially, my private EC2 instance couldn’t reach the internet. The issue was that I hadn’t configured the NAT Gateway and Private Route Table properly. After updating the route table to direct 0.0.0.0/0 traffic to the NAT Gateway, everything worked perfectly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Security Group and NACL Confusion&lt;/strong&gt;&lt;br&gt;
Understanding the difference between Security Groups (Stateful) and NACLs (Stateless) was tricky. I accidentally blocked SSH traffic at first because my inbound/outbound rules weren’t aligned. This helped me learn that:&lt;/p&gt;

&lt;p&gt;Security Groups remember allowed connections automatically.&lt;br&gt;
NACLs require explicit inbound and outbound permissions for each direction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
Setting up a secure VPC gave me hands-on confidence in AWS networking and reinforced how important it is to design systems with security in mind from the very beginning.&lt;/p&gt;

&lt;p&gt;If you’re starting your DevOps or cloud journey, I highly recommend trying this project, it’s one of the best ways to truly understand how the cloud works behind the scenes.&lt;/p&gt;

&lt;p&gt;Have you tried setting up a VPC before? What challenges did you face? &lt;/p&gt;

</description>
      <category>networking</category>
      <category>security</category>
      <category>tutorial</category>
      <category>aws</category>
    </item>
    <item>
      <title>How I Set Up an Application Load Balancer (ALB) Across Two EC2 Instances for High Availability.</title>
      <dc:creator>Oluwatobiloba Oludare</dc:creator>
      <pubDate>Thu, 31 Jul 2025 21:26:45 +0000</pubDate>
      <link>https://dev.to/oluwatobiloba_oludare1/how-i-set-up-an-application-load-balancer-alb-across-two-ec2-instances-for-high-availability-4bbn</link>
      <guid>https://dev.to/oluwatobiloba_oludare1/how-i-set-up-an-application-load-balancer-alb-across-two-ec2-instances-for-high-availability-4bbn</guid>
      <description>&lt;p&gt;&lt;strong&gt;PRACTICAL SCENARIO&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At TechNova, we recently launched a product website hosted on Amazon EC2. To ensure high availability and fault tolerance, I was tasked with configuring an Application Load Balancer (ALB) that distributes traffic across two EC2 instances in different Availability Zones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Objective&lt;/strong&gt;&lt;br&gt;
✅ Set up an Application Load Balancer&lt;br&gt;
✅ Launch two EC2 instances in different Availability Zones&lt;br&gt;
✅ Register both instances with the Target Group&lt;br&gt;
✅ Ensure traffic is distributed evenly&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step Implementation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Launch Two EC2 Instances&lt;/strong&gt;&lt;br&gt;
Choose the same region, but different subnets (AZs)&lt;br&gt;
Use the same AMI (Amazon Linux), security group, and key pair for simplicity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsijg51ulw9ele8shb9st.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsijg51ulw9ele8shb9st.png" alt=" " width="800" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connect to each instance via SSH&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtjem1i0pe6cn2xbdgb8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtjem1i0pe6cn2xbdgb8.png" alt=" " width="800" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Then install Web Server *&lt;/em&gt;&lt;br&gt;
*&lt;em&gt;Run this commands: *&lt;/em&gt;&lt;br&gt;
sudo yum install httpd -y &lt;br&gt;
sudo systemctl start httpd &lt;br&gt;
echo "Welcome to Web Server 1" | sudo tee /var/www/html/index.html&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repeat on the second instance with "Web Server 2"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd3nvm0c7lmkr2y19tufl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd3nvm0c7lmkr2y19tufl.png" alt=" " width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install a web server (e.g., Apache or NGINX) with simple HTML content on both&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21a8v09k2dtmp5fdxekk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21a8v09k2dtmp5fdxekk.png" alt=" " width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Create a Target Group&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Navigate to Target Groups&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspuv0zuxpqdohsl6hl9a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspuv0zuxpqdohsl6hl9a.png" alt=" " width="800" height="573"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choose:&lt;/strong&gt;&lt;br&gt;
Target type: Instance&lt;br&gt;
Protocol: HTTP&lt;br&gt;
Port: 80&lt;br&gt;
Register both instances (tick the boxes)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Farvmxlg5n2wu35pkxyqx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Farvmxlg5n2wu35pkxyqx.png" alt=" " width="800" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Set Up the Application Load Balancer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Navigate to Load Balancers&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxciwytrurc32in9jqwz8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxciwytrurc32in9jqwz8.png" alt=" " width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choose Application Load Balancer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqh58rx325k2y7ux5g0f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqh58rx325k2y7ux5g0f.png" alt=" " width="800" height="552"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Name your Application Load Balancer&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Scheme: Internet-facing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13q9qr5w43edk8xrshg8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13q9qr5w43edk8xrshg8.png" alt=" " width="800" height="525"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Availability Zones: Select at least two with their subnets&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F256e4rtb9fsl8f0thzux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F256e4rtb9fsl8f0thzux.png" alt=" " width="800" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Listeners: HTTP (port 80)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Then attach your Target Group&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7n39yht3lf3lk8082jz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7n39yht3lf3lk8082jz.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Review and create *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To Test the Application Load Balance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Visit the DNS name of the ALB in a browser&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Refresh several times you should see responses from both instances&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Congratulation, You have successfully set up load balancing!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge Faced&lt;/strong&gt;&lt;br&gt;
At first, only one instance was receiving traffic. After reviewing the Target Group health checks, I discovered the web server was installed but not properly configured on the second instance. &lt;/p&gt;

&lt;p&gt;A quick fix in the index.html resolved the issue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CONCLUSION&lt;/strong&gt;&lt;br&gt;
With an Application Load Balancer in place, TechNova’s website can now handle more traffic and stay resilient in case of instance or AZ failures. This setup is foundational for achieving high availability in AWS.&lt;/p&gt;

&lt;p&gt;Have you tried setting up an ALB before? Let me know your experience or any challenges you faced in the comments! &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Getting Started with AWS Auto Scaling: Automatically Handle Your EC2 Load Like a Pro</title>
      <dc:creator>Oluwatobiloba Oludare</dc:creator>
      <pubDate>Thu, 31 Jul 2025 18:46:45 +0000</pubDate>
      <link>https://dev.to/oluwatobiloba_oludare1/getting-started-with-aws-auto-scaling-automatically-handle-your-ec2-load-like-a-pro-26c7</link>
      <guid>https://dev.to/oluwatobiloba_oludare1/getting-started-with-aws-auto-scaling-automatically-handle-your-ec2-load-like-a-pro-26c7</guid>
      <description>&lt;p&gt;&lt;strong&gt;AUTO-SCALING&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Auto Scaling is one of those game-changing AWS features that makes your infrastructure smart, resilient, and cost-efficient. If you've ever wondered how websites handle sudden traffic surges without crashing or burning money, this is where Auto Scaling shines.&lt;/p&gt;

&lt;p&gt;In this guide, I will walk you through the basics of AWS Auto Scaling, how to set it up, and what pitfalls to watch out for — especially if you’re just starting your cloud journey.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is AWS Auto Scaling?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AWS Auto Scaling automatically adjusts the number of EC2 instances in your application based on demand. Whether your traffic spikes or drops, Auto Scaling ensures your app stays available and you only pay for what you use.&lt;/p&gt;

&lt;p&gt;✨** Why Use Auto Scaling?**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High availability during peak loads
&lt;/li&gt;
&lt;li&gt;Reduced costs during low traffic
&lt;/li&gt;
&lt;li&gt;Improved fault tolerance
&lt;/li&gt;
&lt;li&gt;Hands-free instance management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🧱 &lt;strong&gt;Core Components of Auto Scaling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here’s what makes it all work:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Launch Template – Defines the configuration for launching EC2 instances (AMI, instance type, etc).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auto Scaling Group (ASG) – Manages and maintains the number of instances. It ensures that a defined number of instances are running based on user-defined minimum, maximum, and desired capacity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scaling Policies – Define how the group should scale (Target Tracking, Step Scaling, or Scheduled).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CloudWatch Alarms – Monitor CPU usage or other metrics to trigger scaling.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Practical Exapmple:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TechNova experiences inconsistent traffic. During working hours, there is heavy traffic. After hours, the load reduces. Your task is to configure an Auto Scaling Group to scale based on CPU usage.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🛠️ &lt;strong&gt;Setting Up Auto Scaling (Step-by-Step)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Launch two EC2 on different Availability zone (AZ)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffsrafeqkrenky9tmiww0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffsrafeqkrenky9tmiww0.png" alt=" " width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Selected your preferred AMI&lt;/li&gt;
&lt;li&gt;Instance type&lt;/li&gt;
&lt;li&gt;Key pair
-Security group&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Create Target Group&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to Load Balancing Option and select Target group.Then click on create target group.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjoa4h3tuuobu93v53zk0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjoa4h3tuuobu93v53zk0.png" alt=" " width="709" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Select Instance option and name your Target Group&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frqslbljgy14ravart2vt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frqslbljgy14ravart2vt.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6wdedgr9as8z65apqpe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6wdedgr9as8z65apqpe.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can leave other options on default and click next then select the two instances, then click on create target group.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57i9kyf0shp8z9ehznml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57i9kyf0shp8z9ehznml.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7km4mdud098tn50i5hnn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7km4mdud098tn50i5hnn.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Create Load Balance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to Load Balance option and click on it, then click on create load balance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxnpng4cprm7koaga15so.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxnpng4cprm7koaga15so.png" alt=" " width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Select Application Load balancer and click on Create&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh824httvncgbaycerhph.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh824httvncgbaycerhph.png" alt=" " width="800" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft457mx0xdlbodp8hl6j0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft457mx0xdlbodp8hl6j0.png" alt=" " width="800" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Select two different Availability Zones in-line with your instance. (Example: Mine is us-east-1c &amp;amp; us-east-1d)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ccnzx5gn6cl7r8ojulv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ccnzx5gn6cl7r8ojulv.png" alt=" " width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Under Security **&lt;br&gt;
**Select at least one Security group&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwkhibs0fh07sfmxk7qe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwkhibs0fh07sfmxk7qe.png" alt=" " width="800" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Under Listeners and routing.&lt;br&gt;
Select your target group&lt;br&gt;
Then click on "Add Listener"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2ny0yqpcux08g1p6sui.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2ny0yqpcux08g1p6sui.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After clicking on the Add Listener, select the Target group again&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4p7xfw5sn9srd9xkvskv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4p7xfw5sn9srd9xkvskv.png" alt=" " width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Then click on Create Load Balancer *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ilxnb408cicam84ybin.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ilxnb408cicam84ybin.png" alt=" " width="800" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Launch Template&lt;/strong&gt;&lt;br&gt;
Search for Launch Template and Select it accordgingly. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5p21dnhlwxb2sen3fzm4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5p21dnhlwxb2sen3fzm4.png" alt=" " width="800" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Click on Create Launch Template *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs4umvejwtfg8wzfxbdlg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs4umvejwtfg8wzfxbdlg.png" alt=" " width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Name your template: *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F11texcmd1x8282mthczy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F11texcmd1x8282mthczy.png" alt=" " width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Click on "Browse more AMIs" to select your AMI. &lt;br&gt;
Then, select your instance type&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3n0aza7th1f58esw1t3u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3n0aza7th1f58esw1t3u.png" alt=" " width="800" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Select your Key pair and also select one security group&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3lk3dguplmjslpejaxfq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3lk3dguplmjslpejaxfq.png" alt=" " width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Click on Advanced Settings and scroll down&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftokufjyhlzur0ceem0ym.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftokufjyhlzur0ceem0ym.png" alt=" " width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Insert this command on this User-data: *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;yum update -y &lt;br&gt;
yum install httpd -y &lt;br&gt;
systemctl start httpd &lt;br&gt;
systemctl enable httpd &lt;br&gt;
echo "Welcome to Web Server - $(hostname)" &amp;gt; /var/www/html/index.html&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Then, click on Create Launch Template. *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faoqa3f6iub4v1tkssxh8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faoqa3f6iub4v1tkssxh8.png" alt=" " width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Create Auto-Scaling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Select Auto Scaling and click on Create Auto Scaling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2b7s56fv2lq952gjmc7q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2b7s56fv2lq952gjmc7q.png" alt=" " width="773" height="690"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyrl4knzpjb1u6323g72u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyrl4knzpjb1u6323g72u.png" alt=" " width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name your Auto scaling group and Select the template you created.&lt;br&gt;
Then click on next.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fary8l9ocpmq9qskvx73h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fary8l9ocpmq9qskvx73h.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Select two different Availability zone, then click on next.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnu9chao7c3aowbk2vrfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnu9chao7c3aowbk2vrfl.png" alt=" " width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Select "Attach to an existing load balancer"  and then select the target group you created earlier&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwrq3kauhug9fnxx35bvh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwrq3kauhug9fnxx35bvh.png" alt=" " width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Select "Turn on Elastic Load Balance Health Checks" and click on next.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftzoxfbwbvq7y5pd3n2x2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftzoxfbwbvq7y5pd3n2x2.png" alt=" " width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For this exercise we are using 3 as maximum desired capacity and 1 as the minimum capacity. So select it accordingly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Also select Target Scaling Policy and click on next to create the Auto-Scaling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0o3ayhfhnaq6f1g9agw7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0o3ayhfhnaq6f1g9agw7.png" alt=" " width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DONE&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjfycccp7tdf6vswzmq86.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjfycccp7tdf6vswzmq86.png" alt=" " width="800" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Now refresh your instance. *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You will notice that new instances are launched, some get terminated as demand decreases, and others are started again as needed — all automatically managed by Auto Scaling.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhleu5n7jqga66fp88eqj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhleu5n7jqga66fp88eqj.png" alt=" " width="800" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Auto Scaling automatically creates new EC2 instances when your current instance(s) can't handle the load for example, when CPU usage goes above a defined threshold like 60%.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LESSON I LEARNED&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set the right &lt;strong&gt;cooldown period&lt;/strong&gt; to avoid frequent unnecessary scaling&lt;/li&gt;
&lt;li&gt;Choose the correct &lt;strong&gt;target metric&lt;/strong&gt; for your workload&lt;/li&gt;
&lt;li&gt;Monitoring with &lt;strong&gt;CloudWatch&lt;/strong&gt; is critical for visibility&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*&lt;em&gt;CONCLUSION: *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Auto Scaling saved TechNova both performance issues and unnecessary costs. By simply leveraging AWS-native tools like ASG, Launch Templates, and CloudWatch, we were able to build a resilient, adaptive infrastructure that scales as needed.&lt;/p&gt;

&lt;p&gt;Want to try it for your own projects? Start small, experiment, and let the cloud do the heavy lifting. ☁️💪&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>ebs</category>
    </item>
    <item>
      <title>Step-by-Step: How To Create and Attach EBS Volume.</title>
      <dc:creator>Oluwatobiloba Oludare</dc:creator>
      <pubDate>Sun, 20 Jul 2025 11:59:43 +0000</pubDate>
      <link>https://dev.to/oluwatobiloba_oludare1/step-by-step-how-to-create-and-attach-ebs-volume-2mlp</link>
      <guid>https://dev.to/oluwatobiloba_oludare1/step-by-step-how-to-create-and-attach-ebs-volume-2mlp</guid>
      <description>&lt;p&gt;&lt;strong&gt;INTRODUCTION&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When working with EC2 instances on AWS, you may often need additional storage beyond the default root volume. This is where Amazon Elastic Block Store (EBS) comes in—providing scalable, high-performance block storage for your EC2 instances. In this article, I’ll walk you through how to create an EBS volume, attach it to an EC2 instance, and properly configure it for use. Whether you are new to AWS or looking to sharpen your DevOps skills, this step-by-step guide will help you confidently manage EC2 storage the right way.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Follow these steps: *&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Log in to AWS Management Console&lt;/strong&gt;
Go to: &lt;a href="https://console.aws.amazon.com/" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8c54523w996tvxkcf0zj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8c54523w996tvxkcf0zj.png" alt=" " width="800" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Navigate to EC2 Dashboard.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0s2l7aelzsadqrc572v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0s2l7aelzsadqrc572v.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjv1cuyngizc5pk426du6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjv1cuyngizc5pk426du6.png" alt=" " width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Create a New EBS Volume&lt;/strong&gt;&lt;br&gt;
In the EC2 Dashboard, scroll down to Elastic Block Store &amp;gt; Click Volumes.&lt;br&gt;
Click Create Volume.&lt;br&gt;
&lt;strong&gt;Choose:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Volume Type:&lt;/strong&gt; (e.g., General Purpose SSD gp3)&lt;br&gt;
&lt;strong&gt;Size&lt;/strong&gt;: (e.g., 4 GiB or more)&lt;br&gt;
&lt;strong&gt;Availability Zone:&lt;/strong&gt; Must match your EC2 instance's AZ (e.g., us-east-1a)&lt;br&gt;
&lt;strong&gt;Click Create Volume&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1taems5nagde48dp7rz9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1taems5nagde48dp7rz9.png" alt=" " width="458" height="809"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2i5auw60d312ewlnphww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2i5auw60d312ewlnphww.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu7a4v2lzj3wdkeunj25v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu7a4v2lzj3wdkeunj25v.png" alt=" " width="800" height="595"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Attach Volume to EC2&lt;/strong&gt;&lt;br&gt;
After creation, select the volume.&lt;/p&gt;

&lt;p&gt;Click Actions &amp;gt; Attach Volume.&lt;/p&gt;

&lt;p&gt;Select the EC2 instance from the dropdown.&lt;/p&gt;

&lt;p&gt;You can select /dev/xvdbb and click Attach.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7hgaqwqiedj8i4ih4br.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7hgaqwqiedj8i4ih4br.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fog8p55b4hja89zub567c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fog8p55b4hja89zub567c.png" alt=" " width="800" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;5. Connect to EC2 *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;SSH into your EC2 instance using this command: ssh -i your-key.pem ec2-user@your-ec2-public-ip &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jn4ajv1ogvf5be8mc6w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jn4ajv1ogvf5be8mc6w.png" alt=" " width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;6. Format *&lt;/em&gt;&lt;br&gt;
Run these commands: sudo mkfs -t ext4 /dev/xvdbb&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw4rvwbz5bu3qbjhnugq4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw4rvwbz5bu3qbjhnugq4.png" alt=" " width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Create a mount point using this command sudo mkdir /mnt/my-ebs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiw0upkze64e4zlt2v13d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiw0upkze64e4zlt2v13d.png" alt=" " width="800" height="135"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Mount the volume&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;sudo mount /dev/xvdbb /mnt/my-ebs&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftxbwfkna58csr5vfbrq6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftxbwfkna58csr5vfbrq6.png" alt=" " width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Congratulation!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge I Faced&lt;/strong&gt;&lt;br&gt;
One of the initial challenges I encountered was making sure the EBS volume was created in the same Availability Zone as my EC2 instance. &lt;/p&gt;

&lt;p&gt;At first, I mistakenly created the volume in a different Availability Zone, which made it impossible to attach it to my instance. This taught me the importance of always double-checking the Availability Zone when creating resources that need to work together in AWS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CONCLUSION&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By following the steps in this article, you’ve successfully created and attached an EBS volume to your EC2 instance. This setup allows for better data management, flexibility, and scalability in your cloud infrastructure. As you continue exploring AWS services, understanding how to leverage EBS effectively will be essential for managing storage needs in real-world projects. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stay curious, and keep building!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>learning</category>
    </item>
    <item>
      <title>How I Deployed My Ubuntu EC2 Instance with NGINX and Customized My Web Page via Command Prompt</title>
      <dc:creator>Oluwatobiloba Oludare</dc:creator>
      <pubDate>Sat, 05 Jul 2025 10:24:30 +0000</pubDate>
      <link>https://dev.to/oluwatobiloba_oludare1/how-i-deployed-my-ubuntu-ec2-instance-with-nginx-and-customized-my-web-page-via-command-prompt-4pp</link>
      <guid>https://dev.to/oluwatobiloba_oludare1/how-i-deployed-my-ubuntu-ec2-instance-with-nginx-and-customized-my-web-page-via-command-prompt-4pp</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is EC2 and Why Ubuntu?&lt;/strong&gt;&lt;br&gt;
Amazon EC2 (Elastic Compute Cloud) is a service by AWS that allows users to rent virtual machines in the cloud. These machines, called instances, can be used to run applications just like a regular computer.&lt;/p&gt;

&lt;p&gt;I chose Ubuntu as my operating system because it's one of the most widely used Linux distributions. It's lightweight, developer-friendly, and perfect for deploying web servers like NGINX.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step Deployment Process&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Login to AWS and Launch EC2 Instance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F39ex0lyc2p59bb5comco.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F39ex0lyc2p59bb5comco.png" alt=" " width="800" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30o7f1ap7dy5os163kxq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30o7f1ap7dy5os163kxq.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Change your country location to N.Virginia&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjeh5s1q3yt4yl7s0skd6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjeh5s1q3yt4yl7s0skd6.png" alt=" " width="800" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Name your instance and Select Ubuntu Server 22.04 LTS (Free tier eligible)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwev8ge0mrzpdo1z603iy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwev8ge0mrzpdo1z603iy.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Select t2.micro instance type (Free Tier eligible).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm4ifeyokya11v9smyi20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm4ifeyokya11v9smyi20.png" alt=" " width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Create or select an existing key pair (.pem file).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqtbce90l8fe9b6x2h5y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqtbce90l8fe9b6x2h5y.png" alt=" " width="800" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. As shown below, give your keypair a name and select RSA as your key pair type; seclect .pem as key file format, then click "create key pair". It will download instantly (Make sure your .pem file has the right permissions chmod 400 your-key-file.pem).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffl656ewlij1xwp4tqmv4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffl656ewlij1xwp4tqmv4.png" alt=" " width="720" height="666"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Configure Security Group to allow:&lt;/strong&gt;&lt;br&gt;
SSH (port 22)&lt;br&gt;
HTTP (port 80)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpvly09x6z681qz8wntv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpvly09x6z681qz8wntv.png" alt=" " width="800" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Click Launch.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fell0bkkuibrjwcystnms.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fell0bkkuibrjwcystnms.png" alt=" " width="800" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Copy your public Ipv4 address&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd402cva8pnhxq6a9r3ex.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd402cva8pnhxq6a9r3ex.png" alt=" " width="800" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Connect to the EC2 Instance via SSH&lt;/strong&gt;&lt;br&gt;
Open your command prompt or terminal, navigate to where you downloaded your key pair using "cd" (e.g. cd Downloads). &lt;br&gt;
Then type this command and input your key-pair name and your public ip address -  *&lt;em&gt;"ssh -i your-key-file.pem ubuntu@your-ec2-public-ip" *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabalth2wmrfoyfingywi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabalth2wmrfoyfingywi.png" alt=" " width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. Run this command to update Ubuntu and install Nginx&lt;/strong&gt;&lt;br&gt;
sudo apt update&lt;br&gt;
sudo apt install nginx&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmtvxynnaany9bkbppqev.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmtvxynnaany9bkbppqev.png" alt=" " width="800" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvlwrf5uivvomiuvyfhbn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvlwrf5uivvomiuvyfhbn.png" alt=" " width="800" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;12. To start and enable nginx run these commands: *&lt;/em&gt;&lt;br&gt;
sudo systemctl start nginx&lt;br&gt;
sudo systemctl status nginx&lt;br&gt;
sudo systemctl enable nginx&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2snzc1f152q2wrqw4rc2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2snzc1f152q2wrqw4rc2.png" alt=" " width="800" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Paste your public Ip address to your browser&lt;br&gt;
you will see this welcome message:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4bmgecn7p3qzo1j9t5bs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4bmgecn7p3qzo1j9t5bs.png" alt=" " width="800" height="281"&gt;&lt;/a&gt;&lt;br&gt;
🎉 &lt;strong&gt;You’ve successfully deployed an NGINX web server on EC2 using just your terminal!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. To edit the welcome message to your own desire content:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14.Run this command sudo nano /var/www/html/index.nginx-debian.html. Then edit the content to your taste as shown below.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkewp4hruc2mrpvl06a8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkewp4hruc2mrpvl06a8w.png" alt=" " width="800" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenges I Faced&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔐 SSH Connection Issues&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I initially got a “Permission denied (publickey)” error. &lt;/p&gt;

&lt;p&gt;This was because:&lt;/p&gt;

&lt;p&gt;My .pem file didn’t have the right permissions.&lt;/p&gt;

&lt;p&gt;I was using the wrong username (ec2-user instead of ubuntu for Ubuntu AMI).&lt;br&gt;
**&lt;br&gt;
✅ Fix: Set permission with chmod 400 and use the correct SSH username.**&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Deploying an NGINX web server on an EC2 instance with just the command prompt was a great way to strengthen my cloud skills. It taught me the importance of networking, server setup, and command-line operations in real-world environments.&lt;/p&gt;

&lt;p&gt;If you are just starting out with AWS or want to get comfortable managing servers via the terminal, I highly recommend trying this project. It’s simple, educational, and sets the stage for more advanced deployments.&lt;/p&gt;

&lt;p&gt;Have you tried deploying a web server via the terminal before? Got stuck or have questions? Drop a comment below — I would love to hear your thoughts and help if I can!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>aws</category>
      <category>nginx</category>
      <category>devops</category>
    </item>
    <item>
      <title>How I Deployed an EC2 Instance with Apache: A Step-by-Step Guide 🚀</title>
      <dc:creator>Oluwatobiloba Oludare</dc:creator>
      <pubDate>Fri, 20 Jun 2025 18:49:19 +0000</pubDate>
      <link>https://dev.to/oluwatobiloba_oludare1/how-i-deployed-an-ec2-instance-with-apache-a-step-by-step-guide-39eh</link>
      <guid>https://dev.to/oluwatobiloba_oludare1/how-i-deployed-an-ec2-instance-with-apache-a-step-by-step-guide-39eh</guid>
      <description>&lt;p&gt;As someone learning cloud computing and DevOps, one of my first hands-on experiences was launching an Amazon EC2 (Elastic Compute Cloud) instance and deploying a basic web server using Apache. If you are new to AWS or cloud infrastructure in general, this post will walk you through the process I followed—from spinning up an EC2 instance to seeing my first “It works!” page live on a browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is EC2?&lt;/strong&gt;&lt;br&gt;
Amazon EC2 (Elastic Compute Cloud) is a service that provides resizable compute capacity in the cloud. In simpler terms, it lets you rent virtual machines (called instances) where you can run your applications, host websites, or do pretty much anything you'd do on a physical server—without actually managing hardware.&lt;/p&gt;

&lt;p&gt;With EC2, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose your preferred OS (Linux, Windows, etc.)&lt;/li&gt;
&lt;li&gt;Scale up or down depending on traffic&lt;/li&gt;
&lt;li&gt;Pay only for what you use&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, let’s dive into how I used EC2 to set up a web server with Apache.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step: Deploying EC2 with Apache&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Login to AWS Console&lt;/strong&gt;
Go to &lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;https://aws.amazon.com/&lt;/a&gt; and sign in to the AWS Management Console. If you don’t have an account yet, sign up—it’s free to get started and comes with a 12-month Free Tier, which includes EC2.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fikpoclyt7dkivy6hzp6q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fikpoclyt7dkivy6hzp6q.png" alt=" " width="800" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Launch an EC2 Instance&lt;/strong&gt;&lt;br&gt;
Search for EC2 under the “Services” menu&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowtkaucgw4pdk4dbp6ju.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowtkaucgw4pdk4dbp6ju.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Click Launch Instance.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9xwn2r3j43jxf5z2yiga.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9xwn2r3j43jxf5z2yiga.png" alt=" " width="800" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Give your instance a name (e.g., My-Server);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Amazon Machine Image (AMI): Choose Amazon Linux&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgu3aor6o4g9gktcz69qp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgu3aor6o4g9gktcz69qp.png" alt=" " width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; &lt;strong&gt;Change your country to N.Virginia&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15tbytis1db9136ze8wx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15tbytis1db9136ze8wx.png" alt=" " width="800" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Instance Type:  Select t2.micro or t3.micro (eligible for the free tier)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6p0zbrlyw0jha3v494en.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6p0zbrlyw0jha3v494en.png" alt=" " width="800" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Key Pair: Click on create new key pair.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjkjx8paaqddwpbuj7gjl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjkjx8paaqddwpbuj7gjl.png" alt=" " width="800" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. **&lt;/strong&gt;As shown below, give your keypair a name and select RSA as your key pair type; seclect .pem as key file format, then click "create key pair". It will download instantly.**&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx80u7m2wdl0o4nh2287.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx80u7m2wdl0o4nh2287.png" alt=" " width="800" height="696"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Security Group:&lt;/strong&gt; &lt;br&gt;
Create a new Security Group with the following:&lt;br&gt;
Type: SSH | Port: 22 | Source: 0.0.0.0/0&lt;br&gt;
Type: HTTP | Port: 80 | Source: 0.0.0.0/0&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpfsmaczrlkwzekh791s4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpfsmaczrlkwzekh791s4.png" alt=" " width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Then click Launch Instance and wait for the instance status to be running.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fos952s26rklrqw6cxhxe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fos952s26rklrqw6cxhxe.png" alt=" " width="800" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. click on the instance as shown below&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fta68nbjcivpb4695e2qm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fta68nbjcivpb4695e2qm.png" alt=" " width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. Connect to the Instance via SSH&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open Git Bash (or PowerShell/Terminal); navigate to where you downloaded your keypair (using cd) then give it the right permission of "chmod 400 your-key-name.pem" as shown below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqdflqqgkd8jk7apcdjra.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqdflqqgkd8jk7apcdjra.png" alt=" " width="800" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. Go back to your AWS dashboard and click on the box beside your server's name, then copied the public ip address.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82xih2dw61wsv8i68uk4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82xih2dw61wsv8i68uk4.png" alt=" " width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14.&lt;/strong&gt; &lt;strong&gt;Connect using SSH&lt;/strong&gt;:&lt;br&gt;
Use this format ssh -i "my-ec2-key.pem" ec2-user@. &lt;/p&gt;

&lt;p&gt;Insert your keypair name &amp;amp; your public IPv4 address you copied and press enter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6q25dfakoxytzms2i16r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6q25dfakoxytzms2i16r.png" alt=" " width="728" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Type yes when prompted&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15. Install a Web Server (Apache)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run the following commands in the EC2 terminal:&lt;/p&gt;

&lt;p&gt;sudo yum update -y&lt;br&gt;
sudo yum install -y httpd&lt;br&gt;
sudo systemctl start httpd&lt;br&gt;
sudo systemctl enable httpd&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnqmmyd5h4trxuxckhv20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnqmmyd5h4trxuxckhv20.png" alt=" " width="728" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F96ip271qn34d4eqxnspl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F96ip271qn34d4eqxnspl.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16. Verify in Browser-&lt;/strong&gt; Open your browser and type the Public IPv4 address of your EC2 instance. You should see the default Page with a message that says:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It works!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🎉 &lt;strong&gt;Congratulations&lt;/strong&gt;! You’ve successfully deployed a web server on EC2.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffs4nt24c1f2cjbq11wnf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffs4nt24c1f2cjbq11wnf.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17. Customize the Page:&lt;/strong&gt;&lt;br&gt;
To customize the page, run this command in the EC2 terminal: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb1eo65datece71n3ijx3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb1eo65datece71n3ijx3.png" alt=" " width="449" height="90"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you can replace the Hello from EC2 to any sentence you want eg Assignment Completed Successfully!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F427aiq1tlpgqcns60pvi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F427aiq1tlpgqcns60pvi.png" alt=" " width="800" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once again, Congratulation.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Challenge I Faced and How I Solved it&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Apache Not Showing in Browser&lt;/strong&gt;
&lt;strong&gt;Problem&lt;/strong&gt;:
After installing Apache, typing the EC2 public IP in the browser showed nothing or timed out.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I went back to my EC2 terminal and I discovered that I have not enabled the Apache.&lt;/li&gt;
&lt;li&gt;I immediately start and enable it using "sudo systemctl start httpd" &amp;amp; 
"sudo systemctl enable httpd".Thereafter, the Apache welcome page loaded correct
ly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🧩 &lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Deploying an EC2 instance and setting up Apache was a rewarding hands-on experience that deepened my understanding of cloud infrastructure and server configuration. From launching the instance to configuring security groups and troubleshooting connectivity issues, each step taught me something new about how cloud environments operate.&lt;/p&gt;

&lt;p&gt;This beginner-friendly project reminded me that even small deployments can build the confidence and skills needed for more complex DevOps tasks ahead. If you're just getting started with AWS or cloud engineering, I highly recommend trying this out—you’ll gain practical insights that no tutorial can fully explain until you do it yourself.&lt;/p&gt;

&lt;p&gt;Thanks for reading! If you have any questions, ran into different challenges, or want to share your own experience, feel free to drop a comment below. Let’s learn together! 🙌&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
