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

  1. Install Vercel CLI:
npm i -g vercel
  1. Deploy:
vercel

Netlify Deployment

  1. Install Netlify CLI:
npm i -g netlify-cli
  1. Deploy:
netlify deploy --prod

GitHub Pages

  1. Install gh-pages:
npm i gh-pages
  1. Add to package.json:
{
  "homepage": "https://username.github.io/repo-name",
  "scripts": {
    "deploy": "gh-pages -d build"
  }
}
  1. 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