Lab Information
The Nautilus DevOps Team is working on setting up a new web server for a critical application. The team lead has requested you to create an EC2 instance that will serve as a web server using Nginx. This instance will be part of the initial infrastructure setup for the Nautilus project. Ensuring that the server is correctly configured and accessible from the internet is crucial for the upcoming deployment phase.
As a member of the Nautilus DevOps Team, your task is to create an EC2 instance with the following specifications:
Instance Name: The EC2 instance must be named devops-ec2.
AMI: Use any available Ubuntu AMI to create this instance.
User Data Script: Configure the instance to run a user data script during its launch. This script should:
Install the Nginx package.
Start the Nginx service.
Security Group: Ensure that the instance allows HTTP traffic on port 80 from the internet.
Lab Solutions
πΉ STEP 1: Launch the EC2 Instance
Go to AWS Console β EC2
Click Launch instance
πΉ STEP 2: Configure Instance Basics
π· Name and Tags
Name: devops-ec2
π§ AMI
Select Ubuntu Server (20.04 LTS or 22.04 LTS)
π» Instance Type
Choose t2.micro (or any allowed type)
π Key Pair
Select an existing key pair or create a new one (lab dependent)
πΉ STEP 3: Network & Security Group Configuration
Security Group (VERY IMPORTANT)
Create a new security group or modify an existing one
Add Inbound Rule:
Type Protocol Port Source
HTTP TCP 80 0.0.0.0/0
SSH (optional) TCP 22 0.0.0.0/0
Outbound rules: Leave default (allow all)
πΉ STEP 4: Add User Data Script
Scroll to Advanced details β User data
Paste the following exact script:
!/bin/bash
apt-get update -y
apt-get install -y nginx
systemctl start nginx
systemctl enable nginx
β This script:
Updates packages
Installs Nginx
Starts Nginx immediately
Ensures Nginx starts on reboot
πΉ STEP 5: Launch the Instance
Click Launch instance
Wait until:
Instance state: Running
Status checks: 2/2 passed
πΉ STEP 6: Verify Nginx is Working
Select the instance devops-ec2
Copy its Public IPv4 address
Open a browser and visit:
http://
β Expected Output
You should see the default Nginx welcome page:
βWelcome to nginx!β

Top comments (0)