Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security, Veeam & DevOps

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form

How to deploy a React Application to AWS S3

Posted on 12/03/202216/08/2026 Dickson Victor By Dickson Victor 2 Comments on How to deploy a React Application to AWS S3
  1. Home
  2. AWS/Azure/OpenShift
  3. How to deploy a React Application to AWS S3
react

In this article, we are going to learn how to deploy a React Application to AWS S3. Simple Storage Service, aka S3, is a block storage service offered by AWS. It is the most commonly used, go-to storage service for AWS users. It provides valuable features like high availability, security, easy connection to AWS services, and hosting static websites. In this tutorial, we will create a sample react app and deploy it as a static website to AWS S3.

There is almost negligible cost to host your websites using S3 website hosting so this can be a great way for you to host your websites for personal work.

Kindly refer to our related AWS guides: Creating IAM Users, Adding MFA and Policies on AWS, how to manage cost with AWS Budgets, how to deploy an Angular App to AWS S3, and how to deploy Dynamic Website to AWS EC2.

Take a look at what we shall be covering in this article:
- We shall create a simple React App using the "create react app" command
- We shall configure an S3 bucket for static web hosting
- We will be deploying to AWS Cloud

For this tutorial, you should have NodeJS installed on your computer and access to an AWS Account. So, let’s get started.

Creating a ReactJS Application

Go to the CLI in your computer, access the directory where you want to create the react app, and run the following command with any app name of your choice. I have chosen to create a “techdirectarchive-app”

npx create-react-app techdirectarchive-app

This will create a new “techdirectarchive-app” folder in our current directory. Let us move into this directory by running the following command.

 cd techdirectarchive-app

Before we start the default React App. We need to install all the application dependencies by running the following command.

npm install

Let us now start our React App by running the following command

npm start

This should open a browser tab for you and you should see the default react app running on a localhost port. You can stop the application by pressing Ctrl+C in the terminal.

With this, we have now successfully created our first react app. Let us now access the AWS Console and configure our S3 bucket for website hosting.

Setting up your AWS S3 bucket for website hosting.

– Sign in to the AWS Management Console.
– Navigate to AWS S3 dashboard.

This is the S3 dashboard where you can see the S3 buckets created in your account. Click on Create bucket to create your S3 bucket for website hosting.

1-final-1

The first option when creating the S3 bucket is to give it a name. Note here that your bucket name should be unique across All the S3 buckets in the world, so, if you try to keep common names, you might get some conflicts. See S3 bucket naming rules. Choose a unique name for your bucket. The next option is the AWS region. Choose a region closest to your location.

2

Leave the Object Ownership Option as default.

3

For the Bucket Public Access option, uncheck the default Block all public access and acknowledge the box below as shown in the image. We want our S3 website to be accessible to anyone in the world. SO, it is important that we do not restrict public access.

4-final-1

You can leave all the other parameters as default and click on the Create Bucket button at the end of the page.

You can now see your S3 bucket in the list. Click on the bucket name.

5-final

Go to the properties tab.

6-f

Now scroll down to find the Static website hosting property. Click edit.

7-f

Enable the Static website hosting

Choose to enable Static website hosting. Add index.html as your Index and Error document. Click on the Save Changes button below.

8

Scroll to the top of the page and choose the Permissions tab. We need to make changes to the S3 bucket policy. Click the Edit button as shown below.

9-f

Copy and enter the following bucket policy and replace the REPLACE_ME value with the bucket ARN of your bucket.

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "REPLACE_ME/*"
}
]
}
10-f

Click on save changes. We have now successfully configured a new S3 bucket for website hosting. Let us now deploy the React application to S3.

Deploy the React App to S3

Move to the project directory using your command line and run the following command.

npm run build

Note that this command created a build directory in your project.

11

Now go to your bucket in the S3 console and Click on the Upload button.

12-f

Use the Add files and Add folder button to upload all the files and the static folder in the build folder as shown below. Click the Upload button at the bottom of the page.

13-f

After a successful upload, close the upload page. Back in your S3 bucket Go to the properties tab find the URL of your S3 website in the static website hosting option and click on it.

15-f

You should see your create-react-app website on the screen.

14-f

You have now successfully created and deployed a React app to AWS S3.

I hope you found this blog post helpful on how to deploy a React Application to AWS S3. If you have any questions, please let me know in the comment session.

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
AWS/Azure/OpenShift Tags:AWS, AWS s3

Post navigation

Previous Post: Set up and configure Route 53 for your Domain in AWS
Next Post: How to Install Jenkins Automation Server on Ubuntu 20.04 LTS

Related Posts

  • How to Manage Azure Virtual Machines with Windows Admin Center and Serial Console​
    Manage Azure Virtual Machine with Windows Admin Center and Serial Console AWS/Azure/OpenShift
  • Storage Explorer
    How to Install Azure Storage Explorer on Windows AWS/Azure/OpenShift
  • banner2 1
    How to use GitHub as Source Provider for AWS CodePipeline AWS/Azure/OpenShift
  • Backup for Microsoft 365 and Azure
    Veeam Backup Deployment options for Microsoft 365 Data AWS/Azure/OpenShift
  • Angular 1
    How to deploy an Angular App to AWS S3 AWS/Azure/OpenShift
  • Setup FSx File System 1
    Create and mount FSx File System: Join EC2 instance to AWS Managed AD AWS/Azure/OpenShift

More Related Articles

How to Manage Azure Virtual Machines with Windows Admin Center and Serial Console​ Manage Azure Virtual Machine with Windows Admin Center and Serial Console AWS/Azure/OpenShift
Storage Explorer How to Install Azure Storage Explorer on Windows AWS/Azure/OpenShift
banner2 1 How to use GitHub as Source Provider for AWS CodePipeline AWS/Azure/OpenShift
Backup for Microsoft 365 and Azure Veeam Backup Deployment options for Microsoft 365 Data AWS/Azure/OpenShift
Angular 1 How to deploy an Angular App to AWS S3 AWS/Azure/OpenShift
Setup FSx File System 1 Create and mount FSx File System: Join EC2 instance to AWS Managed AD AWS/Azure/OpenShift

Comments (2) on “How to deploy a React Application to AWS S3”

  1. Avatar photo Sidd Saran says:
    16/07/2022 at 7:48 PM

    Thanks. This was helpful!

    Log in to Reply
    1. chris Christian says:
      18/07/2022 at 11:16 PM

      You are welcome

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

Veeam Vanguard

  • XCP ng installation and VM creation
    A-Z of XCP-ng and Xen Orchestra setup and VM Creation Virtualization
  • image 25
    ESXI 6.7 ALARM: Seat disk exhaustion on 10 Virtualization
  • SSL for Localhost on WAMP
    How to configure SSL for WAMP server Windows Server
  • SASS in VsCode
    How to Install SASS on VsCode Scripts
  • sql 1
    Editions of MSSQL Server: What are the differences between various Editions of Microsoft SQL Server Oracle/MSSQL/MySQL
  • image 1
    Fix Windows Can’t find the path: Please check the spelling and try again Windows
  • dfggg 1
    Configuring SimpleSAMLPHP Windows Server
  • Screenshot 2020 05 16 at 17.13.18
    What is Jira re-indexing and why you should perform it JIRA|Confluence|Apps

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,762 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Contact
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon
  • Bsky

Tags

Active Directory Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2026 TechDirectArchive

Loading Comments...

You must be logged in to post a comment.