Deploy React App on Shared Hosting(Cpanel)

In order to deploy the React app on Shared hosting we need to replace this local address with your domain name.

  1. Replacing localhost with domain name.
Adding Domain in package.json

In package.json file of your react app add a new property “homepage”:”http://yourdomainname.com”

In order to deploy react App on Shared hosting we need to build the app.

2.Building the app using npm run build

In your project directory it will create a build folder and it will contain all your static files for project.

To upload the app on your hosting account you need a FTP account with your hosting address.

Leave a Comment

Your email address will not be published. Required fields are marked *