AWS Official Partner AWS EC2 beginner tutorial

AWS Account / 2026-05-15 15:31:06

So you want an AWS EC2 beginner tutorial. Excellent choice. EC2 is basically the Swiss Army knife of cloud computing: it can run web servers, host apps, power development environments, and generally make you feel like you’re building the future—while occasionally making you say, “Wait, why is my instance costing money?”

This guide is designed for brand-new cloud explorers. We’ll go step-by-step, keep jargon to a minimum, and explain the important parts in plain language. By the end, you should be able to launch an EC2 instance, connect to it, and understand what security groups and storage are doing behind the scenes.

What is AWS EC2?

EC2 stands for Amazon Elastic Compute Cloud. “Elastic” means you can scale computing resources up or down. “Compute” means processing power (CPU), memory (RAM), and the ability to run machines. “Cloud” means you don’t buy physical servers and put them in your garage (although technically you could… but please don’t).

In practice, EC2 lets you rent virtual servers on AWS. You choose an operating system, the hardware profile (instance type), how much storage you want, and how network access should work. Then AWS gives you an instance with an IP address and the ability to run your code.

Think of an EC2 instance like renting a desk in a huge coworking space. The desk has specs (CPU/RAM), the building has rules (network and security), and you can leave at any time (terminate the instance). If you rent the desk forever, you’ll also pay forever. Cloud budgeting: the silent villain of many beginners’ stories.

The big picture: key EC2 concepts

Before we click buttons, let’s cover the core terms you’ll see in the AWS Console. Don’t worry if some of this feels like alphabet soup. You’ll learn it properly as you go.

Instances

An instance is a running virtual server. You can create it, start it, stop it (sometimes saving money), and terminate it (which deletes it). Instances have an ID like i-0abc1234… which is AWS’s way of reminding you that computers are very serious and very unromantic.

AMIs (Amazon Machine Images)

An AMI is basically the template for the server. It includes an operating system and potentially pre-installed software. Examples include Ubuntu images, Amazon Linux images, and other distributions. Choosing an AMI is like choosing the flavor of cake—except instead of frosting, you get an operating system.

Instance types

An instance type describes the compute resources. For example, a t3.micro might be small and great for learning. The “t” family generally targets burstable performance, which is useful for development and small workloads. Bigger workloads get bigger instance types.

Don’t get lost in the instance type maze. For beginners, start with something small like t3.micro (if available). You can upgrade later, just like upgrading your phone—except AWS sends you a bill instead of a notification.

Regions

A region is a geographic area where AWS data centers are located. Your instance runs inside a specific region. You can usually choose one close to your users to reduce latency.

For beginners, pick a region you’re comfortable with. If you’re not sure, choose the one that’s simplest in your console and that offers the resources you want.

Key pairs

A key pair is how you securely log in to your instance (usually via SSH for Linux instances). AWS generates or you provide a key pair. You keep the private key, and AWS stores the public key.

Translation: AWS gives you a secret handshake file. Keep it safe. If you lose it, you might have a hard time logging in, depending on what you do next.

Security groups

Security groups are virtual firewall rules attached to your instance. They control inbound and outbound traffic. If you’re new to networking, security groups can feel like a riddle written in thunder.

The key idea: inbound rules determine what can reach your instance. For example, allowing SSH (port 22) from your IP address lets you connect. Outbound rules determine where your instance is allowed to send traffic. Beginners often focus on inbound because “I can’t connect!” is usually an inbound issue.

Also: security groups are stateful. That means if you allow inbound traffic, the return traffic is automatically allowed. You don’t have to open the port in both directions like you’re filling out a bureaucratic form in triplicate.

Storage (EBS and instance store)

EC2 uses storage options. The most common for beginners is EBS (Elastic Block Store). EBS volumes are network-attached disks that you can configure and manage.

If you stop and start an instance, EBS typically remains. If you terminate the instance, you can choose whether EBS volumes should be deleted or retained. This choice is important because it affects cost and data safety.

Before you start: prerequisites and setup

To launch an EC2 instance, you’ll need:

  • AWS account
  • A region selected in the AWS console
  • Permission to create EC2 instances (IAM permissions)
  • Comfort clicking around without summoning the fear of accidental spending

