Table of contents
- Creating an EC2 Instance on AWS
- Prerequisites
- Step 1: Accessing the AWS Management Console
- Step 2: Navigating to EC2 Dashboard
- Step 3: Launching an Instance
- Step 4: Choosing an Amazon Machine Image (AMI)
- Step 5: Selecting an Instance Type
- Step 6: Configuring Instance Details
- Step 7: Adding Storage
- Step 8: Adding Tags (Optional)
- Step 9: Configuring Security Group
- Step 10: Reviewing Instance Launch
- Step 11: Key Pair Setup
- Step 12: Launching the Instance
- Step 13: Viewing Instances
- Step 14: Connecting to the Instance
Creating an EC2 Instance on AWS
Amazon EC2 (Elastic Compute Cloud) is a scalable cloud computing service that allows users to run virtual servers in the cloud. This guide will walk you through the steps to create an EC2 instance using the AWS Management Console.
Prerequisites
Before you begin, make sure you have an AWS account. If you don't have one, you can sign up for a free account at AWS Free Tier.
Step 1: Accessing the AWS Management Console
- Go to AWS Management Console and sign in with your AWS account credentials.
Step 2: Navigating to EC2 Dashboard
- In the AWS Management Console, navigate to the Services dropdown and click on EC2 under the "Compute" section.
Step 3: Launching an Instance
- On the EC2 Dashboard, click the "Launch Instance" button.
Step 4: Choosing an Amazon Machine Image (AMI)
- Choose an Amazon Machine Image (AMI) - a template that contains the software configuration for your instance. You can select an AWS-provided AMI or use your own.
Step 5: Selecting an Instance Type
- Choose an instance type based on your computing needs. Instance types vary in terms of CPU, memory, and network performance.
Step 6: Configuring Instance Details
- Configure instance details such as the number of instances, network settings, and IAM roles. You can leave most of the settings as default for this basic setup.
Step 7: Adding Storage
- Add storage to your instance. You can specify the size and type of the root volume. By default, a General Purpose SSD is selected.
Step 8: Adding Tags (Optional)
- Add tags to your instance for better organization. Tags are key-value pairs that help you identify your instances.
Step 9: Configuring Security Group
- Configure security groups to control inbound and outbound traffic to your instance. You can create a new security group or use an existing one.
Step 10: Reviewing Instance Launch
- Review your instance configuration. If everything looks good, click the "Launch" button.
Step 11: Key Pair Setup
- Select an existing key pair or create a new one. This key pair is essential for securely accessing your instance.
Step 12: Launching the Instance
- Click the "Launch Instances" button to launch your EC2 instance.
Step 13: Viewing Instances
- Once your instance is launched, you can view it on the EC2 Dashboard under the "Instances" section.
Step 14: Connecting to the Instance
To connect to your EC2 instance, use the following steps: Open an SSH client (e.g., Terminal on macOS/Linux or PuTTY on Windows). Use the key pair you specified during launch to connect. The command typically looks like this:
ssh -i /path/to/your-key-pair.pem ec2-user@your-instance-public-ip
Replace /path/to/your-key-pair.pem with the path to your private key file, and your-instance-public-ip with your EC2 instance's public IP address.
Congratulations! You have successfully created an EC2 instance on AWS. You can now connect to your instance using the key pair you specified during the launch process.
This guide provides a basic setup, and you can explore additional configurations and features available in the AWS Management Console to customize your EC2 instances based on your specific requirements.