# About EC2

what is EC2 and how to launch it?

to launch an ec2 server, we need to know these 7 steps before moving onto ec2:

### **step 1: Choose an Amazon Machine image (AMI)**

each ami contains AMI ID which is region specific

### **step 2: Choose an Instance Type**

here we are providing cpu and memory to our instance

### **step 3: Configure your instance**

**it means how many no. of instances you want to setup.**

**you can launch multiple instances from same AMI.**

in this step, we will configure on which network, in which data centre of region, we are going to create server.

### **step 4: Add Storage**

**to store the data in server we use ebs volumes.**

**ebs stands for elastic block storage. for single instance, we can attach multiple ebs volumes. ebs is one of the aws service which will provide the storage for your server.**

### **step 5: Add Tags**

**you can name your instance** here

### **step 6: Configuring Security Groups**

**security group means set of firewall rules that controls which network traffic is allowed to reach or leave your instance.**

### **step 7: Key pair**

An AWS EC2 key pair consists of a **public key and a private key** used for **SSH authentication**.

key pair is like a password/key for authentication.

we can connect the server in 2 ways:

with key-pair - for safe and secured way

without key-pair - unsafe

<mark class="bg-yellow-200 dark:bg-yellow-500/30">EC2 server checks whether your </mark> **<mark class="bg-yellow-200 dark:bg-yellow-500/30">private key</mark>** <mark class="bg-yellow-200 dark:bg-yellow-500/30"> matches the </mark> **<mark class="bg-yellow-200 dark:bg-yellow-500/30">public key</mark>** <mark class="bg-yellow-200 dark:bg-yellow-500/30"> stored on the server.</mark> then only it will connect to server.