If you’re using the AWS Free Tier, you might have eligible resources. Always check your current Free Tier eligibility for EC2 and related services. AWS policies and offerings change over time, so treat “free” like a friendly rumor rather than a guarantee.

Step 1: Open EC2 in the AWS Console

In your AWS Console, search for “EC2” and open it. You’ll likely land on a dashboard with options such as “Instances,” “Launch instances,” and more. We’re going to “Launch instances” because, well, you’re trying to run something.

Click “Launch instances.” This launches a wizard with multiple steps. The wizard is basically AWS saying, “Tell me what you want, and I’ll rent it to you in exchange for a small amount of money per hour.”

Step 2: Choose an Amazon Machine Image (AMI)

The first major decision is the AMI. For learning, you’ll often choose a Linux distribution like Ubuntu or Amazon Linux.

If you want a simple default, pick an Ubuntu Server or Amazon Linux 2/2023 image. For beginners, Ubuntu is popular because many guides assume Ubuntu-style commands.

Pick an AMI that looks stable and recent enough. The wizard will show version details. If you’re unsure, go with the “most common” one in beginner tutorials, usually Ubuntu.

Step 3: Choose an instance type

Next, select an instance type. If you’re just learning, choose the smallest instance type available that meets your needs. For many free-tier scenarios, t3.micro is a common choice.

Don’t overthink it right now. The main goal is to get a working instance. Later, you can explore instance families and scaling.

Step 4: Create (or select) a key pair

This is where your SSH login gets serious. The wizard asks for a key pair. You can create a new key pair. If so, you’ll download a .pem file (for many Linux setups).

Keep this file somewhere safe. If you lose it, you may need to create a new key pair and rebuild access. AWS isn’t trying to be mean; it’s just not interested in handing out private keys.

Also, don’t share your private key with anyone. That’s not “cloud collaboration.” That’s “cloud sabotage.”

Step 5: Network settings and security group

Now we hit the part that causes most beginner confusion: networking. The wizard will ask you to configure a security group.

For a typical beginner setup, you’ll want inbound SSH access so you can connect.

Option A: Allow SSH from your IP address

If the wizard offers “My IP” or lets you choose your IP, it’s ideal. This restricts SSH access to your current location. That’s like locking your front door instead of taping it open for anyone who wanders by.

Option B: Allow SSH from anywhere (not recommended)

You might see an option to allow SSH from 0.0.0.0/0. It technically works, but it’s risky. Automated scanners love open SSH ports the way raccoons love trash cans. If you must learn with this temporarily, be cautious and terminate when done.

Security groups are not just for inbound rules; they also include outbound rules. Outbound is often allowed to the internet for updates and downloads, which is fine for learning. In production, you’d restrict outbound too.

Step 6: Configure storage

Storage settings usually include the volume size (e.g., 8 GiB) and type. For a beginner instance, you can usually keep default values unless you specifically need more disk space.

There’s also a setting like “Delete on termination.” If you choose to delete, your data disappears when you terminate the instance. If you keep it, AWS keeps the storage volume and you might pay for it longer.

For learning, it’s generally okay to delete on termination, but only if you don’t care about data persistence.

Step 7: Launch the instance

At this point, you can review the summary and click “Launch instance.” AWS will create the instance and show it in your Instances list.

Instances go through states such as “Pending” and then “Running.” “Pending” is AWS assembling your server. It usually doesn’t take too long, but it’s not instantaneous—no matter how badly we want instant gratification.

Step 8: Connect to the instance

AWS Official Partner When the instance is running, you connect using SSH if it’s Linux. In the EC2 console, you’ll find a “Connect” button on the instance page. This often provides a ready-to-copy SSH command.

Before you connect, make sure your key pair .pem file exists locally on your machine and has correct permissions.

On macOS or Linux, a typical permission fix might involve setting the private key file to be readable only by you. Without correct permissions, SSH may refuse to use the key.

On Windows, you can use tools like PuTTY or Windows OpenSSH, depending on your setup.

The exact steps vary, so use the console’s “Connect” instructions as your source of truth. AWS updates their commands and paths, so letting AWS guide you is usually better than trying to guess.

What to do after you connect

