DEV Community

Cover image for How to Create a Windows Server on AWS EC2 (Beginner’s Guide)
Mubarak
Mubarak

Posted on

How to Create a Windows Server on AWS EC2 (Beginner’s Guide)

Learn how to set up a Windows Server on Amazon EC2, from creating your instance to logging in via Remote Desktop.


📝 Introduction

Amazon EC2 is like renting a computer in the cloud. Instead of buying a physical server, you can instantly create one online, choose whether it runs Windows or Linux, and use it just like a normal computer—but you only pay for the time you actually use it.

You can choose instance types based on CPU, memory, and storage, and configure networking/security via VPC and security groups. EC2 integrates with other AWS services like IAM, S3, and CloudWatch, making it ideal for hosting apps, testing environments, or production workloads.

When you’re just starting with cloud computing, AWS can feel overwhelming. But don’t worry, launching your first Windows Server on AWS EC2 is easier than it looks.

In this guide, I’ll walk you through every step, from setting up your instance to connecting with Remote Desktop. By the end, you’ll have your own Windows Server running in the cloud, ready for web hosting, development, or even a test lab.


✅ Prerequisites

Before we begin, you’ll need:

  • An AWS account (sign up here)
  • Basic familiarity with the AWS Management Console (Don’t worry, we’ll keep it simple)
  • A key pair (we’ll cover how to create one if you don’t have it)

🚀 Step 1: Log in to AWS Console

  1. Create an AWS account or sign in if you already have one.
  2. Proceed to sign in using the Root user, then enter your email address and password.



🚀 Step 2: Launch an Instance

1) From the AWS console, search for EC2 and click on it.

2) You can click on Launch instance immediately or go to the dashboard to see your running instances, key pairs, and security groups.

After launching an instance, you’ll be asked to provide a name; in my case i used “MyWindowsServer” as the name.


🚀 Step 3: Choose an Amazon Machine Image (AMI)

  • The next step is to set the Amazon Machine Image (AMI) to Windows. Under Quick Start, select Microsoft Windows Server 2025 Base.


🚀 Step 4: Choose Instance Type

  • For testing/demo → t3.micro (Free Tier eligible).
  • For production/heavier workloads → larger instances like m5, m6i, m7i.


🚀 Step 5: Configure Key Pair

  • Select an existing key pair or create a new one.
  • If creating new → choose .pem format, give it a name, and download the file.

⚠️ Keep the .pem file safe—you’ll need it later to decrypt your Windows password.


🚀 Step 6: Configure Network Settings

  • Use the default VPC (or create a new one if none exists).

To create a new VPC, click on the search bar at the top left and type "VPC," right-click on the VPC, and open it in a new tab.

Click on Create VPC.

The next step is to go back to the previous tab, click on the refresh button, and then click the drop-down button in order to see your new VPC.

  • Enable Auto-assign public IP.
  • Create a new security group (e.g., “WindowsServer”).

  • Make sure RDP (TCP/3389) is allowed in inbound rules.


🚀 Step 7: Configure Storage

  • By default, AWS provides 30GB of EBS storage.
  • Adjust only if your workload requires more.

The next step is to scroll down to “Advanced details.” Move down to DNS Hostname, then tick “Enable resource-based IPv4.”


🚀 Step 8: Review & Launch

  • Review all your settings.
  • If everything looks good, click Launch Instance.


🚀 Step 9: Connect to Your Windows Server

1) Go to EC2 → Instances (running).

2) Copy the Public IPv4 address of your instance.

3) On your computer, press Win + R, type mstsc, and click OK.

4) Paste the IPv4 address in the Remote Desktop Connection box.

5) In AWS, click connect and select RDP Client → Get Password.

6) Upload your .pem file → click Decrypt Password.

7) Copy the "Administrator" username and "decrypted password".

8) Log in via Remote Desktop.
Click Yes to proceed.

🎉 Congratulations! Your Windows Server is live.


🔧 What’s Next?

From here, you can:

  • Install enterprise apps or use it as a remote workstation
  • Host a website (install IIS)
  • Set up Active Directory for a test lab
  • Store/backup important files centrally

If you want to log off the Windows Server instance, open your Run dialog box by pressing the keyboard shortcut “Win + R” and type “logoff” then click ok, and your session will be terminated.

⚠️ Tip: Remember to stop or terminate your instance when not in use to avoid unexpected AWS charges.


📝 Conclusion

Launching a Windows Server EC2 instance on AWS is straightforward once you know the steps:

Choose AMI → Pick instance type → Configure security → Launch → Connect via RDP.

With this knowledge, you can now build Windows-based environments in the cloud in just minutes.


✍️ I write about DevOps, Cloud Computing, and Blockchain Infrastructure. Follow me here on Dev.to and Medium (https://medium.com/@jimmybillz2021) to learn along with me!

Top comments (0)