Ad space (banner)
AD

Got the fundamentals? A structured AWS course is a fast way to level up.

Find AWS courses on Udemy

Affiliate link. Costs you nothing extra.

☁️AWS Lessons
Lesson 24 / 41

Launching an Instance with aws ec2 run-instances

When you want a server, use aws ec2 run-instances. It launches a new EC2 instance.

The syntax is aws ec2 run-instances --instance-type type, normally together with an AMI ID and a key pair.

Running aws ec2 run-instances --instance-type t2.micro launches an instance and returns its ID and state as JSON.

A common stumble is launching a larger type than needed "to be safe." Costs scale with the type, and resizing later is straightforward.

In real work, instances are rarely launched by hand — infrastructure as code tools such as Terraform or CloudFormation do it reproducibly.

AWS
Try it (type this into the pseudo terminal)
aws ec2 run-instances --instance-type t2.micro

🧑‍💻 You can type this command into the AWS pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)