Launch Your First Cloud Server on AWS
Launch, connect to, and terminate an EC2 virtual server on AWS.
Introduction
30 Second Summary
Every website you visit, every app you open, and every video you stream runs on a server somewhere. Instead of a physical computer under a desk, most companies rent virtual servers in the cloud that they can launch in seconds and shut down when they are done.
In this project, you will launch your own virtual server on AWS (Amazon Web Services), connect to it through your browser, and explore it with real Linux commands.
What You'll Build
A live cloud server running Amazon Linux 2023, launched and managed entirely through the AWS Management Console in your web browser.
By the end of this project, you'll have:
- A free AWS account with $200 in credits to explore cloud services.
- A launched and running EC2 instance (virtual server) that you configured yourself.
- A browser-based terminal session where you run Linux commands on your server to prove it works.
- Secret Mission: Install a web server on your instance and view a live webpage from your cloud server's public IP address.
Are there any prerequisites?
None. You only need a web browser (Safari or Chrome) and an email address. This guide walks you through creating your AWS account and everything else from scratch.
Before We Start
Before We Start...
Create Your Free AWS Account
To launch a cloud server, you first need access to a cloud platform. AWS (Amazon Web Services) is the world's largest cloud platform, used by companies of all sizes to run their websites, apps, and IT infrastructure.
In this step, you'll create a free AWS account. New accounts receive $100 in credits immediately, with up to $100 more available as you explore services. That is $200 in total, valid for 6 months.
In this step, get ready to:
- Create a free AWS account with $200 in credits.
- Sign in to the AWS Management Console.
- Select the right region for this project.
Sign up for AWS
The AWS Free Tier gives you real cloud resources to practice with at zero cost. You will not be charged anything on the Free plan.
- In your web browser, go to https://aws.amazon.com/free/.
- Click Create a free account.
- Enter your email address in the Root user email address field.
- Enter a name for your account in the AWS account name field (this can be anything, like your name or "My Cloud Lab").
- Click Verify email address.
- Check your email inbox for a verification code from AWS.
- Enter the verification code and click Verify.
- Create a strong password for your account and click Continue.
- When prompted to choose your account plan, select Free.
- Enter your contact information and accept the AWS Customer Agreement.
- Enter a payment method (credit or debit card).
- Complete the phone verification step by entering the code AWS sends you.
- For the support plan, keep the default Basic Support (free).
- Click Complete sign up.
Why do I need a payment method for a free account?
AWS requires a valid payment method to verify your identity and prevent abuse. You will not be charged while on the Free plan. AWS only charges your card if you manually upgrade to a Paid plan later.
How long does activation take?
Account activation usually takes a few minutes. In rare cases it can take up to 24 hours. Check your email (including spam) for a confirmation message from AWS.
Having trouble signing up?
If your phone verification fails, try a different phone number or select the voice call option instead of SMS. You can sign back in with the email and password you created to resume the verification step without starting over.
help me troubleshoot my AWS account sign-up
Access the AWS Management Console
Once your account is activated, you can sign in and start using AWS services. The AWS Management Console is the web-based dashboard where you control everything in your AWS account.
- Go to https://console.aws.amazon.com/ and sign in with the email and password you just created.
- You will land on the Console Home dashboard.
- Look at the top-right corner of the page for the Region selector (it shows a region name like "US East (N. Virginia)").
- Click the Region selector and choose US East (N. Virginia) us-east-1.
Why us-east-1?
AWS has data centers around the world, grouped into regions. us-east-1 (N. Virginia) is the most commonly used region. It has the widest service availability and is referenced in most tutorials and documentation.
Verify your account is ready
Before moving on, confirm that everything is set up correctly.
- Confirm you can see the Console Home page with the Explore AWS widget.
- Confirm the search bar is visible at the top of the console.
- Confirm the region in the top-right corner shows N. Virginia.
What about the $100 in credits?
Your $100 sign-up credits are applied to your account automatically. You can earn up to $100 more by completing guided activities shown in the Explore AWS widget on the Console Home page. Each activity earns $20 in additional credits.
Your AWS account is ready to go. Next up, you will launch your first virtual server in the cloud.
Launch Your EC2 Instance
Your AWS account is ready. Now for the exciting part: you are going to launch your own virtual server in the cloud.
A virtual server is a computer that runs inside an Amazon data center instead of sitting on your desk. AWS calls these EC2 instances. In this step, you will configure and launch one using the EC2 launch wizard.
In this step, get ready to:
- Open the EC2 service and start the launch wizard.
- Choose your server's operating system and size.
- Configure network access and launch your instance.
Open EC2 and start the launch wizard
EC2 is the AWS service that lets you create and manage virtual servers. You need to navigate to it first, then tell AWS you want a new server.
- In the search bar at the top of the AWS Console, type EC2.
- Click on EC2 from the dropdown results.
- On the EC2 Dashboard, click the Launch instance button.
- Under Name and tags, type My First Server in the name field.
What is EC2?
EC2 stands for Elastic Compute Cloud. It is the AWS service that creates virtual servers (called "instances") on demand.
Instead of buying physical hardware, you tell AWS what kind of computer you need, and it provisions one for you in seconds. You only pay for the time it runs.
Choose your operating system and instance type
Every server needs an operating system and a hardware size. The launch wizard lets you pick both from pre-configured options.
- Under Application and OS Images (Amazon Machine Image), confirm the default selection shows Amazon Linux 2023 AMI with a "Free tier eligible" badge. Keep this default.
- Under Instance type, keep the default selection (t3.micro or similar Free Tier eligible type).
- Under Key pair (login), click the dropdown and select Proceed without a key pair (Not recommended).
What is an Amazon Machine Image?
An Amazon Machine Image (AMI) is a pre-packaged template that includes an operating system and software. Think of it like a ready-made recipe for your server.
Amazon Linux 2023 is Amazon's own Linux distribution. It is free, lightweight, and optimized for running on AWS.
Why no key pair?
Key pairs are used for SSH access from a local terminal. You will connect to your server through the browser instead, using a service called EC2 Instance Connect.
EC2 Instance Connect pushes a temporary key automatically, so a pre-configured key pair is unnecessary for this project.
Configure network settings and launch
Network settings control who can connect to your server. The defaults create a firewall rule that allows you to connect from your browser.
- Under Network settings, keep the default settings. Confirm the checkbox Allow SSH traffic from is selected with Anywhere (0.0.0.0/0) shown next to it.
- Leave Configure storage at its default (8 GB).
- In the Summary panel on the right side of the page, click Launch instance.
- You will see a green "Success" banner at the top of the page.
- Click the instance ID link (it looks like i-0abc123def456) to view your new server in the Instances list.
What is a security group?
A security group is a virtual firewall that controls which network traffic can reach your server. The "Allow SSH traffic from Anywhere" checkbox creates a rule that lets you connect from any IP address on port 22.
This is fine for a learning instance that you will terminate within the hour. For production servers, you would restrict access to specific IP addresses.
Don't see the Success banner?
If you see an error mentioning permissions or limits, your account may still be initializing. Wait a few minutes and try again.
Make sure you selected a Free Tier eligible instance type under the Instance type section. New accounts sometimes default to a non-eligible type.
Help me troubleshoot my EC2 launch error.
Your instance will take a moment to start up. The Instance state column should change from "Pending" to "Running" within about 30 seconds.
Once it shows "Running", check the Public IPv4 address column. Your server now has a public address that makes it reachable from the internet.
What is an instance type?
An instance type defines how much CPU, memory, and network capacity your server has. The t3.micro gives you 2 vCPUs and 1 GB of RAM. That is plenty for learning and small workloads.
Your server is live. Next up, you will connect to it directly from your browser and start running commands on it.
Connect to Your Server
Your server is live and running in an Amazon data center. Now it is time to actually talk to it.
In this step, you will open a browser-based terminal that connects directly to your server. No extra software to install, no complicated setup. You will type commands and your server will respond, proving you are controlling a real computer in the cloud.
In this step, get ready to:
- Wait for your instance's health checks to pass.
- Connect to your server through a browser-based terminal.
- Run Linux commands to explore your server.
Wait for your instance to be ready
Before you can connect, your server needs to finish its internal health checks. AWS runs two automated checks on every instance to confirm that both the hardware and software are healthy.
- On the Instances page, click the checkbox next to your instance My First Server to select it.
- Look at the Status check column in the instances table.
- Wait for it to show 2/2 checks passed. This may take 1-2 minutes after launch.
What are status checks?
AWS automatically tests two things every minute: that the physical hardware is working (system status check) and that the operating system is reachable (instance status check). When both pass, you see 2/2 checks passed and your server is ready to accept connections.
Still showing Initializing?
Status checks can take up to 2 minutes after launch. Refresh the page by clicking the circular refresh icon near the top of the instances table. If it still shows Initializing after 5 minutes, select your instance and check the Status and alarms tab for details.
Need help? Why are my EC2 status checks stuck on Initializing?
Connect using EC2 Instance Connect
EC2 Instance Connect lets you open a terminal session to your server directly in your web browser. No SSH keys or extra software needed.
- With your instance selected, click the Connect button at the top of the page.
- On the Connect to instance page, choose the EC2 Instance Connect tab.
- The Username field shows ec2-user. This is the default user for Amazon Linux.
- Click Connect.
A new browser tab opens with a black terminal screen. You are now connected to your cloud server.
What is EC2 Instance Connect?
When you click Connect, AWS pushes a temporary SSH key to your instance that lasts for 60 seconds. Your browser uses this key to open a secure terminal session. Because the key is temporary, you do not need to manage or store key files yourself.
Connection failed?
Make sure your instance state shows Running and the status check shows 2/2 checks passed. If you see an error about permissions, confirm that your security group allows SSH traffic (port 22). This was configured during launch in the previous step.
Still stuck? Help me troubleshoot my EC2 Instance Connect failure.
Explore your server with basic commands
You now have a live terminal session on a computer in an Amazon data center. Let's run a few commands to prove it is real and learn about your server.
- Check who you are logged in as by typing this command and pressing Enter:
whoami
You should see ec2-user printed on the next line. This confirms your identity on the server.
- Check your server's internal hostname by running:
hostname
You should see an internal hostname that AWS assigned to your instance. It will look something like ip-172-31-xx-xx.ec2.internal.
- View details about the Linux operating system running on your server:
uname -a
This prints the kernel name, hostname, kernel version, and architecture. It confirms you are running Linux on this server.
- Check how long your server has been running:
uptime
You should see a short uptime matching the few minutes since you launched the instance.
What did these commands tell you?
Each command revealed something about your server. whoami confirmed your user account. hostname showed the internal network identity AWS gave your instance. uname -a confirmed the operating system. uptime proved the server just started.
These are the same commands a systems administrator would run when first logging into any Linux server to get oriented.
Command not found?
Make sure you type the commands exactly as shown, including the space and dash in uname -a. If the terminal is unresponsive, click inside the black terminal area to make sure it has focus. If the session has timed out, close the tab and reconnect using the same steps above.
Need help? My terminal commands are not working on my EC2 instance.
You are now controlling a real computer in the cloud from your browser. In the next step, you will dig deeper into your server's resources and understand what you have built.
Run Commands and Explore Your Server
You are connected to a real computer in an Amazon data center. Right now it is just sitting there, waiting for instructions.
In this step, you will run commands to inspect your server's hardware and software. You will also confirm that your server is reachable from the internet, then cleanly disconnect.
In this step, get ready to:
- Check your server's memory, storage, and operating system.
- Verify your server's public IP address matches the AWS Console.
- Cleanly disconnect from your server.
Check your server's resources
Your server is running, but you have not looked under the hood yet. These commands reveal what hardware and software your server has.
- In the browser terminal from earlier, check how much memory (RAM) your server has by running:
free -h
You should see a table with columns like total, used, and free. The total memory row shows approximately 1 GB.
- Check how much disk space is available by running:
df -h
You should see a list of mounted filesystems. The main one shows approximately 8 GB of total storage.
- Confirm which operating system your server is running:
cat /etc/os-release
You should see output that includes Amazon Linux 2023 in the name fields. This confirms your server is running the same OS you selected during launch.
Understand what you have built
You now have proof of what is running on your server. Let's put it all together.
What exactly is this server?
Your server is a t3.micro EC2 instance with approximately 1 GB of RAM and 8 GB of storage. It is running in an Amazon data center in Virginia, USA.
It has a public IP address, meaning it is reachable from anywhere on the internet. The security group acts as a firewall. Right now it only allows SSH (port 22) connections, which is how your browser terminal is connected.
- Verify your server's public IP address by running:
curl ifconfig.me
You should see a single IP address printed in the terminal. This is your server's public address.
- Switch back to the AWS Console tab in your browser.
- On the Instances page, check the Public IPv4 address column for your instance.
- Confirm it matches the IP address that curl ifconfig.me returned in your terminal.
Why do these IPs match?
Your server only has one public IP address. Whether you look it up from inside the server or from the AWS Console, it is the same address. This proves that the machine you are controlling in the terminal is the same instance listed in your console.
Seeing 'command not found' for curl?
This is extremely unlikely on Amazon Linux 2023, which includes curl by default. If you see this error, make sure you typed the command exactly as shown with no extra spaces.
Help me troubleshoot this curl error.
Disconnect from your server
You have explored everything you need. Time to disconnect cleanly.
- Disconnect from your server by running:
exit
The terminal session closes. You may see a message or the tab may become unresponsive.
- Close the browser tab that had the terminal session.
Is my server still running?
Yes. Disconnecting from the terminal does not shut down the server. Your EC2 instance is still running in the AWS data center. You have simply hung up the phone. The computer on the other end is still on.
You now know your server inside and out. Next up, you will learn how to terminate (delete) your instance so it stops running and you avoid any charges.
Terminate Your Instance
You've explored your server, run commands on it, and seen exactly what a cloud machine looks like from the inside. Now it's time to shut it down.
Leaving a server running when you don't need it is how surprise cloud bills happen. Terminating an instance permanently deletes it and stops all charges. This is the most important habit you'll build as a cloud professional.
In this step, get ready to:
- Find your instance in the EC2 Console.
- Terminate your instance to stop all charges.
- Verify the instance state shows Terminated.
Find your instance in the console
You should already have the EC2 Console open from the previous step. Let's navigate to your instance.
- In the left navigation pane of the EC2 Console, click Instances.
- Select (check the box next to) My First Server.
Don't see your instance?
If you closed the EC2 Console tab, navigate back to it by typing EC2 in the search bar at the top of the AWS Console and clicking EC2 from the results. Then click Instances in the left navigation pane.
Terminate the instance
Terminating means permanently deleting your server. Unlike stopping (which pauses it), termination cannot be undone.
- Click the Instance state dropdown button at the top of the page.
- Select Terminate instance.
- In the confirmation dialog, click Terminate.
The instance state changes to "Shutting down" and then to "Terminated".
What is the difference between stopping and terminating?
Stopping an instance is like putting a computer to sleep. It can be turned back on later, but some resources (like the public IP address) may change.
Terminating an instance permanently deletes it. The storage is wiped and the server is gone forever. For a learning exercise like this, terminating is the right choice because it guarantees zero ongoing charges.
Verify termination
- Wait a moment and refresh the page.
- Confirm that your instance shows Terminated in the Instance state column.
Terminated instances disappear from the list after a few hours. With the instance terminated, no charges will accumulate. Your AWS credits remain for future use.
Double-check there are no running instances
Click EC2 Dashboard in the left navigation pane. Look for the Instances (running) count. If it shows 0, nothing is costing you money.
Instance still showing Running?
It can take a minute or two for the state to change. Refresh the page a few times. If the state doesn't change after 2-3 minutes, make sure you selected the correct instance before clicking Terminate instance.
Still stuck? Help me terminate my EC2 instance.
Secret mission
Turn Your Server into a Live Website
You launched a server and connected to it. But what if that server could host a live website that anyone in the world can visit? In this bonus mission, you will install web server software and serve a real webpage from your cloud server's public IP address.
Clean Up Your Resources
Clean Up Your Resources
This project runs entirely in the AWS cloud, but all instances have already been terminated. There are no ongoing costs as long as no instances are running.
Decide whether to keep your AWS account active for future learning or close it entirely.
Resources you used:
- AWS Free Account ($200 in credits, valid for 6 months, no ongoing cost).
- EC2 Instance - My First Server (terminated, no ongoing cost).
- EC2 Instance - Secret Mission Web Server (terminated, no ongoing cost).
Keep everything running
No action needed. Choose this if you plan to use AWS again for future projects or learning.
- Your AWS account stays free. The $200 in credits are valid for 6 months after sign-up.
- You can launch new EC2 instances anytime for future learning.
- To double-check nothing is running, open the EC2 Console and click Instances in the left navigation pane. Confirm that no instances show a state of Running.
Pause - I'll come back to this later
Since both instances are already terminated, there is nothing to pause. Your account is free and idle.
- Your credits remain available for 6 months.
- No charges will accumulate while no instances are running.
- To verify, open the EC2 Console and click Instances in the left navigation pane. Confirm no instances have a state of Running.
Delete - I don't want to use this again
Remove your AWS account entirely. This is permanent and cannot be undone after a grace period.
- Both EC2 instances are already terminated. No further EC2 cleanup is needed.
- To close your AWS account, click your account name in the top-right corner of the AWS Console, then choose Account.
- On the Account page, scroll to the bottom and click Close account.
- Confirm the closure when prompted.
- You will receive a confirmation email within a few minutes.
Can I undo this?
AWS keeps closed accounts in a suspended state for 90 days. During that window, you can contact AWS Support to reopen it. After 90 days, the closure is permanent.
Nice Work!
Nice Work!
You just launched, connected to, explored, and terminated your own virtual server in the AWS cloud. That is real cloud infrastructure, managed by you, from your browser.
You've learned how to:
- Launch a virtual server (EC2 instance) running Amazon Linux 2023 using the AWS launch wizard.
- Connect to your server through the browser using EC2 Instance Connect and run Linux commands to explore your server's operating system, memory, and storage.
- Terminate your instance cleanly to avoid any charges and manage cloud resources responsibly.
- Secret Mission: Installed an Apache web server and served a live webpage from your cloud server's public IP address.
Ready to quiz yourself?