Skip to main content

Command Palette

Search for a command to run...

How to Create a Windows EC2 Instance on AWS: A Step-by-Step Guide πŸš€

Launch and Manage Your Windows EC2 Instances

Published
β€’5 min read
How to Create a Windows EC2 Instance on AWS: A Step-by-Step Guide πŸš€
B

Backend Engineer, & a Go Developer | Open Source Contributor, AWS Community Builder, YouTuber, and Blogger.

Hello friends! My name is Bilal Khan, and today, I'm going to guide you through creating a Windows EC2 instance on AWS. If you’ve followed my previous videos, you already know how to create an EC2 instance on Linux. Now, let's dive into setting up an instance on a Windows machine.

Here is the video explanation of it:

Introduction to AWS EC2 Instances πŸ–₯️

Amazon Web Services (AWS) offers Elastic Compute Cloud (EC2) instances, which provide scalable computing capacity in the cloud. With EC2, you can launch virtual servers, configure networking and security, and manage storage. Today, I'll focus on creating a Windows EC2 instance, ideal for those who prefer or need a Windows environment for their applications.

Accessing the AWS Management Console 🌐

First, log into your AWS Management Console. If you don't have an AWS account, you'll need to create one. Once logged in, you’ll be greeted by the AWS Dashboard.

Navigating to EC2

  1. Go to the AWS Dashboard: Locate and click on the β€œServices” dropdown menu.

  2. Select EC2: Under the β€œCompute” section, select β€œEC2”. This will take you to the EC2 Dashboard.

Launching a New EC2 Instance πŸš€

Step 1: Start the Launch Instance Wizard

In the EC2 Dashboard, click on the "Launch Instance" button. This action starts the instance creation process.

Step 2: Choose an Amazon Machine Image (AMI) πŸ–ΌοΈ

You'll be prompted to choose an Amazon Machine Image (AMI). Since we are setting up a Windows instance:

  1. Select Windows AMI: Scroll down to find the Windows Server AMI. Choose the version that fits your needs (e.g., Windows Server 2019 Base).

Step 3: Choose an Instance Type πŸ’»

AWS offers various instance types based on different combinations of CPU, memory, storage, and networking capacity.

  1. Select T2 Medium: For a Windows instance, T2 Micro might not suffice. Choose at least a T2 Medium for better performance. Click on "Next: Configure Instance Details" after selecting the instance type.

Step 4: Configure Instance Details βš™οΈ

In this step, you can configure networking, storage, and other settings.

  1. Network Settings: Ensure you select the appropriate VPC and subnet. If you're unsure, the default settings usually work fine.

  2. Auto-assign Public IP: Ensure this option is enabled, so your instance gets a public IP address.

  3. Storage: By default, AWS assigns 30 GB of general-purpose SSD storage. You can modify this if needed.

Step 5: Add Tags 🏷️

Tags help you manage and organize your AWS resources.

  1. Name your instance: For example, "WindowsInstance".

  2. Add other tags: You can add other tags as per your organizational needs.

Step 6: Configure Security Group πŸ”

Security groups act as a virtual firewall for your instance.

  1. Create a new security group: Allow RDP (Remote Desktop Protocol) from your IP address.

  2. Add rules for HTTP/HTTPS: If your instance will host web services, allow HTTP and HTTPS traffic.

Step 7: Review and Launch πŸš€

Review all the configurations and click "Launch".

  1. Select a Key Pair: AWS uses key pairs to securely access instances. Select an existing key pair or create a new one. Make sure to download the private key file (.pem) if you create a new key pair.

  2. Launch Instance: Click on "Launch Instances". It may take a few minutes for AWS to launch your instance.

Connecting to Your Windows EC2 Instance πŸ”—

Once your instance is running, you'll need to connect to it using RDP.

Step 1: Get the Public IP Address

In the EC2 Dashboard, find your running instance. Note the Public IP address assigned to your instance.

Step 2: Download the RDP File πŸ“

  1. Select your instance: Click on the "Connect" button.

  2. Choose RDP client: Download the remote desktop file provided by AWS.

Step 3: Decrypt the Administrator Password πŸ”‘

  1. Get Password: In the EC2 Dashboard, select your instance and click on "Actions" > "Get Windows Password".

  2. Upload your key pair file: Upload the .pem file associated with the key pair you selected during the instance launch.

  3. Decrypt Password: AWS will decrypt the administrator password for your instance. Copy this password.

Step 4: Connect via RDP πŸ’»

  1. Open the RDP file: The file you downloaded will open the Remote Desktop Connection.

  2. Enter the Password: Use the decrypted password to log in.

Configuring Your Windows Instance πŸ› οΈ

Once connected, you can start configuring your Windows instance as needed. Here are a few basic steps:

Step 1: Command Prompt Verification

  1. Open Command Prompt: Search for "cmd" in the Start menu.

  2. Check IP Configuration: Type ipconfig to see your instance’s IP configuration details.

Step 2: Install Necessary Software

You can install any software you need, just like on any other Windows machine.

  1. Web Browser: Install a web browser like Chrome or Firefox.

  2. Development Tools: Install tools like Visual Studio, Node.js, etc.

Step 3: Configure Network Settings

If your instance needs to be part of a specific network setup:

  1. Network Settings: Configure the network settings through the Control Panel or the Network and Sharing Center.

Managing and Terminating Your Instance πŸ’Ό

When you’re done using your instance, it’s crucial to terminate it to avoid incurring unnecessary charges.

Step 1: Shut Down the Instance

  1. EC2 Dashboard: Go to the Instances section.

  2. Terminate Instance: Select your instance, click on "Actions", and then "Terminate".

Step 2: Confirm Termination

  1. Confirm: Confirm that you want to terminate the instance. AWS will shut down and remove the instance.

Conclusion 🎯

Creating and managing a Windows EC2 instance on AWS is a straightforward process. By following these steps, you can set up a Windows environment in the cloud, configure it to your needs, and manage it efficiently. Remember to terminate your instance when it’s no longer needed to avoid additional costs.

You can Buy Me a Coffee if you want to and don't forget to follow me on YouTube, Twitter, and LinkedIn.

Happy Clouding! 😊

More from this blog

Bilal's Blog

92 posts

Backend Engineer, & a Go Developer | Open Source Contributor, AWS Community Builder, YouTuber, and Blogger.