React5 min read
React Deployment
Deploy your React app to production platforms.
Sarah Johnson
December 20, 2025
0.0k0
Deploy your React app to production.
Build for Production
npm run build
Creates optimized production build in build/ folder.
Vercel Deployment
- Install Vercel CLI:
npm i -g vercel
- Deploy:
vercel
Netlify Deployment
- Install Netlify CLI:
npm i -g netlify-cli
- Deploy:
netlify deploy --prod
GitHub Pages
- Install gh-pages:
npm i gh-pages
- Add to package.json:
{
"homepage": "https://username.github.io/repo-name",
"scripts": {
"deploy": "gh-pages -d build"
}
}
- Deploy:
npm run deploy
Environment Variables
Set in platform settings:
- Vercel: Project Settings → Environment Variables
- Netlify: Site Settings → Build & deploy → Environment
Remember
- Build before deploying
- Set environment variables
- Test production build locally
- Use HTTPS in production
Next: Learn forms with libraries!
#React#Deployment#Production#Intermediate