There’s something empowering about spinning up your own virtual machine in the cloud — especially when you do it entirely from the command line.

No clicking through tabs. No IDE. No download-this, install-that.

Just pure terminal.

 Just you and the cloud.

🌩️ Why I Tried AWS CloudShell

As a cloud enthusiast (and someone who occasionally breaks things on my own machine), I decided to explore AWS CloudShell — a browser-based terminal environment that runs right inside the AWS Management Console. No need to install the AWS CLI or generate SSH keys on my laptop. It’s preloaded, persistent, and honestly, kind of amazing.

I’d previously used EC2 through the UI, but this time, I challenged myself:

“Can I launch and connect to an EC2 instance without ever leaving the terminal?”

Spoiler: Yes. And here’s how I did it.

⚙️ Step 1: Opened CloudShell

From the AWS Console, I clicked on the little terminal icon in the top-right — that’s CloudShell.

Within seconds, I had a shell prompt, running in a pre-configured Amazon Linux environment, with full AWS CLI access.

🔐 Step 2: Created a Key Pair

To connect via SSH later, I needed a key pair. From CloudShell, I ran:

aws ec2 create-key-pair
  --key-name my-key 
  --query 'KeyMaterial' 
  --output text > my-key.pem

Then I set the right permissions:

chmod 400 my-key.pem

✅ This generated a private key and saved it locally in CloudShell. No downloading needed.

🚀 Step 3: Launched the EC2 Instance

I picked a simple Amazon Linux AMI and started a t2.micro instance like this:

aws ec2 run-instances \
  --image-id ami-0abcdef1234567890 \  # Replace with a valid AMI ID in your region
  --count 1 \
  --instance-type t2.micro \
  --key-name my-key \
  --security-groups default

Want a specific region? Add --region us-east-1 or whatever suits your setup.

I noted the returned _InstanceId _because I’d need it soon.

🔍 Step 4: Waited for the Instance and Got the Public IP

Once the instance was running, I fetched its public IP:

aws ec2 describe-instances
  --filters "Name=instance-state-name,Values=running" 
  --query "Reservations[*].Instances[*].PublicIpAddress" 
  --output text

This gave me something like:

3.145.78.123

That’s my gateway into the cloud machine.

🔗 Step 5: SSH’d Into My Instance

Now came the satisfying part — actually connecting. Still in CloudShell, I ran:

ssh -i my-key.pem [email protected]

And boom 💥 — I was in.

A full-blown Linux VM, all mine, running in the cloud, controlled 100% from the browser-based terminal. No local setup. No downloads. Just me and my instance.

🧼 Bonus: Cleaning Up

When I was done experimenting, I cleaned up to avoid extra costs:

aws ec2 terminate-instances --instance-ids i-0abcd1234efgh5678

And optionally deleted the key:

aws ec2 delete-key-pair --key-name my-key
rm my-key.pem

🧠 What I Learned

  • AWS CloudShell is perfect for CLI-based workflows, even on a Chromebook or borrowed laptop.
  • You don’t need a full IDE or even a configured local environment to manage cloud infrastructure.
  • The AWS CLI is incredibly powerful (and feels like a cheat code once you get comfortable).

🎯 Final Thoughts

Starting an EC2 instance from the terminal might seem intimidating — but it’s actually elegant. Clean. Fast. And it gives you a deeper sense of control than the AWS GUI ever could.

If you’ve been hesitant to touch the CLI, I highly recommend giving CloudShell a try. It’s like training wheels for power users.

And once you SSH into your first cloud machine using nothing but the terminal?
 You’ll never forget that feeling.