Step 1: Sign in to the AWS Management Console
Open the AWS Management Console.
Sign in with your AWS account credentials.
Step 2: Navigate to the EC2 Dashboard
From the AWS Management Console, find and click on "EC2" under the "Compute" section or use the search bar at the top.
Step 3: Launch an Instance
In the EC2 Dashboard, click on the "Launch Instance" button.
Step 4: Choose an Amazon Machine Image (AMI)
Select an AMI that suits your needs. Common choices are Amazon Linux 2, Ubuntu Server, or other Linux distributions.
Click "Select" next to the desired AMI.
Step 5: Choose an Instance Type
Select an instance type based on your requirements. The t2.micro instance type is eligible for the free tier and is a good starting point.
Click "Next: Configure Instance Details."
Step 6: Configure Instance Details
Number of instances: Choose the number of instances to launch (usually 1).
Network: Select the default VPC or a custom VPC if you have one.
Subnet: Select a subnet within the VPC.
Auto-assign Public IP: Choose "Enable" to automatically assign a public IP address.
Other settings can be left as default or configured as needed.
Click "Next: Add Storage."
Step 7: Add Storage
Configure the storage for your instance. By default, you get an 8 GB General Purpose (GP2) root volume.
Add additional volumes if necessary.
Click "Next: Add Tags."
Step 8: Add Tags
Add tags to your instance. Tags are key-value pairs that help you manage and identify your instances.
Click "Next: Configure Security Group."
Step 9: Configure Security Group
Create a new security group or select an existing one.
Add rules to allow SSH access (port 22) from your IP address. You can also add HTTP (port 80) and HTTPS (port 443) access if you are setting up a web server.
Click "Review and Launch."
Step 10: Review and Launch
Review your instance configuration.
Click "Launch."
Step 11: Select a Key Pair
In the pop-up, choose an existing key pair or create a new one. This key pair will be used to SSH into your instance.
If creating a new key pair, download the key pair file (.pem) and keep it secure.
Acknowledge that you have access to the selected key pair.
Click "Launch Instances."
Step 12: Access Your Instance
Wait for the instance to launch. This can take a few minutes.
Once the instance state changes to "running," select the instance and note the public IP address or public DNS.
Connect to your instance using SSH:
ssh -i /path/to/your-key-pair.pem ec2-user@your-public-ip
Replace /path/to/your-key-pair.pem with the path to your key pair file and your-public-ip with the public IP address of your instance. The username (ec2-user) may vary based on the AMI you selected (e.g., ubuntu for Ubuntu instances).
Summary of Steps
Sign in to AWS Management Console
Navigate to EC2 Dashboard
Launch Instance
Choose AMI
Choose Instance Type
Configure Instance Details
Add Storage
Add Tags
Configure Security Group
Review and Launch
Select a Key Pair
Access Your Instance