0Pricing
React Academy · Lesson

Hosting a React SPA on AWS S3 & CloudFront

Build a React app, upload to S3, configure CloudFront distribution and cache invalidation.

S3 Static Hosting Overview

AWS S3 can serve static files (HTML, JS, CSS, images) as a website. Combined with CloudFront (CDN), you get global distribution, HTTPS, and low latency for React SPAs.

Building the SPA

Build your React app to a static output directory.

# Vite:
npm run build  # outputs to dist/

# Create React App:
npm run build  # outputs to build/

# Next.js static export:
next build && next export  # outputs to out/

All lessons in this course

  1. Deploying to Vercel: Zero-Config & Preview URLs
  2. Hosting a React SPA on AWS S3 & CloudFront
  3. Dockerizing a React/Next.js App
  4. GitHub Actions CI/CD for React
← Back to React Academy