Clean β’ Professional
Once your React application is ready for production, the next step is deployment β making your app accessible online for users. Fortunately, modern platforms like Netlify, Vercel, and GitHub Pages make React app deployment fast, free, and beginner-friendly.
In this guide, youβll learn how to deploy your React project on each of these platforms step-by-step.
Deployment means hosting your React appβs optimized build (/build folder) on a server so users can access it via a URL.
When you run:
npm run build
React generates:
index.html entry pointThis build folder is what youβll deploy.
Netlify is one of the easiest and most popular platforms for hosting React apps.
It offers free SSL, continuous deployment, and instant rollbacks.
Build your project:
npm run build
Login or sign up at Netlify.com.
Connect your GitHub repository (or drag and drop your /build folder into Netlify).
Set build settings:
npm run buildbuildClick Deploy Site.
Vercel, created by the Next.js team, is another excellent option for deploying React and Next.js apps.
Itβs optimized for frontend performance, global CDN, and easy integration.
Install the Vercel CLI (optional):
npm i -g vercel
Run the build:
npm run build
Deploy via command:
vercel
or connect your project through the Vercel Dashboard (vercel.com).
Configure settings:
buildVercel automatically builds and deploys your app.
If your React project is hosted on GitHub, GitHub Pages is a simple and free hosting option for static websites.
Install the gh-pages package:
npm install gh-pages --save-dev
Add these lines to your package.json:
"homepage": "https://<your-username>.github.io/<your-repo-name>",
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
}
Run:
npm run deploy
Your React app will be live at:
https://<your-username>.github.io/<your-repo-name>/
npm run build && npx serve -s build before deploying.