You’re in! Now what? A good first exercise is updating packages and checking basic system information.

Once logged in, run system update commands (for Ubuntu, typically something like apt update and apt upgrade). Then check disk space, CPU info, and network connectivity.

This might feel boring compared to building an app, but it’s valuable. Beginners should build confidence that they can interact with the machine reliably.

Useful beginner commands (Linux)

Here are some common commands you’ll likely use:

  • pwd: show current directory
  • ls: list files
  • cd: change directory
  • cat / less: view files
  • df -h: disk usage
  • AWS Official Partner free -h: memory usage
  • top: live process view
  • sudo: run a command with administrative privileges

Don’t worry if these are unfamiliar. Most of them are easy to remember because they look like what they do.

AWS Official Partner Step 9: Understand public vs private access

EC2 instances can be reached via networking depending on their configuration. For beginner purposes, you often use a public IP address to SSH into the instance.

A common pattern is: allow SSH to the instance via its public IP, using your security group inbound rules. Once connected, the instance can access internet resources for updates.

In more advanced architectures, you might use private subnets and connect through bastion hosts or VPNs. But for now, focus on “it runs and you can access it.”

Step 10: Basic web server test (optional but fun)

If you want a small “I did something real” moment, install a simple web server and verify you can access it in a browser.

A common choice is Nginx or Apache. With Nginx, you install it, start it, and then open port 80 in your security group to allow HTTP traffic.

But here’s the catch: your instance still has a security group firewall. If you don’t open port 80 inbound, your browser will keep trying and failing like a polite robot knocking on the wrong door.

AWS Official Partner So the flow is:

  • Install web server on the instance
  • Start the service
  • Update security group inbound rules to allow HTTP (port 80)
  • Open the instance’s public IP in your browser

If everything works, you’ll see the default web page. That’s your “beginner victory screen.” Screenshot it if you want. You earned it.

Step 11: Monitoring and logs (the “is it okay?” toolkit)

A running instance is good. A healthy instance is better. AWS provides monitoring tools, and you can check basic status in the EC2 console.

At a minimum, you can:

  • AWS Official Partner Check instance status checks (system and instance status)
  • Review logs if you’ve configured logging
  • Use CloudWatch for metrics (CPU, network, disk)

For beginners, simply knowing where to look is step one. Later, you’ll learn how to set up alarms and automated responses.

Step 12: Stopping vs terminating (money-saving survival mode)

This is where beginners either learn to save money or donate it to the cloud. Let’s talk about stop vs terminate.

Stop

AWS Official Partner Stopping an instance halts it. Depending on the instance and storage configuration, you may reduce costs because the compute is not running. EBS volumes usually remain, and you may still pay for storage.

Terminate

Terminating the instance permanently deletes it. You usually can’t recover it afterward. If your EBS volume is configured to delete on termination, the disk will be removed too.

For learning, many people terminate instances when they’re done. If you want the instance later, stopping is useful. Just don’t forget it exists and keeps billing for storage or other resources.

Cloud lesson of the day: when you finish a lab, don’t just close the tab. Close the bill too.

Common beginner mistakes (and how to avoid them)

Let’s cover the classic “why is nothing working?” moments. If you’ve already hit one of these, congrats: you’re officially participating in the rite of passage.

Mistake 1: Security group blocks SSH

If you can’t connect via SSH, check that:

  • Port 22 is allowed inbound
  • The rule allows your IP (or your IP range)
  • You used the correct key pair file

Also, ensure you’re connecting to the right public IP address. It happens more than you’d think.

Mistake 2: Wrong username for the AMI

AWS Official Partner Different images use different default usernames. For example, Ubuntu often uses “ubuntu.” Amazon Linux might use “ec2-user.”

If SSH connects but authentication fails, try the “Connect” button instructions in the EC2 console, because AWS knows the expected default username for the selected image.

Mistake 3: Lost the private key

If you didn’t save the .pem file, you may be stuck. You can sometimes recover access via different mechanisms (like using AWS Systems Manager if configured), but for a plain beginner setup, you might need to create a new instance or reconfigure access.

Save the key pair file and label it like an adult.

Mistake 4: Cost surprises because instances keep running

