DEV Community

Mahinsha Nazeer
Mahinsha Nazeer

Posted on • Originally published at Medium on

Step-by-Step Guide to Launching an EC2 Instance on AWS : For Beginners

Step-by-Step Guide to Launching an EC2 Instance on AWS: For Beginners

This guide is designed for beginners stepping into AWS. Amazon EC2 (Elastic Compute Cloud) is a virtual machine in the cloud, enabling you to launch servers and run your applications with ease. To set up an EC2 instance, you’ll need to configure a few essential parameters, which we’ll walk through step by step.

Getting started with cloud computing is easier than ever with AWS Free Tier. AWS offers a free tier program that allows beginners to explore many AWS services, including EC2, without incurring charges for up to 12 months. This is ideal for learning, experimenting, or running small-scale projects.

In this guide, we’ll walk you through launching your first EC2 instance  — a virtual server in the cloud — using parameters and settings suitable for beginners. By the end of this tutorial, you’ll have a fully functional EC2 instance ready for deploying applications, all while staying within the free tier limits.

You can check out AWS Free Tier here:

Free Cloud Computing Services - AWS Free Tier

Start by logging in to your AWS Management Console. In the search bar at the top, type EC2 and select it from the results. This will take you to the EC2 Dashboard, where you can manage and launch your virtual servers.


AWS Console search bar

Once you are on the EC2 Dashboard, click on the ‘Launch Instance’ button. This will initiate the process of creating a new virtual server, guiding you through configuring instance details, selecting an Amazon Machine Image (AMI), choosing an instance type, and setting up security options.


Launching new EC2 instance

1. Names and tags:

Give a suitable name for your EC2 machine

2. Choose an Amazon Machine Image (AMI)

An AMI is a pre-configured template for your instance. Options include:

  • Amazon Linux  — Lightweight and optimised for AWS.
  • Ubuntu, Red Hat, Windows Server  — Depending on your application needs.
  • Custom AMIs  — If you have a pre-configured image.
  • Choose the architecture (For beginners, 64-bit x86 is fine, which is there by default)


Configuration

3. Choose an Instance Type

This defines the compute resources for your server:

  • CPU, memory, storage, and network capacity.
  • Common types: t2.micro (free tier eligible), t3.medium, etc.
  • Choose based on your workload requirements.

4. Configure Instance Details

Key settings in this section:

  • Number of Instances  — How many identical servers to launch at once. Default is 1.
  • Network & Subnet  — Select your VPC and subnet.
  • Auto-assign Public IP  — Useful if you need internet access.
  • IAM Role  — Assign permissions for AWS services.
  • Monitoring & Shutdown Behaviour  — Optional settings for CloudWatch and automatic stop/terminate actions.

5. Create or Select a Key Pair

  • In the Review and Launch step, you can select an existing key pair or create a new one. ( Easiest method for beginners)
  • If creating a new key pair:
  • Give it a descriptive name (e.g., WebServerKey).
  • Download the .pem file immediately—AWS will not allow downloading it later.

6. Add Storage

  • Define EBS volumes for your instance.
  • Configure size , volume type , and encryption.
  • You can add additional volumes if required.

7. Add Tags

Tags are key-value pairs to identify your instance:

  • Example: Key = Name, Value = WebServer1.
  • Tags make managing multiple instances easier.

8. Configure Security Group

  • Security groups act as a firewall for your instance.
  • Add rules for inbound traffic, e.g.:
  • SSH (22) — for Linux access.
  • HTTP (80) and HTTPS (443) — for web servers.
  • You can create a new security group or select an existing one.

9. Review and Launch

  • Verify all settings before launching.
  • Click Launch , and select or create a key pair for SSH access.
  • Download the key pair and store it securely — it’s required to connect to your instance.


Network and SSH configuration


Storage configuration

Final Step: Launch Your EC2 Instance

After reviewing all settings, configuring the SSH key , and ensuring your security groups are properly set:

  1. Click the “Launch” button.
  2. Your instance will start initialising. You can monitor its status in the EC2 Dashboard under Instances.
  3. Once the instance state changes to “running” , note the public IP or DNS name  — you will use this to connect via SSH.

Security Reminder:

  • Never share your .pem key file publicly.
  • Only allow SSH access from trusted IPs in your security group.

Now your EC2 instance is ready, and you can deploy applications or configure it as required.


Launching instance

Once your EC2 instance is in the “running” state, you can connect to it from your local machine using the SSH key you created:

  1. Locate the Public IP
  • In the EC2 Dashboard, select your instance and copy its public IP address or public DNS name.

Set Permissions for Your Key

  • On Linux/macOS, run:
  • chmod 400 your-key.pem
  • This ensures the SSH key file is secure and usable.

Connect via SSH

  • Run the following command from your terminal:
  • ssh -i /path/to/your-key.pem ec2-user@
  • For Ubuntu AMIs , replace ec2-user with ubuntu.

Successful Connection

  • After connecting, you’ll see the command prompt of your EC2 instance, indicating you can now manage it remotely and deploy applications.

Top comments (0)