Skip to content

Guide to Launch a Website on AWS

This guide walks you through launching an example website (the AI Academy Website). This website contains a static React frontend hosted securely on AWS, with a custom domain purchased from GoDaddy.

Phase 1: Idea to Domain Registration Using GoDaddy

Purpose

Register a memorable domain name for your website to establish your online presence.

Prerequisites

  • Internet access
  • Payment method (credit card)
  • Estimated time: 10–20 minutes
  • Estimated cost: 10–20 dollars /year (varies by domain and privacy options)

Steps

  1. Go to GoDaddy: Visit https://www.godaddy.com.

  2. Search for Domain: Use the search bar to check availability of aiacademywebsite.com.

  3. Add to Cart and Purchase:

    - Select the domain if available.
    - Choose registration length (1 or 2 years recommended).
    - Add Domain Privacy Protection to hide your personal info.
    - Proceed to checkout and complete payment.
    

  4. Confirm Domain Ownership

    - Log in to GoDaddy dashboard → My Products → Domains.
    - Confirm domain status is Active.
    - Access DNS and Nameserver settings.
    

Validation

  • Confirm domain appears in your GoDaddy account as Active.
  • WHOIS lookup (e.g., https://who.is) shows privacy enabled.

Phase 2: AWS Account Setup and Configuration

Purpose

Create a secure AWS account to host and manage your website infrastructure.

Prerequisites

  • Email address
  • Phone number for verification
  • Payment method (credit card)
  • Estimated time: 15–30 minutes
  • Cost: Free to create; pay-as-you-go for AWS services (S3, CloudFront free tier available)

Steps

  1. Create AWS Account

    - Visit [https://aws.amazon.com](https://aws.amazon.com) → Create an AWS account.
    - Enter email, password, and account details.
    - Add billing info and verify phone number.
    

  2. Secure Your Account Immediately

    - Log in to AWS Console.
    - Navigate to IAM (Identity and Access Management).
    - Enable Multi-Factor Authentication (MFA) on the root account:
    - Go to My Security Credentials → Activate MFA → Use an authenticator app.
    - Create an **Admin IAM User**:
    - IAM → Users → Add user → Username: `admin` → Programmatic and Console access.
    - Attach **AdministratorAccess** policy.
    - Save credentials securely.
    - Use this IAM user for daily work; avoid root account.
    

  3. Configure AWS CLI (Optional but Recommended): Install AWS CLI

    # macOS (Homebrew)
    brew install awscli
    
    # Windows (MSI installer)
    # https://awscli.amazonaws.com/AWSCLIV2.msi
    
    # Linux (curl)
    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    unzip awscliv2.zip
    sudo ./aws/install
    

  4. Configure CLI with IAM user credentials (Optional but Recommended):

    aws configure
    # Enter Access Key ID, Secret Access Key, region (e.g., us-east-1), output format (json)
    

Validation

  • Login with IAM user works.
  • MFA prompts on root login.
  • aws sts get-caller-identity returns your IAM user info.

Phase 3: Route 53 DNS Setup

Purpose

Manage your domain’s DNS records within AWS for seamless integration with AWS services.

Prerequisites

  • Domain registered on GoDaddy
  • AWS account ready
  • Estimated time: 15–30 minutes
  • Cost: Route 53 hosted zones cost $0.50/month per hosted zone + $0.40 per million queries (minimal for small sites)

Steps

  1. Create Route 53 Hosted Zone

    - AWS Console → Route 53 → Hosted Zones → Create Hosted Zone
    - Domain name: aiacademywebsite.com
    - Type: Public Hosted Zone
    - Click Create
    

  2. Note the 4 Nameservers: AWS generates 4 NS records (e.g., ns-123.awsdns-45.com).

  3. Update GoDaddy Nameservers:

    - GoDaddy → My Products → Domains → aiacademywebsite.com → Manage DNS → Nameservers
    - Select Custom
    - Enter the 4 Route 53 nameservers exactly
    - Save changes
    

  4. Wait for DNS Propagation: Can take from a few minutes up to 48 hours (usually <1 hour).xw

Validation

  • dig aiacademywebsite.com returns Route 53 nameservers.
  • whois aiacademywebsite.com shows updated nameservers.
  • Visit http://aiacademywebsite.com (may show no content yet).

Phase 4: S3 Static Website Hosting

Purpose

Host your static React frontend files securely and privately on AWS S3.

Prerequisites

  • AWS account with Route 53 hosted zone
  • AWS CLI configured (optional)
  • Estimated time: 10–15 minutes
  • Cost: S3 storage costs ~$0.023/GB/month; minimal for small sites

Steps

  1. Create S3 Bucket

    - AWS Console → S3 → Create bucket
    - Bucket name: `aiacademy-frontend-prod` (must be globally unique)
    - Region: Choose your preferred AWS region (e.g., us-east-1)
    - Uncheck Block all public access
    - Click Create bucket
    

  2. Configure Bucket for Private Access: CloudFront will access via Origin Access Control.

  3. Upload Sample Files (Optional): Upload a simple index.html to test.

Validation

  • Bucket created and visible in S3 console.
  • Upload a test file and confirm it appears in the bucket.
  • No public access allowed (test by accessing S3 URL directly; should be denied).

Phase 5: CloudFront CDN and HTTPS Setup

Purpose

Distribute your website globally with low latency and secure it with HTTPS.

Prerequisites

  • S3 bucket with website files
  • Route 53 hosted zone
  • AWS Certificate Manager (ACM) certificate in us-east-1
  • Estimated time: 30–60 minutes (includes certificate validation)
  • Cost: CloudFront free tier includes 1TB data transfer/month; otherwise pay-as-you-go

Steps

  1. Request SSL Certificate in ACM

    - AWS Console → Certificate Manager → Switch to **us-east-1** region
    - Request a public certificate for:
         - `aiacademywebsite.com`
         - `www.aiacademywebsite.com`
    - Choose **DNS validation**
    - ACM provides CNAME records to add to Route 53.
    

  2. Add DNS Validation Records

    - Route 53 → Hosted Zones → `aiacademywebsite.com`
    - Create CNAME records as provided by ACM
    - Wait for certificate status to become **Issued** (can take 5–15 minutes)
    

  3. Create CloudFront Distribution

    - AWS Console → CloudFront → Create Distribution → Web
    - Origin Domain: Select your S3 bucket (not website endpoint)
    - Origin Access Control (OAC): Enable to restrict S3 access to CloudFront only
    - Viewer Protocol Policy: Redirect HTTP to HTTPS
    - Alternate Domain Names (CNAMEs):
         - `aiacademywebsite.com`
         - `www.aiacademywebsite.com`
    - SSL Certificate: Choose the ACM certificate created earlier
    - Default Root Object: `index.html`
    - Create distribution and wait for status **Deployed** (can take 15–30 minutes)
    - Add Error Pages (403 and 404) with routing to /index.html
    

  4. Update Route 53 Records

    - Create two **A (Alias)** records:
         - Name: `aiacademywebsite.com` → Alias to CloudFront distribution
         - Name: `www.aiacademywebsite.com` → Alias to same CloudFront distribution
    

Validation

  • Visit https://aiacademywebsite.com and https://www.aiacademywebsite.com (should show default or test page).
  • Confirm HTTPS lock icon in browser.
  • Use curl -I https://aiacademywebsite.com to check HTTP headers and status 200.

Phase 6: Frontend Deployment

Purpose

Build and upload your React frontend to S3, then invalidate CloudFront cache to serve latest content.

Prerequisites

  • React project source code
  • AWS CLI configured
  • Estimated time: 10–20 minutes per deployment
  • Cost: Minimal (S3 storage and CloudFront invalidation charges apply)

Steps

  1. Build React Frontend: In your project directory

    npm install
    npm run build
    
    This creates a build/ folder with static files.

  2. Upload Build to S3

    aws s3 sync build/ s3://aiacademy-frontend-prod --delete
    
    This syncs your local build folder to the S3 bucket, deleting removed files.

  3. Invalidate CloudFront Cache: Find your CloudFront distribution ID in AWS Console. Then run:

    aws cloudfront create-invalidation --distribution-id E123ABC456DEF --paths "/*"
    
    This forces CloudFront to fetch the latest files from S3.

Validation

  • Visit https://aiacademywebsite.com and verify new content is live.
  • Use browser dev tools → Network tab → Disable cache and refresh.
  • Confirm no 403 or 404 errors on assets.

Phase 7: Testing and Validation

Purpose

Ensure your website is live, secure, and functioning as expected.

Steps

  1. Access Website URLs
  2. https://aiacademywebsite.com
  3. https://www.aiacademywebsite.com

  4. Verify Content Loads Correctly

  5. All images, CSS, JS load without errors.
  6. No mixed content warnings.

Validation

  • Website loads fast and securely on all tested devices.
  • No security warnings or errors.
  • DNS resolves correctly worldwide.

Summary

By following these detailed phases, you have:

  • Registered a domain with GoDaddy
  • Set up a secure AWS account with best practices
  • Configured Route 53 DNS for your domain
  • Hosted a private static website on S3
  • Delivered your site globally with CloudFront and HTTPS
  • Deployed your React frontend and invalidated caches
  • Validated your website is live, secure, and performant

This setup is scalable and production-ready, forming a solid foundation for future backend integration.