How to Create AWS EC2 Instances

Celestina OdiliCelestina Odili
4 min read

Introduction

Amazon Elastic Compute Cloud (Amazon EC2) is a core service within Amazon Web Services (AWS) that provides resizable compute capacity in the cloud. It allows you to run virtual servers (known as instances) on-demand, giving you the flexibility to scale your compute resources based on demand. EC2 is widely used for deploying applications, websites, and backend services with full control over the infrastructure.

Common Use Cases for EC2:

  1. Web Hosting:

    • EC2 is commonly used to host websites and web applications, from small blogs to large enterprise applications. It can scale up to handle spikes in traffic and provide high availability.
  2. Data Processing:

    • EC2 is used for batch processing and big data analytics. It provides the compute power needed for processing large volumes of data efficiently.
  3. Machine Learning and AI:

    • EC2 instances with GPU support (e.g., p3, g4) are ideal for training machine learning models and running inference tasks.
  4. Application Hosting:

    • Developers use EC2 to deploy custom applications. It supports a variety of programming languages, frameworks, and tools.
  5. Disaster Recovery and Backup:

    • EC2 instances can be used as part of a disaster recovery plan, allowing businesses to quickly spin up backup servers in the event of an outage.
  6. Development and Testing:

    • Developers use EC2 to quickly spin up environments for development, testing, and staging purposes, allowing for rapid iteration and flexibility.

Advantages of AWS EC2:

  • Scalability: EC2 allows you to scale your compute capacity according to demand, whether that’s adding more instances or upgrading to more powerful instances.

  • Flexibility: With a wide variety of instance types, OS choices, and configurations, you can tailor EC2 to your exact needs.

  • Cost-Effectiveness: EC2’s pay-as-you-go model makes it cost-effective for businesses of all sizes. Reserved and Spot Instances offer significant cost savings.

  • Global Reach: EC2 is available in multiple AWS regions and availability zones, enabling businesses to deploy applications closer to their end-users for better performance and reliability.

  • Integration with AWS Ecosystem: EC2 works seamlessly with other AWS services, providing a robust platform for building and managing complex applications.

    Step by Step guide to Create EC2 Instance

    1. Sign in to AWS Account
  • Go to aws.amazon.com and sign in to AWS management console. If you do not have an AWS account yet, click Create an AWS Account to create one.

  • For a guide on how to create AWS Account, click here

  1. Launch an EC2 Instance
  • Search for EC2 on the AWS Management Console search bar and select it.

  • On the EC2 Dashboard, Click on Launch Instance.

    1. Provide the EC2 Instance Details
  • Under name and tags, provide a name for the instance

  • Under application and OS Images (Amazon Machine Image), select an an image type and Choose a free tier eligible version from Amazon Machine Image (AMI) dropdown.

    • Here we will use Red Hat

    • Under description, take note of the username, you will need it for connection. For Red Hat, the username is ec2-user.

  • Select an Instance Type: choose any suitable type. Here I am using ubuntu and t3.micro instance.

  • Create new key pair or select an existing: To create new one click on create new key pair and provide key pair name and click create key pair, It will be downloaded automatically.

  • Network setting: Click edit to select a subnet. This is important so you can note the availability zone.

    • Leave the rest at default.
  • Summary: Review summary and launch the instance to create.

  • Once the instance is successfully created, you will see a success notification. You can click on the instance ID to open and view the instance summary.

Conclusion

Amazon EC2 is a versatile, scalable, and powerful service that allows businesses and developers to run applications in the cloud with full control over their virtual servers. Its flexibility, variety of instance types, and integration with the broader AWS ecosystem make it a popular choice for a wide range of use cases, from web hosting to machine learning and beyond.

0
Subscribe to my newsletter

Read articles from Celestina Odili directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Celestina Odili
Celestina Odili

Computer Scientist/ Cloud Engineer/DevOps Engineer / Technical writer