Skip to main content

Command Palette

Search for a command to run...

How to Create Virtual Machines

How to create Virtual Machine

Updated
5 min read
How to Create Virtual Machines

Lets see how to create Virtual Machine!!!

Your First Virtual Machine: A Step-by-Step Guide to AWS EC2

Introduction: Welcome to the Cloud

Welcome to your first step into the world of cloud computing! I'll be your guide on this exciting first step. The goal of this guide is to walk you through creating a free AWS account and launching your very first virtual machine. In AWS, this is known as an EC2 instance, which is essentially your own personal server running in the AWS cloud.

This process is designed to be straightforward, and this guide will cover every step in detail. No prior experience is needed—we'll start from the very beginning.

1. Creating Your AWS Account

Before you can launch a server, you need an account. Let's get you set up with the AWS Free Tier so you can learn without worrying about costs.

1.1. Getting Started with Sign-Up

  1. Open your favorite web browser and navigate to the AWS sign-in page. You can do this by searching for "AWS console" or by going directly to sign in.aws.com.

  2. On the sign-in page, find and click the Create a new AWS account button.

  3. Follow the on-screen prompts to enter your account details (email, password, contact information, etc.).

  4. AWS requires payment card details for identity verification. A very small, refundable charge (e.g., two rupees in India) may be processed to validate your card. This is a standard security measure.

Once your details are verified, your account will be created, giving you access to the powerful AWS Free Tier.

1.2. Understanding the AWS Free Tier

The AWS Free Tier is designed for users to learn and experiment with cloud services without incurring costs. For new accounts, AWS provides about one year of free access to a specific set of services, as long as your usage stays within the free tier limits.

Here’s a simple comparison to illustrate the difference between a free and a paid virtual machine:

Instance TypeDescription
Free Tier Instance (t2.micro)1 vCPU and 1GB Memory. Perfect for learning.
Paid Instance (t2.large)2 vCPUs and 8GB Memory. For applications needing more power.

Now that your account is ready, let's move on to the exciting part: launching your virtual machine.

2. Launching Your First EC2 Instance

Now that you have your account, it's time for the most exciting part: creating and launching your own server in the cloud. We'll use the AWS Management Console, which is a user-friendly web interface for managing your AWS services.

2.1. Navigating to the EC2 Dashboard

  1. Log in to your newly created AWS account.

  2. In the main console search bar at the top of the page, type EC2 and select it from the list of services that appears.

  3. You are now on the EC2 Dashboard. Find and click the prominent Launch instance button to begin the configuration process.

2.2. Configuring Your Virtual Machine

You will be presented with a configuration screen. Let's walk through the essential settings step-by-step.

2.2.1. Name and Operating System

  • Name: In the "Name" field, give your virtual machine a simple, memorable name, such as test.

  • Operating System (OS): You need to choose an operating system for your server. For beginners, Ubuntu is a highly recommended choice because it is widely used in the DevOps community. However, AWS provides many options, including:

    • Amazon Linux

    • Windows

    • Red Hat

2.2.2. Instance Type (The "Free Tier" Step)

This is the most critical step to avoid unexpected charges.

  • Locate the "Instance type" section.

  • You must select the option clearly marked as Free tier eligible. As shown in the table in section 1.2, this corresponds to the t2.micro instance type, ensuring you stay within the free usage limits. This will provide you with 1 vCPU and 1GB of memory.

2.2.3. Creating Your Key Pair (Your Digital Key)

A key pair is "a password-kind of thing to log into your virtual machine." You will create and download this key now.

  1. Click the Create new key pair button.

  2. Enter a name for your key pair, for example, test111.

  3. Keep the default settings: RSA for the type and .pem for the file format.

  4. Click Create key pair.

Your key pair file (the .pem file) will immediately download to your computer. You MUST save this file in a safe and secure location. If you lose this file, you will not be able to log in to your instance. It is almost impossible to recover access without it.

2.3. Launching and Verifying Your Instance

For a first-time launch, the default network settings are sufficient. We will skip over advanced concepts like "Security Groups" and "VPCs" in this beginner's guide to avoid confusion.

  • Scroll down to the bottom of the page and click the Launch instance button.

  • AWS will now begin creating your virtual machine. This process may take a couple of minutes.

  • To check its status, navigate back to the "Instances" screen from the EC2 dashboard. You will see your new instance in the list. Once its status changes to Running, your virtual machine is ready!

3. Congratulations and What's Next

Congratulations! You have successfully created an AWS account and launched your first fully functional EC2 virtual machine directly from the AWS console. This is a foundational skill in cloud computing.

Your Learning Journey Continues:

Now that your server is running, here are the logical next steps in your cloud journey:

  • Logging in to your new instance: Learn how to connect to your EC2 instance using your terminal and the key pair you saved.

  • Exploring Automation: While creating a server through the console is a great start, a professional DevOps engineer focuses on efficiency and scalability. Imagine needing to create 100 servers—doing it manually would be slow and prone to errors. This is why automation is essential. The professional approach is to write scripts that create infrastructure automatically using tools like the AWS CLI (Command Line Interface), the AWS API (Application Programming Interface), or CloudFormation Templates. Mastering these tools is the next step in moving from a beginner to an infrastructure professional.