Quick Guide: Launch Your First AWS EC2 Instance in Just 60 Seconds

Syed DadapeerSyed Dadapeer
5 min read

Introduction

๐Ÿ’ป Traditional Way: Buying a Physical Computer

In the past, if you needed a server or computer for your business or project, you had to:

  • ๐Ÿฌ Buy hardware: Go to a store and purchase a physical machine.

  • ๐Ÿ› ๏ธ Set it up: Install the operating system, configure settings, and connect it to your network.

  • ๐Ÿ”ง Maintain it: Ensure it's running smoothly (fix issues, apply updates, etc.).

๐Ÿ›  Example: Imagine you needed a powerful computer to host a website. Youโ€™d buy a physical machine, keep it in your office or home, and handle all the maintenance yourself.

โ˜๏ธ AWS EC2: A Virtual Server in the Cloud

With AWS (Amazon Web Services), you can skip the hassle of buying and maintaining physical hardware. Instead, you can "rent" virtual serversโ€”called EC2 instancesโ€”from Amazon, which are located in their global data centers.

  • EC2 (Elastic Compute Cloud) = A virtual server you can customize and use without worrying about the hardware.

๐Ÿ’ก Why AWS EC2?

  • โšก Flexibility: Scale up or down depending on your needs. Add more power when you need it!

  • ๐Ÿ’ฐ Cost-Effective: Pay only for the time you use the instance. No need for large upfront costs for hardware.

  • ๐Ÿš€ Speed: Launch a new server in minutes, compared to the days or weeks it might take to order, set up, and configure physical hardware.

  • Global Reach: AWS has data centers worldwide, so you can choose where your server is located. This is great for reducing latency or following data privacy regulations.

  • ๐Ÿ›ก๏ธ Hassle-Free Maintenance: AWS takes care of all the backend stuffโ€”like hardware failures or updatesโ€”so you donโ€™t have to!

AWS is like your one-stop shop for renting virtual computers, ready to go with just a few clicks! ๐Ÿ–ฅ๏ธ๐Ÿ’จ

Prerequisites

Before we dive in, make sure you have:

  • An AWS account (you can sign up for free if you donโ€™t have one).

  • A basic understanding of cloud computing concepts (not mandatory, but helpful).

Step 1: Log into AWS Management Console ๐Ÿ–ฅ๏ธ

  1. Go to AWS Management Console.

  2. Log in using your AWS account credentials.

  3. Once you're logged in, you'll see a dashboard full of services.

Step 2: Navigate to EC2 Dashboard ๐Ÿš€

  1. In the search bar at the top, type โ€œEC2โ€ and select it from the dropdown menu.

  2. Youโ€™ll land on the EC2 Dashboard, where you can manage your instances.

Step 3: Launch Instance ๐Ÿ› ๏ธ

  1. Click on the โ€œLaunch Instanceโ€ button.

  2. This will open the launch wizard, which will guide you through the setup process.

Step 4: Choose an Amazon Machine Image (AMI) ๐ŸŒ

  1. Here, you'll find a variety of pre-configured templates. Choose an AMI that suits your needs. For beginners, selecting Amazon Linux 2 AMI or Ubuntu Server is a good choice.

Step 5: Choose an Instance Type ๐Ÿ’ป

  1. You'll see a list of instance types. For starters, select the t2.micro instance type (this is eligible for the AWS Free Tier).

Step 6: Create a key pair ๐Ÿ”

  1. Select an existing key pair or create a new one. Create a new key pair if you donโ€™t have one. Download the key pair (itโ€™s a .pem file) and store it securely!

    ๐Ÿšจ โš ๏ธ Warning
    Do not choose to Proceed without a key pair (Not recommended). If you launch your instance without a key pair, then you can't connect to it.

Step 7: Network Settings๐Ÿ›œ

  1. Configure network settings like VPC, subnet, and firewalls (security groups) to manage traffic from specific IP addresses, protocols, and ports. You can create a new security group or select an existing one. For beginners, it's recommended to keep the default settings and make sure you tick SSH, HTTP (port 80), and HTTPS (port 443) if you intend to host a website.

Step 8: Configure Storage ๐Ÿ“ฆ

  1. You can adjust the size of your storage volume. The default value is usually sufficient, but you can increase it if you need more space.

Step 9: Configure Additional details (Optional)โœจ

  1. Beginners can usually leave the additional details at the default settings, but adjustments can be made if needed.

Step 10: Review and Launch ๐Ÿš€

  1. Review your configuration & Enter the Number of instances you want to create.

  2. And then click โ€œLaunch Instances.โ€

After clicking the "Launch Instances" button, a new page will confirm that your instance was successfully created.

Click on the instance ID or "View all instances" on the page to see the instance we just created.

Step 11: Access Your EC2 Instance ๐Ÿ”‘

There are several ways to access EC2 instances:

Method 1: Connect using EC2 Instance Connect

  • Supported Linux distributions:

    • Amazon Linux 2 (any version)

    • Ubuntu 16.04 or later

Select your instance and click on the Connect button.

It will connect through your browser.

Method 2: Connect to EC2 instance using PuTTY/any terminal

  1. Once your instance is running, go to the โ€œInstancesโ€ section in the EC2 dashboard.

  2. Select your instance and copy its Public IP address.

  3. Open a terminal (or Command Prompt) and use the following command to connect to your instance (replace <path_to_your_key> and <public_ip>):

     ssh -i <path_to_your_key> ec2-user@<public_ip>
    

Conclusion ๐ŸŽ‰

Congratulations! Youโ€™ve successfully launched your first EC2 instance. From here, you can install software, host applications, or simply explore the capabilities of cloud computing.

Feel free to share your experience or any questions you might have in the comments below! Happy cloud computing! โ˜๏ธโœจ

0
Subscribe to my newsletter

Read articles from Syed Dadapeer directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Syed Dadapeer
Syed Dadapeer

Hi, I'm Syed Dadapeer! I'm an experienced ๐‚๐ข๐ญ๐ซ๐ข๐ฑ ๐€๐๐ฆ๐ข๐ง๐ข๐ฌ๐ญ๐ซ๐š๐ญ๐จ๐ซ and ๐’๐ฒ๐ฌ๐ญ๐ž๐ฆ ๐„๐ง๐ ๐ข๐ง๐ž๐ž๐ซ with over 2.5 years of IT experience, focusing on troubleshooting complex issues, cloud computing, virtualization, and Citrix products. I'm also ๐‘๐ž๐ ๐‡๐š๐ญ ๐œ๐ž๐ซ๐ญ๐ข๐Ÿ๐ข๐ž๐! ๐Ÿ’ก Iโ€™m passionate about learning new technologies and applying them to real-world challenges. Iโ€™m also exploring the exciting fields of ๐€๐ซ๐ญ๐ข๐Ÿ๐ข๐œ๐ข๐š๐ฅ ๐ˆ๐ง๐ญ๐ž๐ฅ๐ฅ๐ข๐ ๐ž๐ง๐œ๐ž, ๐‚๐ฅ๐จ๐ฎ๐ ๐‚๐จ๐ฆ๐ฉ๐ฎ๐ญ๐ข๐ง๐ , and ๐ƒ๐ž๐ฏ๐Ž๐ฉ๐ฌ.โ™พ๏ธ ๐Ÿš€ Letโ€™s connect! Iโ€™m always open to new opportunities and collaborations. Feel free to reach out via ๐‹๐ข๐ง๐ค๐ž๐๐ˆ๐ง or at ๐ฌ๐๐š๐๐ฎ2206@๐ ๐ฆ๐š๐ข๐ฅ.๐œ๐จ๐ฆ.