DevOpsLesson
DevOpsLesson

Free, comprehensive DevOps tutorials and learning roadmaps. Master Docker, Kubernetes, CI/CD, and more.

Stay Updated

Get notified about new tutorials and features.

Tutorials

  • What is DevOps?
  • Docker Tutorial
  • Terraform Tutorial
  • CI/CD Pipeline
  • All Tutorials

Roadmaps

  • DevOps Engineer
  • Cloud Engineer
  • SRE Path
  • All Roadmaps

Company

  • About Us
  • Blog
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 DevOpsLesson. All rights reserved.

DOCKERKUBERNETESTERRAFORMAWSCI/CDLINUXGITDEVOPS ROADMAPCLOUD ROADMAPSRE ROADMAPGIT CHEATSHEETDOCKER CHEATSHEETK8S CHEATSHEETTF CHEATSHEETLINUX CHEATSHEETDOCKERFILE LINTERYAML VALIDATORCRON PARSERREGEX TESTER

Aws Tutorial

Introduction to AWS
AWS Global Infrastructure
Setting Up AWS
AWS IAM
AWS EC2
AWS VPC
AWS S3
AWS RDS
AWS Lambda
AWS ECS and EKS
AWS CloudWatch
AWS CodePipeline
AWS Cost Optimization
AWS Elastic Load Balancing
AWS Auto Scaling
AWS CloudFront
AWS Route 53
AWS DynamoDB
AWS ElastiCache
AWS SQS
AWS SNS
AWS EventBridge
AWS Step Functions
AWS API Gateway
AWS ECR
AWS EKS
AWS CloudFormation
AWS Elastic Beanstalk
AWS KMS
AWS Secrets Manager
AWS WAF and Shield
AWS CloudTrail
AWS Config
AWS Systems Manager
AWS Organizations
AWS EFS
AWS EBS Deep Dive
AWS Kinesis
AWS Athena
AWS CodeDeploy
AWS CodeCommit
AWS CDK
AWS SAM

AWS EC2 Launch Instance

PreviousPrev
Next

Launch an EC2 instance step by step by choosing an AMI, instance type, networking, security group, and key pair, then connect over SSH.

Launching an EC2 instance is one of the most common first AWS tasks because it turns abstract cloud concepts into a working server. The launch flow asks you to make a few foundational decisions: which AMI to use, which instance type fits the workload, which VPC and subnet the machine should join, which security group defines allowed traffic, and which key pair or access path you will use to sign in.

The AMI choice defines the starting operating system and package baseline. For general labs, an Amazon Linux or Ubuntu image is usually enough. Instance type selection follows: a small t3 or t4g instance works well for light testing, while CPU-heavy or memory-heavy workloads may need a different family. Then choose the network placement carefully. A public subnet plus public IP makes first-time access easy, but many production instances belong in private subnets behind a load balancer.

Launch decisionWhat to check
AMIOS version, architecture, support expectations
Instance typeCPU, RAM, burst behavior, cost
SubnetPublic or private placement, AZ choice
Security groupMinimum inbound ports needed
Key pairSecure SSH access or SSM-based access plan

After launch, connect with SSH if the security group allows it and you have the private key. Typical first commands are uname -a, df -h, free -m, and systemctl status on the services you care about. These quick checks confirm the instance booted correctly and that you are in the expected environment.

For production, keep two habits in mind. First, attach an IAM role so applications can access AWS APIs without static keys. Second, avoid wide-open inbound rules such as SSH from 0.0.0.0/0. EC2 is simple to launch, but safe defaults require a bit more thought than the console wizard suggests.

Continue with AWS EC2 Security Groups and AWS EC2 Key Pairs for the two settings beginners most often misconfigure.

aws ec2 run-instances --image-id ami-1234567890abcdef0 --instance-type t3.micro --key-name demo-key --security-group-ids sg-1234567890abcdef0 --subnet-id subnet-1234567890abcdef0
ssh -i demo-key.pem ec2-user@203.0.113.10
uname -a
df -h

Operational note

Treat EC2 instances as managed infrastructure, not pets. Capture launch settings in infrastructure as code, keep bootstrap steps repeatable, and monitor CPU, memory, disk, and patch level from the start. That way replacing an instance is a routine operation instead of a risky manual repair exercise. Shared standards like this make future environments easier to launch, review, and support.

Exercise

Launch workflow

Which EC2 launch setting controls the machine image used to boot the instance?

Exercise

Post-launch access

What is usually needed to SSH into a newly launched Linux EC2 instance?

PreviousPrev
Next

Continue Learning

AWS IAM Roles and Policies

Learn when to use IAM roles, how policy JSON works, and why managed policies are usually better than many inline exceptions.

15 min·Intermediate

AWS IAM Best Practices

Apply practical IAM security habits such as MFA, access key rotation, role-based access, and regular permission review with AWS analyzers.

10 min·Intermediate

AWS EC2

Learn how Amazon EC2 provides virtual machines in the cloud and how AMIs, instance types, storage, and pricing models affect deployments.

20 min·Intermediate

Explore Related Topics

Te

Terraform Tutorials

Manage AWS infrastructure as code

Li

Linux Tutorials

Essential Linux skills for working with EC2

On This Page

Operational note