codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Tutorials
☁️

AWS Cloud

7 / 60 topics
6Introduction to Amazon EC27Launching an EC2 Instance8EC2 Instance Types
Tutorials/AWS Cloud/Launching an EC2 Instance
☁️AWS Cloud

Launching an EC2 Instance

Updated 2026-05-15
10 min read

Launching an EC2 Instance

Introduction

Amazon Elastic Compute Cloud (EC2) is a web service that provides scalable computing capacity in the cloud. It allows you to launch virtual servers called instances, which can run applications on them. In this tutorial, we will walk through the process of launching and configuring an EC2 instance using the AWS Management Console.

Concept

Before diving into the steps, let's understand some key concepts:

  • Instance Types: These define the hardware specifications (CPU, memory, storage) of your EC2 instances.
  • Key Pairs: These are used to securely connect to your instances via SSH.
  • Security Groups: These act as a virtual firewall that controls inbound and outbound traffic for your instance.

Examples

Step 1: Launching an EC2 Instance

  1. Sign in to the AWS Management Console:

    • Go to AWS Management Console.
    • Enter your credentials to log in.
  2. Navigate to EC2 Dashboard:

    • In the AWS Management Console, find and click on "EC2" under the "Compute" section.
  3. Launch Instance:

    • Click on the "Launch Instance" button.
    • Choose an Amazon Machine Image (AMI). For beginners, you can start with the "Amazon Linux 2 AMI".
  4. Select Instance Type:

    • Choose an instance type that suits your needs. For a basic setup, you can select "t2.micro", which is free tier eligible.
  5. Configure Instance Details:

    • Set the number of instances, network settings, and subnet.
    • Ensure that auto-assign public IP is enabled if you want to access the instance from the internet.
  6. Add Storage:

    • Configure storage options. The default settings are usually sufficient for most use cases.
  7. Add Tags:

    • Add tags to your instance for easier management and identification.
  8. Configure Security Group:

    • Create a new security group or select an existing one.
    • Add rules to allow SSH access (port 22) from your IP address.
  9. Review and Launch:

    • Review all the settings you have configured.
    • Click on "Launch".
  10. Select Key Pair:

    • Choose an existing key pair or create a new one.
    • Download the key pair file (.pem), as it will be required to connect to your instance.

Step 2: Connecting to Your EC2 Instance

Once your instance is running, you can connect to it using SSH.

  1. Open Terminal:

    • Open your terminal or command prompt.
  2. Change Permissions of the Key Pair File:

    chmod 400 /path/to/your-key-pair.pem
    
  3. Connect via SSH:

    ssh -i "/path/to/your-key-pair.pem" ec2-user@<public-ip-address>
    

    Replace <public-ip-address> with the public IP address of your EC2 instance.

  4. Verify Connection: You should see a message indicating that you are logged into your instance.

Step 3: Configuring Your Instance

After connecting, you can start configuring your instance.

  1. Update Package List:

    sudo yum update -y
    
  2. Install Apache Web Server:

    sudo yum install httpd -y
    
  3. Start Apache Service:

    sudo systemctl start httpd
    
  4. Enable Apache to Start on Boot:

    sudo systemctl enable httpd
    
  5. Verify Apache is Running: Open a web browser and navigate to your instance's public IP address. You should see the Apache test page.

What's Next?

Now that you have launched and configured an EC2 instance, you can explore different EC2 Instance Types based on your application requirements. Each instance type offers unique specifications to optimize performance and cost.


PreviousIntroduction to Amazon EC2Next EC2 Instance Types

Recommended Gear

Introduction to Amazon EC2EC2 Instance Types