In this tutorial, you will learn how to launch, configure, and connect to a Windows Virtual Machine using Amazon Elastic Compute Cloud (EC2).  Amazon EC2 is the web service you use to create and run virtual machines in the cloud (we call these virtual machines 'instances'). 

Manage Your Amazon Web Services Resources

Sign in to the Console

When you click here, the Amazon Web Services management console will open in a new browser tab, so you can keep this tutorial open.  Find EC2 under Compute and click to open the Amazon EC2 Console.

(click to zoom)

a. You are now in the Amazon EC2 console. Click Launch Instance 

(click to zoom)


b.  With Amazon EC2, you can specify the software and specifications of the instance you want to use.  In this screen, you are shown options to choose an Amazon Machine Image (AMI), which is a template that contains the software configuration required to launch your instance.  

For this tutorial, find Microsoft Windows Server 2012 R2 Base and click Select.

(click to zoom)


c.  You will now choose an instance type.  Instance types comprise of varying combinations of CPU, memory, storage, and networking capacity so you can choose the appropriate mix for your applications. For more information, see Amazon EC2 Instance Types.

For this tutotiral, selct the default option of t2.micro instance. Then click Review and Launch at the bottom of the page.

(click to zoom)


d. You can review the options that are selected for your instance which include AMI Details, Instance Type, Security Groups, Instance Details, Storage, and Tags.  You can leave these at the defaults and click Launch from the bottom of the page.

Note: For detailed information on your options, see Launching an Instance

(click to zoom)

To connect to your virtual machine, you need a key pair. A key pair is used to log into your instance (just like your house key is used to enter your home).


a. In the popover, select Create a new key pair and name it MyFirstKey. Then click Download Key Pair. MyFirstKey.pem will be downloaded to your computer -- make sure to save this key pair in a safe location on your computer. 

  • Windows users: We recommend saving your key pair in your user directory in a sub-directory called .ssh (ex.C:\user\{yourusername}\.ssh\MyFirstKey.pem).
  • Mac/Linux users: We recommend saving your key pair in the .ssh sub-directory from your home directory (ex.~/.ssh/MyFirstKey.pem).

Note: If you don't remember where you store your SSH private key (the file you are downloading), you won't be able to connect to your virtual machine.

(click to zoom)


b. After you have downloaded and saved your key pair, click Launch Instance to start your Windows Server instance.

Note: It can take a few minutes to launch your instance.

(click to zoom)


c. On the next screen, click View Instances to view the instance you have just created and see its status.

(click to zoom)

After launching your instance, it's time to retrieve the administrator password and connect to it using a Remote Desktop Protocol (RDP) client.

Amazon Web Services documentation includes information on how to install a RDP client if you need one.


a. Select the Windows Server instance you just created and click Connect

(click to zoom)


b.  In order to connect to your Windows virtual machine instance, you will need a user name and password:

  • The User name defaults to Administrator
  • To receive your password, click Get Password

(click to zoom)


c.  In order to retrieve the password, you will need to locate the Key Pair you created in Step 3. Click Choose File and browse to the directory you stored MyFirstKey.pem.  Your Key Pair will surface in the text box. Click Decrypt Password.

(click to zoom)


d.  You now have a decrypted password for your Windows Server instance. Make sure to save this information in a secure location. It is your Windows Server admin login credentials.

(click to zoom)


e.  Click Download Remote Desktop File and open the file.

(click to zoom)


f. When prompted log in to the instance, use the User Name and Password you generated in to connect to your virtual machine.

Note: When you complete this step, you might get a warning that the security certificate could not be authenticated. Simply choose yes and proceed to complete the connection to your Windows Server instance

(click to zoom)

You can easily terminate the Windows Server VM from the Amazon EC2 console. In fact, it is a best practice to terminte instances you are no longer using so you don’t keep getting charged for them.


a. Back on the Amazon EC2 Console, select the box next to the instance you created.  Then click the Actions button, navigate to Instante State, and click Terminate.

(click to zoom)


b. You will be asked to confirm your termination - select Yes, Terminate.

Note: This process can take several seconds to complete.  Once your instnaces has been terminated, the Instance State will change to terminated on your Amazon EC2 Console.

(click to zoom)

You have created, configured, and connected to your first Windows Virtual Machine in the cloud with Amazon EC2.  Without the cost and complexity of purchasing servers or managing data centers, you have more resources to focus on your solution.

Now that you have learned to create, configure, and connect to a Windows Virtual Machine in the cloud, you can progress to the next tutorial where you will learn how to deploy a WordPress Blog on an Amazon EC2 Instance.