Skip to main content

Deploying a React App to Surge.sh

· One min read
Preet Shah
Software Developer @ JPMC

To deploy a React app to Surge.sh, follow the instructions below:

  1. Create a new file named CNAME in the public folder and enter the name of your surge domain in it.
  2. In the terminal in the root directory of your project, run the following commands:
npm run build
cd build
  1. Rename index.html to 200.html in the build folder, for client side routing.
  2. Run surge in the terminal to deploy your app to surge.sh

References