How to Create an EC2 Instance
Creation of EC2 Instance
Published Sep 5, 2024
Last Modified Sep 8, 2024
Here are the steps to create an EC2 instance on AWS:
1. Sign In to the AWS Management Console
- Go to the [AWS Management Console](https://aws.amazon.com/console/) and log in with your credentials.
2. Open the EC2 Dashboard
- In the AWS Management Console, type "EC2" in the search bar and select "EC2" from the services list.
3. Launch Instance
- Click the "Launch Instance" button to start the instance creation process.
4. Choose an Amazon Machine Image (AMI)
- Select an AMI that matches your needs. This is essentially the operating system for your instance. You can choose from a variety of AMIs, including Amazon Linux, Ubuntu, Windows, etc.
- Choose an Instance Type
- Select the instance type based on your requirements for CPU, memory, storage, and network performance. For example, `t2.micro` is a free-tier eligible instance type suitable for small, low-traffic applications.
6. Configure Instance Details
- Configure settings such as the number of instances, network, subnet, and IAM role. You can also set up advanced details such as monitoring and shutdown behavior here.
7. Add Storage
- Add or modify the storage volumes attached to your instance. By default, an Amazon EBS volume is attached to your instance, but you can add more volumes if needed.
8. Add Tags [Optional]
- Add tags to your instance to help you identify it later. Tags are key-value pairs like `Name: MyInstance`.
9. Configure Security Group
- Set up a security group, which acts as a virtual firewall to control inbound and outbound traffic. You can create a new security group or select an existing one. Ensure you allow necessary ports (e.g., port 22 for SSH access, port 80 for HTTP, etc.).
10. Review and Launch
- Review your instance configuration. If everything looks correct, click "Launch".
11. Select a Key Pair
- Choose an existing key pair or create a new one. You'll need this key pair to connect to your instance. If creating a new key pair, download the `.pem` file and store it securely, as you’ll need it to access your instance via SSH.
12. Launch Instance
- Click the "Launch Instances" button. You will see a confirmation message with the instance ID. Click "View Instances" to go to the EC2 Dashboard and see your running instance.
13. Connect to Your Instance
- After your instance status is "running", select your instance in the EC2 Dashboard and click the "Connect" button. Follow the instructions provided to connect to your instance via SSH or RDP, depending on the operating system.
That’s it! You’ve successfully created and launched an EC2 instance. If you need further customization or configuration, you can do so through the EC2 Management Console or by using the AWS CLI.
Regards
Adeel Abbas
Adeel Abbas