Introduction: Amazon Web Services (AWS) provides users access to a robust suite of cloud computing tools, and one of the most popular is EC2 (Elastic Compute Cloud). Setting up a free AWS EC2 instance allows you to test the service without any upfront costs, making it ideal for beginners, developers, and businesses exploring AWS for the first time. In this step-by-step guide, we’ll walk you through creating an AWS account, launching an EC2 instance, configuring security settings, and connecting to your new virtual server.

Step 1: Creating an AWS Account

You’ll need an AWS account before you can launch your EC2 instance.

  1. Visit the AWS Website: Go to AWS and click on the “Create an AWS Account” button.
  2. Enter Your Information: Provide your email address, create a password, and set your account name.
  3. Payment Information: AWS requires a credit or debit card for verification, even for free-tier services. You won’t be charged if you stay within the free-tier limits.
  4. Identity Verification: AWS will send a verification code to your email or phone to confirm your identity.
  5. Select a Support Plan: Choose the “Basic” support plan, which is free.
  6. Log into AWS Console: Once your account is set up, log into the AWS Management Console.

Step 2: Navigating to EC2 Instances

Now that your AWS account is ready, it’s time to access EC2 services.

  1. Go to the AWS Management Console: Use the search bar at the top of the dashboard and type “EC2”.
  2. Access EC2 Dashboard: Click “EC2” from the search results to open the EC2 dashboard.
  3. Explore the Dashboard: The EC2 dashboard allows you to monitor your instances, key pairs, security groups, and more.

Step 3: Launching an EC2 Instance

To create and run your free EC2 instance, follow these steps:

  1. Click “Launch Instance”: In the EC2 dashboard, click the “Launch Instance” button.
  2. Select an Amazon Machine Image (AMI): Choose the Amazon Linux 2023 Free Tier AMI or another eligible free-tier AMI.
  3. Choose an Instance Type: For free-tier eligibility, select the t2.micro instance type, which provides enough resources for light workloads.
  4. Configure Instance Details: Leave the default settings as they work well for a basic setup.
  5. Add Storage: The default storage configuration of 8GB is sufficient and included in the free tier.
  6. Add Tags (Optional): To organize your instance, add any key-value tags. This step is optional.
  7. Configure Security Group: This step is critical for protecting your instance from unauthorized access.

Step 4: Configuring Security Group Properties

Security groups act as virtual firewalls for your EC2 instances. You’ll need to configure it to allow specific traffic:

  1. Create a New Security Group: Create a new security group in the “Configure Security Group” section.
  2. Set Inbound Rules:
    • Add a rule to allow SSH access:
      • Type: SSH
      • Protocol: TCP
      • Port Range: 22
      • Source: Select “My IP” to restrict access to your IP address.
  3. Review the Security Group: Ensure only the ports (such as SSH for Linux instances) are open.

Step 5: Connecting to Your EC2 Instance

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

  1. Get the Public DNS: From the EC2 dashboard, click on the instance ID to view details. Copy your instance’s Public DNS or Public IP.
  2. Connect Using SSH:

For Linux/Mac users: Open the terminal and use the following command:

ssh -i /path-to-your-key.pem ec2-user@your-public-dns

  • For Windows users: Use an SSH client like PuTTY. Load the .pem key file in PuTTY’s configuration and connect to the instance using the Public DNS.
  1. Successful Connection: If the connection is successful, you will have remote access to your EC2 instance, where you can start installing software or running your code.

Conclusion

Setting up a free AWS EC2 instance is a great way to start with cloud computing. This guide covered creating an AWS account, launching an EC2 instance, configuring security settings, and connecting to the instance. This free-tier offering is perfect for small-scale projects, learning environments, or testing applications before deploying them at a larger scale.

References

Compute Service – Amazon EC2

Get started with Amazon EC2