Getting Started with AWS: "Create Your First EC2 Linux Instance"
Published: 2023-08-13 11:22:43

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!

<u>**5 Reasons to use Amazon EC2 Service:**</u>

**- 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/](https://console.aws.amazon.com/). Sign in with your AWS credentials and search for “EC2”:

![Search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0zck9qskjj6c2ptfysf.png)

**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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5eyl3af6i3wbzysjiro7.png)


![Launch](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/400pq11truyma4g1c5pw.png)

**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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xyve5gsgirru7rrvhjof.png)

**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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/czb3rbjewrzkavrttbtb.png)

**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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2xyzuk87qs2bmt4pti0x.png)

**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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0eugs3gwj87bmgftr6pf.png)


**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!



<u>**References:**</u>
_**Previous Blog:**_ [Getting Started with AWS S3: Create Your First Bucket and Upload a File](https://dev.to/awscloudclubs/getting-started-with-aws-s3-create-your-first-bucket-and-upload-a-file-192)
_**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”](https://dev.to/awscloudclubs/learn-how-to-add-files-to-the-indexhtml-file-from-s3-bucket-storage-and-run-it-on-the-browser-via-termius-on-an-ec2-instance-45h8)