EC2: Launch, Login to an Instance

[This is part of the series: Getting Started with EC2]

By now you should have a feel for the AWS/EC2 console and hopefully you’ve picked a Linux distro!

Launching an Instance

This is the exciting part, we get to fire up a new instance! Let’s do it. Head on over to the EC2 console and click Launch Instance.


This is the Request Instance menu. You can see I’ve chosen an Ubuntu AMI. The gold star means that this particular AMI, if used with a micro instance, qualifies for the free tier. Once you’ve picked your AMI, click Select.


This is the Instance Detail menu. You can usually leave all of this alone unless you want to change the number of instance you’re launching, the size of the instance, or if you want a specific availability zone. You could also choose a spot instance, but that’s beyond the scope of this tutorial. Click Continue when you’re done.


This is the Advanced Instance Options menu. I’d strongly suggest you leave everything default here. Click Continue!


This is the last Instance Detail screen. It allows you to add meta-data to your instances. The default attribute is Name…which is just naming your server. It’s a friendly name; not a NetBIOS name or host name. Click Continue when you’re finished.


In order to login to your instance later, you must have a key pair. This allows for secure, passwordless logins. If you don’t have the key pair, you cannot login to your server. At all! Name your keypair anything you want, I’ve named this one “EC2_tutorial”. Click Create and Download, then click Continue. I’ll come back to this more later on.


This is the Configure Firewall menu. It allows you to configure a virtual firewall that sits in front of your instance. If you choose the default instance, all ports are blocked. I’ll come back to this later in the tutorial.


You’ve made it! Now we can launch the instance. Look over the Review screen and click Launch when you’re ready!

After clicking launch, you’ll be returned to the console. Take note of the Instance Details tab at the bottom. You’ll need to know Public DNS name later in this tutorial. Write it down.

Configuring Security

I would assume you want to get into your instance now!


This is the Security Group section of the EC2 console. Click on the Default group, then the inbound tab at the bottom. Delete everything there. Then, on the left select “Allow all TCP” leave the IP range at 0.0.0.0/0 for now. Click Add Rule, then Apply Rule Changes.

Your screen should now look like this. This allows access to every port from any IP address. It’s insecure, but you can fix it later on your own.

Logging In To Your Instance

This is the most exciting part! Logging in for the first time. If you’re on a Mac or a Linux machine, open up the Terminal or Command Line. You’ll be logging in via SSH. These instances usually don’t include GUIs. Enter the following command:

chmod 600 /PATH/TO/KEYPAIR.pem

Where /PATH/TO/KEYPAIR.pem is the path to your key pair file. That’s one of those weird Linux things. Don’t worry about it. We just changed file permissions. Now, to actually login:

ssh -i /PATH/TO/KEYPAIR.pem USER@EC2.PUBLIC.DNS.COM

Again, where /PATH/TO/KEYPAIR.pem is the path to your key pair file.

The username (before the @ symbol), depends on the distro you’ve chosen. Check the documentation. For the Ubuntu AMIs, the username is Ubuntu.

If you’re on a Windows machine, you need PuTTy. Follow the instructions under the “SSH with PuTTy” section here (Normally I would supply screen shots and instructions, but I’m on a Mac…can’t run PuTTY on a Mac!).

Congratulations! You’ve successfully chosen an AMI and launched an instance!

Up next: Installing updates and the infamous LAMP stack!