1. Log in to AWS Management Console
- Go to: AWS EC2 Console
- Sign in with your AWS account.
2. Launch an EC2 Instance
- From the Services menu β Select EC2.
- Click Launch Instance.
- Give your instance a name (e.g.,
MyServer
).
3. Choose an Amazon Machine Image (AMI)
Select an OS (commonly used options):
- Amazon Linux 2 (Free tier eligible)
- Ubuntu Server (20.04/22.04)
- Windows Server (if required)
4. Choose Instance Type
-
Free tier:
t2.micro
(1 vCPU, 1GB RAM) - For larger workloads:
t3.medium
,m5.large
, etc.
5. Configure Key Pair (for SSH login)
- Under Key pair (login) β Create new key pair.
- Choose RSA and
.pem
format. - Download the
.pem
file β Keep it safe (required for SSH).
6. Configure Network Settings
- In Network settings:
- Ensure VPC and Subnet are selected (default works).
- Enable Auto-assign Public IP.
- Add Security group rules:
- β SSH (22) β For Linux (your IP only).
- β RDP (3389) β For Windows.
- β HTTP (80) β For web traffic.
- β HTTPS (443) β For SSL traffic.
7. Launch Instance
- Click Launch Instance β AWS will provision your server.
8. Connect to Your Server
πΉ For Linux (using terminal)
chmod 400 my-key.pem # Set correct permission
ssh -i "my-key.pem" ec2-user@<Public-IP>
πΉ For Ubuntu AMI
ssh -i "my-key.pem" ubuntu@<Public-IP>
πΉ For Windows
- Download RDP file from Connect β RDP client.
- Use Administrator password (decrypt using
.pem
file).
9. Install Required Software
Example: Install Nginx on Linux
sudo yum update -y
sudo yum install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
- Open browser β
http://<Public-IP>
10. (Optional) Elastic IP
- Prevents IP from changing after restart:
- EC2 Console β Elastic IPs β Allocate β Associate with instance.
β Your EC2 server is now ready!
Top comments (0)