DEV Community

Cover image for Getting Started with AWS: "Create Your First EC2 Linux Instance"
Kiran Amin Panjwani for Cloud Clubs

Posted on • Edited on

Getting Started with AWS: "Create Your First EC2 Linux Instance"

Welcome to this beginner's guide to AWS EC2 (Elastic Compute Cloud). In this blog, we will walk you through the process of creating your first EC2 Linux instance on the Amazon Web Services platform. EC2 offers scalable computer capacity in the cloud, and it's a fundamental service that allows you to launch and manage virtual servers with ease. Let's get started!

5 Reasons to use Amazon EC2 Service:

- Flexibility and Scalability:
AWS EC2 offers a wide range of instance types, allowing you to choose the virtual server configuration that best fits your application's requirements. Whether you need a general-purpose instance for everyday computing or a high-performance instance for computer-intensive tasks, EC2 has you covered.

- Pay as You Go:
With AWS EC2, you only pay for the compute capacity you use. This pay-as-you-go model means you can scale your infrastructure up or down as needed, and you won't be charged for unused resources.

- Easy Instance Management:
Launching, configuring, and managing EC2 instances is straightforward via the AWS Management Console or API. You have full control over your instances, including the ability to start, stop, and terminate them as needed.

- Global Reach:
AWS EC2 operates in multiple regions around the world, allowing you to deploy your instances close to your target audience for reduced latency and improved performance.

- Integration with Other AWS Services:
EC2 seamlessly integrates with other AWS services, making it a vital component of many cloud-based applications. From databases to content delivery networks, EC2 can work in conjunction with various services to provide a complete solution.

Now, let’s walk you through the process of setting up your cloud-based, virtual Linux server using AWS EC2. Let's begin!

1. Access the AWS Management Console:
Navigate to the AWS Management Console by visiting https://console.aws.amazon.com/. Sign in with your AWS credentials and search for “EC2”:

Search

2. Launch the EC2 Instance:
In the AWS Management Console, locate and click on "Instances" in the left-hand menu, and then click on the "Launch Instance" button.

Instances

Launch

3. Choose Instance Details:
After clicking "Launch Instance," provide a meaningful name for your instance (for example: "demoinstance"). Next, scroll down and select "Ubuntu" under the "Quick Start" tab.

start

4. Select the Amazon Machine Image:
From the dropdown menu of "Amazon Machine Image," choose "Ubuntu Server 20.04 LTS (HVM), SSD Volume Type" as your operating system.

select

5. Create a New Key Pair:
In the "Key Pair (login)" section, select "create new key pair" to generate a new keypair. In the new window, give it a meaningful name, such as "demokeypair," and select "ppk" as its format. Pressing will have the ".ppk" file download and save to your local machine.

keypair

6. Save the Key Pair:
Set the destination of the downloaded ".ppk" file to your Desktop or any preferred location. For example, "C:\Users\hp\Desktop".

7. Configure Security Group:
Enable necessary access to your EC2 instance by checking all of the unchecked boxes under the "Firewall (security groups)" section.

Firewall

8. Review and Launch:
Review all your settings to ensure they are correct. Once you're ready, click on the "Launch Instance" button.

Congratulations! Your EC2 instance has successfully been created. You will need to wait a few minutes for the instance state to change to "running," and all "Status Checks" to pass successfully.

Now that your instance is up and running, you can explore deploying applications, hosting websites, running databases, and more. Optimize costs by stopping or terminating instances when not in use. As you continue your journey into the world of AWS, don't forget to discover the other services and capabilities that AWS offers.

Happy cloud computing!

References:
Previous Blog: Getting Started with AWS S3: Create Your First Bucket and Upload a File
What's Next? Learn How to: “Add Files to the index.html File from S3 Bucket Storage and Run It on the Browser via Termius on an EC2 Instance”

Top comments (0)