Best Division

Spread Your Knowledge

  • All topics
  • About us
  • Contact us
  • Privacy policy
  • Terms of service
  • Copyright
  • Facebook
  • Twitter
  • Instagram
  • Youtube
  • LinkedIn
  • Pinterest
  • Github
  • Tumblr

© 2026 Best Division

How Do You Launch an EC2 Instance on AWS Step by Step?

HostingAWS
Jayant Kumar
Jayant Kumar@jayantkumar314
PublishedNov 30, 2026
5 min read

To launch an EC2 instance on AWS, open the EC2 console, choose Launch instance, name it, pick an Amazon Machine Image (AMI) such as Ubuntu or Amazon Linux, choose an instance type, select or create a key pair, configure a security group that allows SSH, and press Launch. A few minutes later the instance has a public IP address you can connect to.

EC2 (Elastic Compute Cloud) is Amazon's virtual server service. This guide follows the console wizard step by step, explains the settings that matter for security and cost, and shows how to connect, stop and terminate the instance so you do not pay for something you forgot.

Table of Contents

  • What you need before you launch an EC2 instance
  • Step by step in the console
    • Choosing an AMI
    • Choosing an instance type
    • Key pair
    • Security group
    • Storage
  • Connecting to the instance
  • Public IP addresses and Elastic IPs
  • Stop, terminate and avoid surprise bills
  • Frequently Asked Questions
    • Which AMI should a beginner choose?
    • Why does SSH say the key permissions are too open?
    • Is it safe to open port 22 to everyone?
    • What is the difference between stopping and terminating?
  • Summary
  • Related Articles

What you need before you launch an EC2 instance

You need an AWS account with a payment method, and you should sign in as an IAM user or through IAM Identity Center rather than as the root user for daily work. Protect the root user with multi-factor authentication and do not create access keys for it.

Also decide:

  • The region: shown at the top right of the console. Resources live in one region, and prices and latency differ per region.
  • What the server is for: a small web app, a test machine or a build box. This drives the instance type.
  • Whether you are inside the AWS Free Tier. Eligibility and limits change and depend on when the account was created, so read the Free Tier page for your account before relying on it.

Step by step in the console

  1. Open the EC2 console and check the region.
  2. Choose Launch instance.
  3. Enter a Name, which becomes a Name tag.
  4. Choose an AMI.
  5. Choose an instance type.
  6. Create or select a key pair.
  7. Edit the network settings and security group.
  8. Set the storage size.
  9. Review the summary and choose Launch instance.

Choosing an AMI

An AMI is the template for the root disk and operating system. For a first server pick Ubuntu Server LTS or Amazon Linux. Both are maintained and work with the standard login users (ubuntu and ec2-user). Use the architecture that matches the instance type: x86_64 for Intel and AMD, or arm64 for Graviton.

Choosing an instance type

An instance type sets vCPU, memory and network capacity. The names follow a pattern: family, generation and size, for example t3.micro. The t family is burstable, which suits light workloads that are idle most of the time. Graviton types such as t4g are often cheaper for the same capacity, but your software must support arm64. Check the pricing page and the Free Tier list for the types available to you.

Key pair

The key pair lets you log in without a password. Create a new key pair, choose ED25519 (or RSA if you must support old tools) and the .pem format for OpenSSH. The console downloads the private key once. Store it safely; AWS cannot show it again.

Security group

A security group is a stateful firewall attached to the instance. For SSH, add an inbound rule for type SSH on port 22 and set the source to My IP rather than 0.0.0.0/0. If you will host a website, add HTTP on port 80 and HTTPS on port 443 from anywhere. Everything not allowed inbound is blocked, and all outbound traffic is allowed by default.

Storage

The default root volume is an EBS disk, often 8 GiB. Increase it only if you need the space; you pay per GiB per month. Keep Delete on termination enabled for throwaway servers so the disk disappears with the instance.

Connecting to the instance

Open the instance in the console, copy the Public IPv4 address and connect. First restrict the key file permissions, or SSH refuses it:

bash

Use ec2-user as the username for Amazon Linux, and replace the IP with yours. You can also use the Connect button, which opens a browser-based terminal (EC2 Instance Connect or Session Manager).

If the connection times out, the usual causes are a security group without port 22, a source address that no longer matches your IP, or a subnet without a route to an internet gateway.

Public IP addresses and Elastic IPs

The public IPv4 address assigned at launch changes when you stop and start the instance. If a domain name points at the server, allocate an Elastic IP and associate it with the instance so the address stays fixed. AWS charges for public IPv4 addresses, and an Elastic IP that is not attached to a running instance also costs money, so release it when you no longer need it.

Stop, terminate and avoid surprise bills

ActionCompute billingDisk (EBS) billingData kept
StopStopsContinuesYes
TerminateStopsStops if delete on termination is onNo

Stopping is like shutting down a computer; terminating deletes the instance. When you finish, terminate the instance, release any Elastic IP, and delete snapshots and unused volumes. Create a budget with an alert in AWS Billing so you are told if spending passes a limit.

Frequently Asked Questions

Which AMI should a beginner choose?

Ubuntu Server LTS or Amazon Linux. Both have good documentation and regular security updates.

Why does SSH say the key permissions are too open?

OpenSSH rejects private keys readable by other users. Run chmod 400 my-key.pem and try again.

Is it safe to open port 22 to everyone?

It works, but automated scanners will hit it constantly. Limit the source to your own IP address, or use Session Manager so no inbound SSH port is needed.

What is the difference between stopping and terminating?

A stopped instance keeps its disk and can start again. A terminated instance is deleted for good.

Summary

Launching an EC2 instance means choosing an AMI, an instance type, a key pair, a locked-down security group and storage, then pressing Launch. Connect with ssh -i key.pem user@public-ip, use an Elastic IP when the address must stay fixed, and terminate everything when you are done to avoid charges.

Related Articles

  • How Do You Create a Droplet on DigitalOcean for Beginners?
  • How Do You Connect to a Server Using SSH for the First Time?
  • Learn Web Hosting: Complete Study Roadmap from Zero to Pro
Share