DEV Community

Cover image for πŸ’» AWS 106: The Moment of Truth! Launching Your First EC2 Instance
Hritik Raj
Hritik Raj

Posted on

πŸ’» AWS 106: The Moment of Truth! Launching Your First EC2 Instance

AWS

πŸš€ Launch Time! Provisioning Your Core Cloud Server (EC2)

Hey Cloud Pioneers and Compute Captains! πŸ‘‹

Welcome to Day 6 of the #100DaysOfCloud Challenge: Launch EC2 Instance! We've spent the last few days laying the groundwork (Key Pair, Security Group, Subnet, EIP, EBS). Now, we finally bring it all together by launching our core virtual server, following the plan from KodeKloud Engineer.

KodeKloud Engineer

The EC2 instance is the heart of your cloud infrastructure your virtual machine running in AWS. Our task is to launch an instance with specific, common beginner settings:

  1. Name: devops-ec2
  2. AMI: Amazon Linux
  3. Instance Type: t2.micro (The Free Tier option!)
  4. Security: Create a new key pair named devops-kp.
  5. Networking: Attach the default Security Group.

Let's power on our first server! ⚑


1. Introduction: What is EC2? πŸ’‘

Amazon Elastic Compute Cloud (EC2) provides resizable compute capacity in the cloud. It's essentially a virtual server that you have complete control over.

  • AMI (Amazon Machine Image): This is a template that provides the necessary information to launch an instance, including the operating system (we're using Amazon Linux).
  • Instance Type (t2.micro): This defines the hardware (CPU, memory, storage). The t2.micro is the standard Free Tier eligible instance, perfect for small tasks and learning!
  • Key Pair: Necessary for securely logging into the instance via SSH.

2. Step-by-Step Guide: Launching the devops Server

We will use the modernized "Launch instances" wizard in the AWS Console.

Step 2.1: Start the Launch Wizard

  1. Log in to the AWS Console.

  1. Search for EC2 and go to the EC2 Dashboard.

  1. Click the orange "Launch instances" button.

Step 2.2: Configure Name and AMI

  1. Name: In the Name and tags section, enter the required name: devops-ec2.

  2. Application and OS Images (AMI): Search or scroll down to find and select the Amazon Linux AMI (typically the default or a recommended option).

Step 2.3: Choose Instance Type and Key Pair

  1. Instance type: Select t2.micro.

  1. Key pair (login): We need a new one.
    • Select "Create a new key pair" from the dropdown.


* Key pair name: Enter devops-kp.
* Key pair type: Choose RSA.
* Click "Create key pair". πŸ›‘ Important: Your private key file (devops-kp.pem) will automatically download. Save this file!

Step 2.4: Configure Network Settings

We need to attach the default Security Group.

  1. In the Network settings section, click "Edit".
  2. VPC: Ensure the Default VPC is selected.
  3. Subnet: Select any available subnet in your default VPC.
  4. Firewall (Security Groups): Select the option "Select existing security group."
  5. In the Security Group list, check the box for the default Security Group (it will typically be named default and have a description like default VPC security group).

Step 2.5: Launch the Instance

  1. Review the summary box on the right. It should show 1 instance, t2.micro, and your devops-kp key.

  1. Click the orange "Launch instance" button.

Congratulations! Your EC2 instance is now provisioning. You can click "View all instances" to watch its state change from "pending" to "running"! πŸŽ‰


3. Key Takeaways πŸ“

  • Free Tier Start: The t2.micro instance type is your best friend for learning and staying cost-effective.
  • The Key is New: Every time you create a new Key Pair (devops-kp), you must download and secure the .pem file.
  • Default SG: The default Security Group is the simplest one to use but is usually very restrictive (often only allowing traffic from within the VPC).

4. Common Mistakes to Avoid 🚫

  1. Forgetting the Key Pair: If you lose devops-kp.pem, you cannot SSH into your instance.
  2. Wrong Security Group: If you can't connect, the first thing to check is the Security Group. Make sure it has an SSH rule (Port 22) open to your IP address (or 0.0.0.0/0 if necessary).
  3. Region Mismatch: Your Key Pair and your instance must be launched in the same AWS region.
  4. EBS Volume Attachment: Remember that the EBS Volume we created yesterday is separate. You must manually attach it after the instance is running.

5. Conclusion + Call to Action! 🌟

You've successfully launched your core virtual machine! This devops-ec2 instance is now running and ready to host applications or be configured further. The migration is well underway!

Keep crushing the 100 Days of Cloud Challenge!

If you found this guide helpful, please:

  • πŸ’¬ Let’s connect on LinkedIn: Cloud, DevOps, consistency, and learning in public let’s build together!
    πŸ‘‰ Hritik Raj

  • ⭐ Support my journey on GitHub: Follow my #100DaysOfCloud challenge with real AWS tasks and hands-on learning. Every star helps!
    πŸ‘‰ GitHub – 100 Days of Cloud

Next up, we'll probably figure out how to SSH into this new server! Happy computing! πŸ’»

Top comments (0)