Launching your first cloud server can feel complex — but with Amazon Web Services (AWS), it’s surprisingly straightforward once you understand the workflow. In this guide, you’ll learn exactly how to create, configure, and access your first virtual server using Amazon EC2, AWS’s core compute service. By the end, you’ll have a running server you can connect to, plus the habits that keep it secure and cheap.
What You’ll Learn
- How to create your first AWS account
- How to launch and configure an EC2 instance
- How to connect to your server securely with SSH
- Best practices and common mistakes to avoid
What Is a Server on AWS?
A server on AWS is a virtual machine (VM) running in the cloud. AWS calls these instances. With Amazon EC2, you can launch servers in minutes without buying physical hardware — you rent the compute you need, and you can stop or delete the server whenever you’re done. That makes EC2 ideal for learning: you can practice on real infrastructure, and the AWS Free Tier covers a small instance for your first year. If you are new to the platform, start with our complete guide to AWS.
Prerequisites
- An AWS account — you can create one on the AWS Free Tier page
- A stable internet connection
- Basic knowledge of operating systems (Linux or Windows)
- A few dollars of budget awareness: even on the Free Tier, set a billing alert before you start so a forgotten instance can’t surprise you.
Step-by-Step Guide to Launch Your First AWS Server

Step 1: Sign in to the AWS Management Console
Go to the AWS Management Console and sign in with your account credentials. If you don’t have an account yet, create one first — you’ll need a valid email address and a payment method, even for the Free Tier. Turn on multi-factor authentication (MFA) on your root account before you do anything else; it’s the single most important security step for a new account.
Step 2: Navigate to the EC2 Dashboard
From the AWS Management Console, search for EC2 and click on it to open the EC2 Dashboard. Check the region in the top-right corner before you launch anything — pick the region closest to you or your users for lower latency, and remember that prices and available instance types vary slightly by region.
Step 3: Click “Launch Instance”
On the EC2 Dashboard, click the Launch Instance button to start creating a new virtual server. The launch wizard walks you through every setting on one page, so you can review everything before you commit.
Step 4: Name Your Server and Choose an AMI
Give your instance a clear name (for example, MyFirstServer) and choose an Amazon Machine Image (AMI) — the template that decides which operating system your server runs.
Choose an Amazon Machine Image (AMI)
For beginners, Amazon Linux 2023 AMI is recommended — it’s free-tier eligible, secure, and widely supported. If you’re following a tutorial written for Ubuntu, pick an Ubuntu image instead; the steps below work the same way, but the default username changes (ubuntu instead of ec2-user).
Choose an Instance Type
Select t2.micro (Free Tier eligible). This instance type offers 1 vCPU and 1 GB of RAM — sufficient for learning and small-scale projects. Don’t pick a larger instance for your first server; you can change the instance type later if you need more power.
Configure Instance Details
- Network: Keep the default VPC and subnet unless you have a specific requirement.
- Auto-assign Public IP: Enable it — you need a public IP to connect to your server from the internet. If you disable it, you won’t be able to reach the server at all.
Step 5: Create a Key Pair (Important)
Click Create New Key Pair, name it (for example, my-key), and choose .pem format (for Linux or Mac) or .ppk (for Windows with PuTTY). Download and store it safely — AWS never shows you the private key again, and without it you can’t log in to your server. Keep a backup in a safe place, and never share the file or commit it to a public code repository. Amazon’s documentation explains how key pairs work if you want the full details.
Step 6: Configure the Security Group
Security groups act as a virtual firewall for your instance. For this first server, allow SSH (port 22) so you can connect, and HTTP (port 80) and HTTPS (port 443) if you plan to host a website.
Important: restrict SSH to your own IP address (the console offers a “My IP” option) instead of opening it to the whole internet (0.0.0.0/0). Opening SSH to everyone invites automated login attempts within minutes, and it’s one of the most common beginner mistakes. HTTP and HTTPS can stay open to everyone, since that’s how visitors reach a website.
Step 7: Configure Storage
Keep the default 8 GB gp3 volume — plenty for a first server and free-tier eligible. You can increase it later if needed, and you can add extra volumes at any time. Note that storage is billed separately from the instance, so delete volumes you no longer need.
Step 8: Review and Launch
Double-check your settings — especially the region, instance type, and key pair — then click Launch Instance. Your server will be up and running in a few minutes. The console shows the instance state as “running” once it’s ready. Amazon’s EC2 getting started guide walks through the same launch flow if you want a second reference.
Step 9: Connect to Your Server Using SSH
Once your instance is running, connect to it using SSH from your terminal. First, lock down the key file’s permissions, then connect with the ec2-user account and your instance’s public IP address:

chmod 400 my-key.pem
ssh -i "my-key.pem" ec2-user@your-public-ipIf the connection fails, check two things first: that your security group allows SSH from your IP, and that you’re using the right username for your AMI (ec2-user for Amazon Linux, ubuntu for Ubuntu).
Step 10: (Optional) Install a Web Server
Want to host a website? Install Apache on your server. Amazon Linux 2023 uses dnf as its package manager:
sudo dnf install httpd -y
sudo systemctl start httpd
sudo systemctl enable httpdNow, open your server’s public IP in a browser — you should see the Apache test page. (Older guides use yum here; it still works on Amazon Linux 2023 as a compatibility wrapper, but dnf is the current tool.)
Security Best Practices
- Never share your private key (.pem file).
- Root login over SSH is disabled by default on Amazon Linux — keep it that way, and use IAM roles instead of hardcoding credentials.
- Keep your security group rules minimal — only open the ports you actually need, and restrict SSH to your own IP.
- Enable MFA on your AWS account.
- Regularly update your server’s OS and software.
Pro Tips for Beginners
- Use the AWS Free Tier to practice without incurring costs — and set a billing alert on day one.
- Use Elastic IPs for a static public IP.
- Monitor usage with AWS Cost Explorer and set billing alerts.
- Use tags (Name, Project, Environment) to organize instances.
- When you’re done experimenting, stop or terminate the instance — a stopped instance still bills for storage, but a terminated one doesn’t.
- Planning to certify? Follow our AWS Cloud Practitioner exam roadmap for 2026.
Common Use Cases
- Hosting a personal blog or portfolio website
- Running development or test environments
- Learning cloud computing and DevOps
- Hosting APIs and small applications
If your app grows beyond a single server, read our complete guide to Microservices Architecture on AWS.
Common Mistakes to Avoid
- Choosing the wrong region (higher latency or cost)
- Forgetting to stop or terminate unused instances (unexpected bills)
- Using weak security group rules — especially opening SSH to the whole internet
- Losing the private key file
- Leaving ports open to the public
Final Thoughts
Launching your first server on Amazon Web Services using Amazon EC2 is a foundational skill in cloud computing. Once you’re comfortable with this process, you can scale up to deploying full applications, databases, and distributed systems. Start small, keep your security tight, and clean up when you’re done — that’s the whole habit.
Once you’re comfortable with servers, explore Serverless Architecture on AWS to run code without managing a server at all.
Now that you know how to create your first server on AWS, go ahead and launch your first EC2 instance today!

