Your first server on Amazon Web Services can feel like a maze of menus, and the names do not help. If you are deploying to aws ec2 for the first time, the good news is that the core path is short: pick a region, pick a small instance, lock it down with a key and a firewall rule, connect over SSH, and install your app. This walkthrough follows that path step by step on a free tier eligible instance, so you can learn the console without a surprise bill. Read each step before you click it, and check the free tier limits as you go, because a wrong instance size or a forgotten extra service is how first bills appear.
Before you launch: account, region, and budget
Learn the free tier shape before you launch. The aws free tier ec2 limits for the common t2.micro or t3.micro size cover a set number of hours per month for the first year, with a small amount of storage included. That is enough for a learning server, but it does not cover every instance type, every region, or extra services such as a load balancer or extra storage. If you are comparing providers before you commit, a look at AWS vs Google Cloud vs Azure pricing in 2026 can help you see where EC2 sits next to other clouds. For now, stick to one small instance, one small disk, and no extras.
How to do deploying to aws ec2 from the console
Open EC2 in the console, click Launch instance, and give it a name you will recognise, such as my-first-app. Pick Ubuntu Server 24.04 as the image, because it is a common choice with clear docs, and pick the t2.micro or t3.micro type that shows a free tier label. This aws ec2 first timer setup works best when you slow down on the key pair step: create a new key pair, pick the .pem format, and download the file at once, because AWS shows it only once. Save it in a safe folder and set its permissions so only you can read it. A key pair is the only way into the server by default, so losing it means rebuilding the instance.
chmod 400 my-first-key.pem ssh -i my-first-key.pem ubuntu@YOUR_PUBLIC_IP
Security groups explained in plain terms
A security group is a firewall that sits in front of your instance. It has rules for traffic coming in, and it blocks the rest by default. That default is a good thing. You add a rule only when you need it, and you remove it when you no longer need it. The ec2 security groups explained in short form are: SSH on port 22 for you, HTTP on port 80 for visitors, HTTPS on port 443 for visitors, and nothing else open to the world. Set SSH to your IP only, not to 0.0.0.0/0, because an open SSH port invites automated login tries from across the internet.
Connect and set up the server
Connect with SSH using the key file and the ubuntu user. The first login will ask you to accept the host key, and that is normal. Update the packages, create a deploy user if you want one, and turn on the firewall rules that match the security group. The server setup steps here match a plain VPS setup closely, so if you want the full hardening list, follow the guide to set up a secure Ubuntu 24.04 VPS from scratch and apply the same checks. Install Node, Nginx, and PM2, or install the stack your app needs, and test each tool with a version command before you move on.
sudo apt update && sudo apt upgrade -y sudo apt install -y nginx node -v npm -v sudo systemctl status nginx
Point a domain at the instance
Keep a note of the instance id, the region, the key name, and the domain. That note saves time when you return to the project after a break, and it helps a teammate who needs to help with the server. Do not share the .pem file in chat or in a repo. If a key leaks, create a new key pair, add the new public key to the server, and remove the old one. A leaked key is a reason to act at once, not a detail to fix later.
Keep the bill small and the server healthy
Watch the bill from the first week. Open Cost Explorer, check the daily cost, and confirm the instance is inside the free tier. Set a second alert for the end of the free tier period, because the same instance will start to bill at the normal rate after twelve months. If you want ideas for cutting costs, read the guide to cut your AWS bill with cloud cost optimization and apply the parts that fit a single small server. Stop the instance when you are not using it for a long break, and terminate it when the project is done, because a stopped instance still bills for its storage. A terminated instance bills for nothing, but its data is gone, so back up anything you need first.
Keep the server patched, keep the logs turning over, and keep a backup of the database and the env file in a separate place. A small instance can run a real project, but it has little spare room, so check disk space and memory once a week. If the app outgrows the free tier size, compare the next size up with a plain VPS before you upgrade. A roundup of the best unmanaged VPS providers in 2026 for performance can help you weigh the move, and the right choice depends on how much control you want and how much traffic the app gets.
FAQ
Do I need a credit card to use the AWS free tier?
Yes, AWS asks for a card to open an account, even for free tier use. The card is for identity checks and for charges outside the free tier. Set budget alerts at once, and check Cost Explorer in the first week so no charge goes unnoticed.
What happens when the free tier year ends?
The same instance starts to bill at the normal hourly rate, and storage bills too. Check official pricing for the rate in your region before the year ends, then decide whether to keep the instance, move to a smaller size, or move the app to another host.
Can I run a production app on a t2.micro or t3.micro?
A small app with light traffic can run on it, but it has limited CPU and memory. Watch memory use, keep the app lean, and move up a size when response times grow or the server starts to swap. Test with real traffic before you call it production-ready.