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
-
Go to GoDaddy: Visit https://www.godaddy.com.
-
Search for Domain: Use the search bar to check availability of
aiacademywebsite.com. -
Add to Cart and Purchase:
-
Confirm Domain Ownership
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
-
Create AWS Account
-
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. -
Configure AWS CLI (Optional but Recommended): Install AWS CLI
-
Configure CLI with IAM user credentials (Optional but Recommended):
Validation
- Login with IAM user works.
- MFA prompts on root login.
aws sts get-caller-identityreturns 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
-
Create Route 53 Hosted Zone
-
Note the 4 Nameservers: AWS generates 4 NS records (e.g.,
ns-123.awsdns-45.com). -
Update GoDaddy Nameservers:
-
Wait for DNS Propagation: Can take from a few minutes up to 48 hours (usually <1 hour).xw
Validation
dig aiacademywebsite.comreturns Route 53 nameservers.whois aiacademywebsite.comshows 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
-
Create S3 Bucket
-
Configure Bucket for Private Access: CloudFront will access via Origin Access Control.
-
Upload Sample Files (Optional): Upload a simple
index.htmlto 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
-
Request SSL Certificate in ACM
-
Add DNS Validation Records
-
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 -
Update Route 53 Records
Validation
- Visit
https://aiacademywebsite.comandhttps://www.aiacademywebsite.com(should show default or test page). - Confirm HTTPS lock icon in browser.
- Use
curl -I https://aiacademywebsite.comto 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
-
Build React Frontend: In your project directory
This creates abuild/folder with static files. -
Upload Build to S3
This syncs your local build folder to the S3 bucket, deleting removed files. -
Invalidate CloudFront Cache: Find your CloudFront distribution ID in AWS Console. Then run:
This forces CloudFront to fetch the latest files from S3.
Validation
- Visit
https://aiacademywebsite.comand 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
- Access Website URLs
https://aiacademywebsite.com-
https://www.aiacademywebsite.com -
Verify Content Loads Correctly
- All images, CSS, JS load without errors.
- 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.