Launch EC2 Free Tier
November 24, 2024 · AI Conversations
### Prerequisites
1. **AWS Account**: Make sure you have an AWS account. If not, [sign up here](https://aws.amazon.com/).
2. **IAM User**: It’s recommended to create an IAM user with proper permissions instead of using the root account. You can do this via the [IAM Management Console](https://console.aws.amazon.com/iam/).
—
### Step 1: Log in to the AWS Management Console
– Go to the [AWS Management Console](https://aws.amazon.com/console/).
– Log in with your credentials.
—
### Step 2: Navigate to the EC2 Dashboard
– In the AWS Management Console, search for `EC2` and click on **EC2** under Services.
—
### Step 3: Launch an EC2 Instance
1. **Click "Launch Instance"**:
– Click the **Launch Instance** button.
2. **Configure Your Instance**:
– **Name and Tags**: Give your instance a name (optional).
– **Amazon Machine Image (AMI)**:
– Select an Amazon Machine Image (AMI). For the Free Tier, you can choose:
– **Amazon Linux 2023 (Free Tier eligible)**
– **Ubuntu Server 22.04 LTS (Free Tier eligible)**
– **Microsoft Windows Server 2022 Base (Free Tier eligible)**
– **Instance Type**:
– Choose the instance type as **t2.micro** (Free Tier eligible).
3. **Key Pair (Login) – Security**:
– If you don’t have a key pair, click **Create new key pair**:
– Choose a name for your key pair.
– Choose **RSA** as the key type.
– Click **Create key pair** (it will automatically download to your system).
– If you already have a key pair, select it from the dropdown.
4. **Network Settings**:
– Under the **Network settings**, use the default VPC and subnet.
– **Auto-assign Public IP**: Make sure this is enabled if you want to access the instance via SSH or RDP.
– **Firewall (Security Group)**:
– Click **Edit** under Security Group settings.
– Add the following rules:
– **SSH (Port 22)** for Linux instances or **RDP (Port 3389)** for Windows.
– Make sure to set the source to **My IP** for security.
5. **Configure Storage**:
– Use the default **8 GiB (gp2)** for the root volume (Free Tier eligible).
6. **Advanced Details** (optional):
– You can add user data scripts here to configure your instance automatically at launch (like installing software).
7. **Review and Launch**:
– Click on **Launch**.
– Confirm your settings and click **Launch instance**.
—
### Step 4: Access Your EC2 Instance
1. **For Linux Instances**:
– Open a terminal on your local machine.
– Navigate to the directory where your `.pem` key file is located.
– Change the file permissions (only needed once):
chmod 400 your-key.pem
– Connect to your instance using SSH:
ssh -i "your-key.pem" ec2-user@your-instance-public-ip
– For Ubuntu AMIs, the default user is `ubuntu`:
ssh -i "your-key.pem" ubuntu@your-instance-public-ip
2. **For Windows Instances**:
– Go to the EC2 Dashboard, right-click your instance, and select **Get Windows Password**.
– Upload your `.pem` file, click **Decrypt Password**, and use the password to log in via Remote Desktop.
—
### Step 5: (Optional) Configure Elastic IP
If you want a static IP address:
– Go to the **Elastic IPs** section.
– Click **Allocate Elastic IP address**.
– Associate it with your instance.
—
### Cleaning Up (to avoid charges)
– To avoid unexpected charges, **stop** or **terminate** the instance when not in use:
– Go to the **Instances** section in the EC2 Dashboard.
– Right-click on your instance and select **Stop** or **Terminate**.
By following these steps, you can launch an EC2 instance on the AWS Free Tier successfully. Enjoy exploring AWS!
### Step 1: Check Your AWS Region
– The **AMI** you want to use might not be available in the region you've selected.
– In the AWS Management Console, make sure you're in a region where the Free Tier eligible AMIs are available (e.g., **US East (N. Virginia)**, **US West (Oregon)**).
– You can change the region using the dropdown menu in the top-right corner of the console.
### Step 2: Use the Latest Free Tier Eligible AMIs
Instead of searching for a specific AMI ID, you can select one of the **Free Tier eligible AMIs** directly from the EC2 Launch Instance wizard.
1. **Navigate to the EC2 Dashboard**:
– Go to **EC2 Dashboard** > **Instances** > **Launch Instances**.
2. **Select Amazon Machine Image (AMI)**:
– In the "Choose an Amazon Machine Image (AMI)" step, use the search bar and type:
– For Amazon Linux: `Amazon Linux 2023` or `Amazon Linux 2`
– For Ubuntu: `Ubuntu Server 22.04 LTS`
– For Windows: `Microsoft Windows Server 2022 Base`
– Make sure you select an AMI labeled as **Free tier eligible**.
### Step 3: Verify the Availability of AMIs
If you're using the AWS CLI or a specific AMI ID, ensure that the AMI is valid for your region:
1. Open the **AMI section**:
– Go to **EC2 Dashboard** > **AMIs** (on the left sidebar).
– Set the filter to `Public images` to see all available public AMIs.
2. **Search for your desired AMI**:
– Use keywords like `Amazon Linux`, `Ubuntu`, or `Windows`.
– Ensure the **Visibility** is set to `Public` and **Owner** is `amazon`.
### Step 4: Using the AWS CLI to List AMIs (Optional)
If you are familiar with the AWS CLI, you can list available AMIs for your region using the following command:
aws ec2 describe-images --owners amazon --filters "Name=name,Values=amzn2-ami-hvm-*-x86_64-gp2" --region us-east-1 --query "Images[*].[ImageId,Name]" --output table
– Replace `us-east-1` with your chosen region.
– Adjust the filter values if you're looking for different AMIs (e.g., `ubuntu/images/*` for Ubuntu).
### Step 5: Clear Browser Cache (Optional)
Sometimes, browser cache issues can cause problems in loading the latest AMIs:
– Clear your browser cache or try accessing the AWS Console in **Incognito Mode**.
– Alternatively, use a different browser.
### Step 6: Try Launching with the Community AMIs (Optional)
If the Free Tier AMI is still not found, try using **Community AMIs**:
1. On the "Choose an Amazon Machine Image (AMI)" page, go to **Community AMIs**.
2. Search for `ubuntu`, `amazon linux`, or any specific OS.
3. Select an AMI that matches your criteria.
### Conclusion
If the problem persists after trying these steps, it could be a temporary issue with AWS services in your selected region. Switching to a different region or waiting a bit before retrying may resolve the issue.