How to deploy a React app to Netlify

Deploying React applications requires a hosting platform that supports static files, provides HTTPS, and handles client-side routing properly. As the creator of CoreUI with over 12 years of React experience since 2014, I’ve deployed numerous production applications to various hosting platforms. Netlify is a popular choice for React apps offering automatic builds from Git, instant rollbacks, and built-in CDN with zero configuration. The deployment process connects your Git repository to Netlify for automatic deployments on every push.

Connect your Git repository to Netlify for automatic deployment with continuous integration.

Method 1: Deploy via Netlify Dashboard

  1. Build your React app locally:
npm run build
  1. Sign up at netlify.com

  2. Click “Add new site” → “Import an existing project”

  3. Connect your Git provider (GitHub, GitLab, Bitbucket)

  4. Configure build settings:

    • Build command: npm run build
    • Publish directory: build
  5. Click “Deploy site”

Method 2: Deploy via Netlify CLI

# Install Netlify CLI
npm install -g netlify-cli

# Login to Netlify
netlify login

# Initialize and deploy
netlify init

# Or deploy manually
npm run build
netlify deploy --prod

Configure client-side routing - Create public/_redirects:

/*    /index.html   200

Set environment variables in Netlify Dashboard:

  • Site settings → Build & deploy → Environment → Edit variables
  • Add variables like REACT_APP_API_URL

Best Practice Note

The _redirects file ensures client-side routing works correctly by redirecting all routes to index.html. Netlify automatically provides HTTPS and a CDN. Use branch deploys for preview environments—each Git branch gets its own URL. Enable deploy previews for pull requests to test changes before merging. This is how we deploy CoreUI React templates—Git-based continuous deployment with automatic builds, preview URLs for testing, and instant production deployments.


Speed up your responsive apps and websites with fully-featured, ready-to-use open-source admin panel templates—free to use and built for efficiency.


About the Author

Subscribe to our newsletter
Get early information about new products, product updates and blog posts.
How to check if a string is a number in JavaScript
How to check if a string is a number in JavaScript

How to dynamically add, remove, and toggle CSS classes in React.js
How to dynamically add, remove, and toggle CSS classes in React.js

How to migrate CoreUI React Templates to Vite
How to migrate CoreUI React Templates to Vite

CSS Selector for Parent Element
CSS Selector for Parent Element

Answers by CoreUI Core Team