Deploy Your First App on AWS in 15 Minutes (Beginner Guide)
Which AWS Service Should a Beginner Use?
This is the most common confusion point. Here's my simple decision tree: EC2 for full control and learning. Elastic Beanstalk for managed deployments with less config. ECS/Fargate for containers. For a first-time deployment, I recommend EC2 — you learn the most, and it's what most real companies use for basic workloads.
Step 1: Launch an EC2 Instance (Free Tier)
# AWS Console → EC2 → Launch Instance
# Settings:
AMI: Ubuntu 24.04 LTS
Instance type: t2.micro (free tier)
Key pair: Create new → download .pem file
Security group: Add rules:
- SSH (22) from your IP
- HTTP (80) from 0.0.0.0/0
- HTTPS (443) from 0.0.0.0/0
Storage: 8GB gp3 (free tier)
Step 2: Connect and Set Up Your Server
# On your local machine
chmod 400 your-key.pem
ssh -i your-key.pem ubuntu@YOUR_EC2_PUBLIC_IP
# On the server
sudo apt update && sudo apt upgrade -y
sudo apt install -y docker.io nginx git
# Start Docker
sudo systemctl enable docker
sudo usermod -aG docker ubuntu
# Log out and back in for group change
# Start Nginx
sudo systemctl enable nginx
sudo systemctl start nginx
Step 3: Deploy Your App with Docker
# Pull and run your Dockerized app
docker pull yourusername/yourapp:latest
docker run -d \
--name myapp \
-p 3000:3000 \
--restart unless-stopped \
-e NODE_ENV=production \
-e DATABASE_URL="your_db_url" \
yourusername/yourapp:latest
# Check it's running
docker ps
docker logs myapp
Step 4: Configure Nginx as Reverse Proxy
sudo nano /etc/nginx/sites-available/myapp
# Paste this config:
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache_bypass $http_upgrade;
}
}
sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Step 5: SSL Certificate (Free, via Let's Encrypt)
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com
# Follow the prompts — certbot auto-configures Nginx for HTTPS
sudo certbot renew --dry-run # Test auto-renewal
You now have a live, SSL-secured app deployed on AWS. Cost: ₹0 for 12 months on free tier.
💡 Quick Answer: To deploy your first app on AWS: Launch a t2.micro EC2 instance (free tier), SSH in, install Docker and Nginx, run your Docker container on port 3000, configure Nginx as a reverse proxy on port 80, and add SSL with Let's Encrypt. Total time: 15–20 minutes.