Remember to stop or terminate resources after labs. Also, check related services you might have enabled (like load balancers or NAT gateways) that can cost money even if you think you’re just “testing.”

Mistake 5: Opening SSH to the world

Allowing SSH from 0.0.0.0/0 is convenient and also a magnet for brute-force attempts. It’s not the end of the world for a short lab, but it’s a bad habit. Restrict to your IP when possible.

A simple recommended beginner workflow

Here’s a sensible workflow you can follow every time you learn EC2. It reduces mistakes and makes troubleshooting easier.

Workflow

  • Pick a region
  • Choose a beginner-friendly AMI (Ubuntu is common)
  • Select a small instance type (like t3.micro if available)
  • Create a key pair and download the .pem file
  • Set a security group that allows SSH from your IP only
  • Launch instance
  • Connect using the AWS “Connect” instructions
  • Do a quick update and basic checks
  • Optionally install a web server and open port 80
  • Stop or terminate when done

When you follow a consistent workflow, you spend less time panicking and more time learning.

Scaling up from beginner: what to learn next

Once you can launch and connect to an EC2 instance, you’re ready to level up. Here are excellent next topics for your EC2 journey.

  • Elastic IP addresses: static public IPs for instances
  • Elastic Load Balancing: distribute traffic across multiple instances
  • Auto Scaling: scale instances based on demand
  • VPC basics: subnets, route tables, internet gateways
  • IAM roles for EC2: safer access to AWS resources from your instance
  • AWS Systems Manager: connect without SSH (great for operations)
  • CloudWatch alarms: detect issues automatically
  • Infrastructure as Code: use Terraform or CloudFormation to automate instance setup

In other words: you started with “click button.” Next you’ll move toward “build repeatable systems.” That’s where real cloud engineering starts.

Mini-lab plan: build confidence in one sitting

If you want a practical lab plan, here’s a simple one. You can do it in one session (assuming you don’t lose time reading every console tooltip, which is extremely easy to do).

Lab steps

  1. Launch a small Ubuntu EC2 instance.
  2. Connect via SSH.
  3. Run system updates and check disk/memory.
  4. Create a text file in your home directory.
  5. Optionally install Nginx and view it in a browser.
  6. Validate security group inbound rules (SSH and optionally HTTP).
  7. Stop the instance and confirm it remains accessible only when appropriate.
  8. Terminate the instance when you’re done.

Each step builds understanding. By the end, you’ll have a mental model of EC2: images create systems, instance types define capacity, key pairs secure access, security groups govern traffic, and storage decides persistence.

Quick answers to common beginner questions

Do I need to know coding to use EC2?

No. At first, you can simply launch an instance and connect to it. Coding comes later when you install and run applications or configure services.

Will EC2 cost money?

Almost certainly, yes. You may have Free Tier eligibility, but always check current Free Tier rules and monitor your usage. Don’t let a “temporary lab” turn into a “monthly invoice.”

Is EC2 the only way to run servers on AWS?

No. Alternatives include ECS, EKS, AWS Lambda, and Lightsail. EC2 is general-purpose and very flexible, which is why it’s popular for learning and many production use cases.

Should I start with EC2 or VPC first?

For absolute beginners, starting with EC2 is fine because the console guides you. But sooner or later, VPC concepts (subnets, routing, gateways) will matter. Don’t worry—you’ll get there.

Conclusion: your EC2 starter kit, now with fewer mysteries

You now have the essentials of an AWS EC2 beginner tutorial: what EC2 is, which key terms matter, and how to launch and connect to an instance while understanding security groups and basic storage behavior. If you successfully launched an instance and connected via SSH, you’ve already done the hardest part: making the cloud obey you.

Next time you open the EC2 console, you’ll likely notice the wizard stops feeling like a maze and starts feeling like a checklist. That’s progress. And unlike most homework, this homework actually runs on real machines.

If you want, tell me what operating system you chose (Ubuntu or Amazon Linux) and whether you’re connecting from Windows, macOS, or Linux. I can tailor the connection steps and suggest a tiny next lab (like installing a database, setting up a simple API, or learning IAM roles) to help you move from “it works” to “I understand what I built.”

TelegramContact Us
CS ID
@cloudcup
TelegramSupport
CS ID
@yanhuacloud