
Launching an instance — step by step
- Click Launch instances.
- Give the instance a Name (for example,
ec2-demo-instance). - Choose an AMI (Amazon Machine Image). The AMI is the image blueprint that determines the operating system and any preinstalled packages.

AMI IDs are region-specific. An AMI ID in one region will be different in another region even if it’s the same AMI name.
- Choose an instance type. For simple testing,
t2.microis commonly Free Tier–eligible (subject to account and regional eligibility). - Key pair: select an existing key pair or create a new one. A key pair (
.pem) is typically required for SSH access; AWS also offers Instance Connect and other access workflows.
- Provide a name (e.g.,
ec2-demo). - Choose RSA and the
.pemfile format. - Create and download the
.pemfile.

Store your
.pem file securely and restrict its permissions (see the SSH section below). If you lose it, you cannot use it to SSH into the instance unless another access method has been configured.- Network settings: choose a VPC and subnet (the default VPC/subnet is fine for this demo). Enable a public IP if you need SSH from the internet.
- Security group: use an existing group or create a new one. The console often adds an SSH (port 22) inbound rule by default — for production, restrict the Source CIDR rather than using
0.0.0.0/0. - Storage: the default root EBS volume is typically 8 GiB; add volumes if required.

- Advanced details (optional): Spot instances, IAM instance profiles, shutdown behavior, and user data are available here. For this demo, leave defaults.
- Click Launch instance.
What to look for on the Instances page
After launch, open Instances to inspect the new instance. Important fields and where to find them:- Instance ID and Name
- State (running, stopped, terminated)
- Instance type and Availability Zone
- Public IP and Public DNS (if enabled) — usable for SSH
- Security groups and Key name
- Monitoring, tags, and EBS volumes (Storage tab)


Connecting via SSH
Use the Connect dialog on the instance page for guided instructions; it shows allowed connection methods and the default username for the chosen AMI.
- Save the downloaded
.pem(for example,ec2-demo.pem) to a secure directory. - Restrict its permissions so SSH accepts it:
- SSH to the instance using the correct username and the instance public DNS or IP. Example for Amazon Linux:
Useful AWS documentation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html
Instance lifecycle: stop, start, terminate
From the EC2 console, select the instance and use Instance State to control its lifecycle. Summary table:
Notes:
- Instance store (ephemeral) volumes are lost when the instance stops or terminates.
- EBS-backed instances preserve attached EBS volumes while stopped (and storage costs continue).
- Avoid leaving test instances running to prevent unintended charges. For this demo, terminate the instance when finished.
Summary
- Launch: Select AMI, choose instance type, configure key pair, network, security group, and storage.
- Connect: Secure your
.pemfile (chmod 400), then SSH with the appropriate username. - Manage: Use Instance State to stop, start, or terminate; check the Storage tab for EBS details.
- Amazon Elastic Compute Cloud (EC2) course
- AWS: Accessing instances (Linux) — https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html