1. Log in to AWS Console
- Go to the AWS Management Console and log in with your credentials.
- Navigate to EC2 under Compute services.
2. Launch an Instance
- In the EC2 Dashboard, click Launch Instances.
3. Choose an Amazon Machine Image (AMI)
- Select an Amazon Machine Image (AMI), which is a pre-configured operating system for the instance.
- AWS offers several options, including Amazon Linux 2 (free-tier eligible), Ubuntu, Red Hat, Windows, etc.
- Choose an AMI based on your application requirements.
4. Choose an Instance Type
- Select an Instance Type based on your compute needs. The t2.micro instance is free-tier eligible and suitable for testing.
- Instance types vary in CPU, memory, storage, and networking capabilities.
- Click Next to configure instance details.
5. Configure Instance Details
- Select a VPC and Subnet to launch the instance in a specific network.
- Enable Auto-assign Public IP if you want the instance to be accessible from the internet.
- Configure any advanced settings as needed (e.g., IAM roles, Shutdown behavior, Monitoring).
- Click Next to configure storage.
6. Add Storage
- Choose storage options for your instance. For example, 8 GB (default) for general-purpose (GP2) SSD is often sufficient for testing.
- You can add additional volumes if needed.
- Click Next to add tags.
7. Add Tags (Optional)
- Add tags for organizational purposes, like
Name: MyEC2Instance. - Tags help identify and organize your instances within the AWS console.
- Click Next to configure the security group.
8. Configure Security Group
- Create a new security group or select an existing one.
- To allow SSH access, add a rule:
- Type: SSH
- Protocol: TCP
- Port Range: 22
- Source:
0.0.0.0/0(accessible from anywhere, though it's more secure to restrict it to your IP)
- For web servers, add an HTTP rule with Port 80 and HTTPS with Port 443.
- Click Review and Launch.
9. Review and Launch
- Review your instance settings.
- Click Launch.
10. Select or Create a Key Pair
- AWS requires a key pair for SSH access.
- Select an existing key pair if you already have one, or Create a new key pair.
- Download the
.pemfile and store it securely; this is the only time it will be available. - Confirm that you have the key, and click Launch Instances.
11. Access Your Instance
- Go back to the EC2 Dashboard > Instances.
- Select your instance, and wait for its state to change to running.
- Copy the Public IPv4 address to connect.
12. Connect to Your EC2 Instance
- Open a terminal and use SSH to connect:
- For Ubuntu, replace
ec2-userwithubuntuas the username.
Your EC2 instance is now ready!
You can install and configure software, deploy applications, and manage the instance as needed. Remember to terminate instances when not in use to avoid unwanted costs.
No comments:
Post a Comment