AWS Builder Center

Deploying a React Single Page Application (SPA) to AWS S3 and CloudFront

A step-by-step practical guide to hosting a modern React application on Amazon S3 with global low-latency distribution and SSL via AWS CloudFront.

Hosting a modern Single Page Application (SPA) built with React, Vite, or Next.js static export does not require managing dedicated web servers. Combining Amazon S3 for static asset storage with Amazon CloudFront for global content distribution provides high performance, automatic SSL, and minimal operating costs.
In this walkthrough, we will cover the entire pipeline to deploy a production-ready static site.



1. Build the Production Bundle

First, generate the optimized production assets locally:
# If using Vite
npm run build
# If using Create React App
npm run build
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article