DEV Community

Cover image for How To Set Up An EC2 Instance on AWS
David Oyewole
David Oyewole

Posted on

How To Set Up An EC2 Instance on AWS

INTRODUCTION

WHAT IS EC2
Amazon Elastic Compute Cloud (Amazon EC2) is a pivotal service within the Amazon Web Services (AWS) suite of products. It functions as a scalable and highly secure virtual server, enabling users to effortlessly host applications without the need for upfront hardware investments. Operating EC2 is convenient, as it can be easily launched and managed from the AWS dashboard. The service encompasses a wide array of computing capabilities and grants users the flexibility to customize specifications such as RAM, ROM, and more. EC2 significantly streamlines the development process by facilitating easy scalability and seamless integration with other services, making it a highly valuable tool for developers and businesses.

WHY USE EC2

  1. Easy to scale up and down.
  2. Remote Access to your assets from anywhere in the world.
  3. Very Secure.
  4. Pay-As-You use i.e. you only pay for what you use.
  5. Easy to set up as no hardware is required.

SETTING UP AN EC2 INSTANCE

Let's take a step-by-step look at how to set up an EC2 instance

Step 1: Log in to your AWS account or create an account Here

Step 2: Click on services by the top left corner or EC2 as shown in the image below, if you click on services, you will need to click on EC2 in the next screen.

AWS Console

Step 3: Click on launch instance button as shown below.

AWS Console

Step 4: Configure the instance, examples are given below

  • Name the instance

AWS Console

  • Select the type of OS you want and also the AMI(Amazon Machine Image) you want, take note, and take advantage of the AMI eligible for free-tier if your account is less than a year old. Also, select the Architecture you want.

AWS Console

  • Select the instance type you want, and also take note of the free-tier eligible ones.

AWS Console

  • Create a new key pair or select an existing one if you already have one. This key pair will allow you to securely connect to the instance using SSH agents. Click on the create new key pair button.

AWS Console

  • Input a name, select the key type and key format then click on the Create Key Pair button shown below.

AWS Console

  • Configure the network settings, select an existing security group, or create a new one and specify the rules.

AWS Console

  • Configure the storage you want or leave the default one

AWS Console

  • Click on the Launch Instance button at the bottom left corner.

AWS Console

Step 5: The next screen will take a moment and then show you a success message, click on the instance ID shown in the message to see the state of your instance.

AWS Console
Step 6: Wait for some moments for the instance to initiate, click on the reload button shown below to refresh, and when the status check turns green, your instance is up and running.

AWS Console

Step 7: Click on the instance ID from the screen above, this will take you to the instance summary shown below. Click on the connect button to connect to your instance CLI, you can also connect to the instance using any SSH agent with the key pair we created earlier.

AWS Console

CONCLUSION

This comprehensive article provides a step-by-step guide to simplify the process of launching an EC2 instance. By following the detailed instructions, you will not only be able to launch the instance but also learn how to configure it according to your specific needs and requirements.

Top comments (0)