Amazon Elastic Compute Cloud (EC2) is one of AWS's most popular services, providing scalable computing capacity in the cloud. If you're looking to launch an Ubuntu instance, you're in the right place. In this blog post, I'll walk you through the process of launching an Ubuntu EC2 instance from start to finish.
Step 1: Sign In to AWS Management Console
First, you'll need to sign in to your AWS Management Console. If you don't have an AWS account yet, you'll need to create one.
Go to the AWS Management Console.
Sign in with your AWS credentials.
Step 2: Navigate to EC2 Dashboard
Once you're logged in:
In the top left corner, click on the Services menu.
Under the Compute section, click EC2.
Step 3: Launch an Instance
- In the EC2 Dashboard, click the Launch Instance button.
Step 4: Choose an Amazon Machine Image (AMI)
An AMI is a template that contains the software configuration (operating system, application server, and applications) required to launch your instance.
On the Choose an Amazon Machine Image (AMI) page, search for Ubuntu in the search bar.
Select the desired version of Ubuntu (e.g., Ubuntu Server 22.04 LTS (HVM), SSD Volume Type). Click Select next to the AMI.
Step 5: Choose an Instance Type
Instance types comprise varying combinations of CPU, memory, storage, and networking capacity.
On the Choose an Instance Type page, select the instance type you need. For this example, we'll choose the t2.micro instance type, which is eligible for the free tier.
Click Next: Configure Instance Details.
Step 6: Configure Instance Details
Here, you can configure various settings for your instance:
Keep the default settings unless you have specific requirements.
Click Next: Add Storage.
Step 7: Add Storage
Specify the storage capacity for your instance:
By default, the selected Ubuntu AMI provides 8 GB of General Purpose (SSD) storage. You can adjust this based on your needs.
Click Next: Add Tags.
Step 8: Add Tags
Tags are key-value pairs that help you manage, identify, and organize your AWS resources:
Click Add Tag.
Enter a key (e.g., Name) and a value (e.g., MyUbuntuInstance).
Click Next: Configure Security Group.
Step 9: Configure Security Group
Security groups act as a virtual firewall for your instance to control inbound and outbound traffic:
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: My IP (or another source as needed)
- Click Review and Launch.
Step 10: Review and Launch
- Review all your settings on the Review Instance Launch page.
- Click Launch.
Step 11: Select a Key Pair
A key pair is used to securely connect to your instance:
In the Select an existing key pair or create a new key pair dialog, select Create a new key pair.
Name your key pair and click Download Key Pair. Keep this .pem file secure; you will need it to access your instance.
Click Launch Instances.
Step 12: Connect to Your Instance
Once your instance is launched, go to the Instances section in the EC2 Dashboard.
Select your instance and click Connect.
Follow the instructions to connect to your instance using the SSH client.
For example, using a terminal:
ssh -i /path/to/your-key-pair.pem ubuntu@your-instance-public-dns
Final Thoughts
Congratulations! You have successfully launched and connected to your Ubuntu EC2 instance. From here, you can install software, configure your environment, and start building applications. EC2 provides a flexible and scalable computing environment, making it an essential tool for any cloud professional.
If you have any questions or need further assistance, feel free to leave a comment. Happy cloud computing!
Top comments (0)