Amazon EC2 — launch an instance

Beginner
⏱️ 8 min read
📚 Updated: Aug 2025
EC2 / Ubuntu / Security groups

What you’ll learn

Amazon Elastic Compute Cloud (EC2) provides virtual servers in the cloud. Launching an instance is the first step before you install runtimes, deploy apps, or attach load balancers.

This guide uses the AWS Management Console to start an Ubuntu Server instance with a login key pair and network rules for SSH and basic web traffic.

Prerequisites

Before you begin, ensure you have the following:

Launch an EC2 instance

After you sign in to the console, follow these steps. Labels in the wizard can change slightly over time; use the screenshots as a visual anchor.

  1. In the search bar at the top, type EC2 and open the EC2 service.

    AWS console search showing EC2 service
    AWS Management Console
  2. On the EC2 dashboard, open Instances in the left navigation, then choose Launch instance.

    EC2 Instances page with Launch instance button
    Amazon EC2
  3. Give the instance a name (optional but helpful). Under Application and OS Images (Amazon Machine Image), choose Ubuntu Server (pick a supported LTS release shown in the console).

    Launch instance wizard with Ubuntu Server AMI selected
    Amazon EC2

    On the Instance type step, select a size that matches your workload. For learning, a small burstable type such as t3.micro or t2.micro is often enough (free tier eligibility varies by account and Region—check the console banner).

  4. Under Key pair (login), choose Create new key pair if you do not already have one for this machine.

    EC2 launch wizard create new key pair link
    Amazon EC2
  5. Configure the key pair:

    1. Key pair name — choose any descriptive name.
    2. Key pair typeRSA remains widely compatible.
    3. Private key file format — choose .pem if you will use OpenSSH (ssh on macOS, Linux, or Windows Terminal). Choose .ppk if you will use PuTTY on Windows. The example screenshot uses .ppk; pick the format that matches your SSH client.

    Choose Create key pair. Your browser downloads the private key once—store it safely; AWS does not show it again.

    Create key pair dialog with RSA and private key format
    Amazon EC2
  6. In Network settings, configure the security group so you can reach the instance. For a first web server lab, the console often offers checkboxes similar to:

    • Allow SSH traffic from your IP or from the internet (narrow SSH to your IP in production).
    • Allow HTTPS from the internet if you plan to serve TLS.
    • Allow HTTP from the internet if you plan to serve plain HTTP.
    EC2 network settings with SSH HTTP HTTPS rules
    Amazon EC2
  7. Review storage and advanced options if needed, then choose Launch instance.

    EC2 launch instance summary and launch button
    Amazon EC2
  8. Return to Instances and wait until Instance state shows Running and status checks have passed.

    EC2 instances list showing running instance
    Amazon EC2

Key takeaways

1

Pick an AMI (here, Ubuntu) and an instance type sized for your workload and budget.

2

Download and guard the private key (.pem or .ppk)—it is the password-less way into the instance for SSH.

3

The security group is a stateful firewall; only open ports you truly need, especially for SSH.

Frequently asked questions

The AMI defines the OS image and root volume template. The instance type defines CPU, memory, and networking characteristics of the hardware profile you rent for that launch.
Use .pem with OpenSSH. Use .ppk with PuTTY. You can convert formats with PuTTYgen if you change clients later.
Running instances incur compute charges (unless covered by free tier or savings plans). EBS volumes and public IPv4 may also bill. Stopping an instance stops compute charges for most instance types but you still pay for storage.

Next: stable public IPv4

Allocate and associate an Elastic IP so your instance keeps the same public address across restarts and for DNS records.

Elastic IP for EC2 →
Did you know?

EC2 bills for running instances and attached storage. Stop or terminate instances you do not need, release unused Elastic IPs, and review Cost Explorer so surprise charges do not accumulate while you experiment.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful