Loading Now

How to Launch Your First EC2 Instance on AWS: A Step-by-Step Tutorial

How to Launch Your First EC2 Instance on AWS: A Step-by-Step Tutorial

How to Launch Your First EC2 Instance on AWS: A Step-by-Step Tutorial

Amazon Web Services (AWS) has revolutionised the way businesses leverage cloud computing. One of its most popular services is Elastic Compute Cloud (EC2), which enables users to create and manage virtual servers in the cloud. This tutorial will guide you through the process of launching your first EC2 instance step by step. Whether youโ€™re a developer, IT professional, or merely curious about cloud computing, this guide will help you get started.

Prerequisites

Before embarking on your EC2 journey, ensure that you have the following:

  1. An AWS Account: If you donโ€™t have one, you can sign up at AWSโ€™s official site.
  2. Familiarity with Basic Cloud Terminology: Understanding terms like โ€œinstanceโ€, โ€œAMIโ€, and โ€œkey pairโ€ will be beneficial.

Step 1: Log In to the AWS Management Console

  1. Navigate to the AWS Management Console.
  2. Log in with your AWS account credentials.

Step 2: Access the EC2 Dashboard

  1. In the console, locate the โ€œServicesโ€ menu at the top left.
  2. Under โ€œComputeโ€, select โ€œEC2โ€ to open the EC2 Dashboard.

Step 3: Launch an Instance

  1. Click on the โ€œLaunch Instanceโ€ button: This is typically located in the middle of the dashboard.

Step 3.1: Choose an Amazon Machine Image (AMI)

  1. An AMI is a pre-configured template for your instance, containing the operating system and software.
  2. You can choose from various options such as:
    • Amazon Linux
    • Ubuntu
    • Microsoft Windows
  3. Select your desired AMI by clicking the โ€œSelectโ€ button next to it.

Step 3.2: Choose an Instance Type

  1. EC2 offers different instance types optimised for various tasks (e.g., compute, memory, storage).
  2. Start with the t2.micro instance type, which is free for the first 12 months under the AWS Free Tier.
  3. Click on โ€œNext: Configure Instance Detailsโ€.

Step 3.3: Configure Instance Details

  1. Choose the number of instances you want to launch. For your first instance, the default of one is sufficient.
  2. Select the network and subnet options. You can leave these as default for now.
  3. Click on โ€œNext: Add Storageโ€.

Step 3.4: Add Storage

  1. The default storage size is usually adequate for basic tasks. You may increase it if necessary.
  2. Click on โ€œNext: Add Tagsโ€.

Step 3.5: Add Tags

  1. Tags are key-value pairs that help manage resources. For instance, you could use a tag like Name: MyFirstInstance.
  2. Click on โ€œNext: Configure Security Groupโ€.

Step 3.6: Configure Security Group

  1. A security group acts as a virtual firewall. Here, you can define rules that control traffic to your instance.
  2. For a basic setup, allow SSH traffic (port 22) from your IP address to connect to your instance securely.
  3. Click on โ€œReview and Launchโ€.

Step 3.7: Review Instance Launch

  1. Review your choices. If everything is in order, click on the โ€œLaunchโ€ button.
  2. Youโ€™ll be prompted to select a key pair for SSH access. If you donโ€™t have one, create a new key pair:
    • Name it and download the .pem file (keep it safe, you wonโ€™t be able to download it again).

Step 4: Connect to Your EC2 Instance

Once your instance is running, it needs to be accessed:

  1. In the EC2 Dashboard, find your instance listed under โ€œInstancesโ€.
  2. Select your instance, and click on โ€œConnectโ€ at the top.
  3. Follow the instructions to connect via SSH using a terminal on macOS/Linux or an application like PuTTY on Windows.

Connecting using SSH:

For macOS/Linux:

  1. Open your terminal.

  2. Navigate to the directory where the .pem file is stored.

  3. Change permissions to ensure your key is secure:
    bash
    chmod 400 your-key.pem

  4. Use SSH to connect:
    bash
    ssh -i “your-key.pem” ec2-user@your-instance-public-dns

Step 5: Congratulations!

You have successfully launched your first EC2 instance! You can now run applications, host websites, or experiment with cloud computing.

Conclusion

Launching your first EC2 instance on AWS is a straightforward process that opens a world of possibilities in cloud computing. By following this tutorial, youโ€™ve taken the first step towards harnessing the power of AWS. Explore further by deploying applications, learning about auto-scaling, and delving into other AWS services to fully enjoy the benefits of cloud technology. Happy cloud computing!

Share this content:


Discover more from Qureshi

Subscribe to get the latest posts sent to your email.

Post Comment

Discover more from Qureshi

Subscribe now to keep reading and get access to the full archive.

Continue reading