How to Deploy React App on Netlify Using Github?
Last Updated :
23 Jul, 2025
A React App is a web or mobile application that is built using the React library of JavaScript. It helps users create interactive, single-page, and dynamic applications. These applications are built using HTML, CSS, and JavaScript. Deployment of a React app can be done via GitHub, Netlify, or any other deployment platform. GitHub has its gh-pages, where the application can be built, started, and deployed. By deploying your project on such servers, you get a public URL for your project, which can be used to access your website or project.
Netlify is one of the easiest deployment platforms to use. It has both features:
- Using a GitHub repo
- Simple Drag and Drop (the build folder).
This makes Netlify very straightforward. To deploy a React App on Netlify using GitHub, the following steps must be followed:
Steps to Deploy a React App on Netlify using GitHub
Step 1: Create a React Application
At the very first, you need a react application. To create a react application, there are some prerequisites for your local system. There must be Node.js and npm installed in your system. If Node.js is not installed in your system, you can download it and install it. Also, to install npm, you can run the following command on your terminal -
npm install npm@latest -g
Now open your VS Code or some other IDE, Open the terminal, and run the following command to create a React App-
npx create-react-app My-Project
Navigate to your project directory, using the following command -
cd My-Project
And, start the React application by using the following command -
npm start
Step 2: Install the Required Dependencies
First of all, open your code in Visual Studio Code or in any other IDE.
Run the following command, in order to install the Netlify CLI package as a development dependency in your React project.
npm install netlify-cli -g
This allows users to deploy the react app directly from the terminal. (This is not a required step)
Step 3: Create a Build directory
Using the following command, we will now create a build for our production.
npm run build
This creates the main directory as 'build'. This Build folder contains all the required files that we need to deploy our application. Now, we are ready to push this code into our GitHub repository.
Step 4: Create a GitHub repository
Now, You have a react app on your local system. Open your GitHub account and create a new repository for your project. Name the repository anything you want, for example, My project. Push the code to the repository using Git Bash. For this, you need to have a good understanding of version controls.
Our project is uploaded on Github, We'll now move forward towards deploying our project: There are various development platforms like Heruku, Vercel, Netlify, Github pages, Digital Ocean, etc. But one of the most popular and easy-to-use platforms is Netlify. We'll be using Netlify to deploy our project in this article.
Step 5: Setting up Netlify
Create a Netlify account (if you have not any). Now, connect your GitHub account with Netlify. Authorize Netlify to use GitHub to access your repositories.
Follow these steps further:
- Go to the 'Sites' section from the header of the Netlify website's dashboard.
- Now, click on 'Add new site'.
- Select 'import an existing project', This will redirect you to a page where it will ask you to connect a Git provider.
- Select your Git provider, if our things are the same so far, choose GitHub.
- This will take you to a page, where all your GitHub repositories are listed.
- Choose your project repository.
- Now, there will be some settings,
a) Do not change the pre-filled details.
b) Leave the Base Directory empty.
c) In the Build Command, type "npm run build".
d) In the Publish Directory, type "build". - And, finally, click on the Deploy site.
- It'll redirect you to the deployment page, you can check the logs here, and see how things are working step by step.
- If the deployment fails for some reason, you'll get the error message. Remove the error and try deploying it again.
By the time, The react app is deployed. Once the deployment gets completed, you get a public URL for your project with the domain 'netlify.com'.
Step 6: Other ways to deploy
Using the GitHub repository is not the only way to deploy a React App on Netlify, this can also be done by -
- Drag and Drop method
- Using Netlify CLI (Command Line Interface)
Drag and Drop method is the easiest way to deploy your react app. All you need to do is, after step 3, Once you have to create a build directory, drag this 'build' folder, and drop it to the dashboard of Netlify. And start deploying.
The other way is to use Netlify CLI. After performing Step 2, Navigate to your working directory and run the following command to deploy the application.
netlify deploy
These were all the ways, a React application can be deployed on Netlify.
Conclusion
Deployment of your project makes it available for other users on the web. Deploying it on Netlify makes it easier for developers to make their React app public. By connecting Netlify with your GitHub, you can configure the settings and deploy your application. The app becomes available on the web as soon as the deployment gets completed. Netlify has a continuous development environment, so it becomes easier to update the app whensoever some changes are made to the app and pushed to GitHub. Thus, Deploying the React app on Netlify using GitHub is actually very easy and pretty straightforward. With the above-given steps, one can easily create and publish one React app on Netlify.
Similar Reads
React Tutorial React is a powerful JavaScript library for building fast, scalable front-end applications. Created by Facebook, it's known for its component-based structure, single-page applications (SPAs), and virtual DOM,enabling efficient UI updates and a seamless user experience.Note: The latest stable version
7 min read
React Fundamentals
React IntroductionReactJS is a component-based JavaScript library used to build dynamic and interactive user interfaces. It simplifies the creation of single-page applications (SPAs) with a focus on performance and maintainability.React.jsWhy Use React?Before React, web development faced issues like slow DOM updates
7 min read
React Environment SetupTo run any React application, we need to first setup a ReactJS Development Environment. In this article, we will show you a step-by-step guide to installing and configuring a working React development environment.Pre-requisite:We must have Nodejs installed on our PC. So, the very first step will be
3 min read
React JS ReactDOMReactDom is a core react package that provides methods to interact with the Document Object Model or DOM. This package allows developers to access and modify the DOM. Let's see in brief what is the need to have the package. Table of ContentWhat is ReactDOM ?How to use ReactDOM ?Why ReactDOM is used
3 min read
React JSXJSX stands for JavaScript XML, and it is a special syntax used in React to simplify building user interfaces. JSX allows you to write HTML-like code directly inside JavaScript, enabling you to create UI components more efficiently. Although JSX looks like regular HTML, itâs actually a syntax extensi
5 min read
ReactJS Rendering ElementsIn this article we will learn about rendering elements in ReactJS, updating the rendered elements and will also discuss about how efficiently the elements are rendered.What are React Elements?React elements are the smallest building blocks of a React application. They are different from DOM elements
3 min read
React ListsReact Lists are used to display a collection of similar data items like an array of objects and menu items. It allows us to dynamically render the array elements and display repetitive data.Rendering List in ReactTo render a list in React, we will use the JavaScript array map() function. We will ite
5 min read
React FormsForms are an essential part of any application used for collecting user data, processing payments, or handling authentication. React Forms are the components used to collect and manage the user inputs. These components include the input elements like text field, check box, date input, dropdowns etc.
5 min read
ReactJS KeysA key serves as a unique identifier in React, helping to track which items in a list have changed, been updated, or removed. It is particularly useful when dynamically creating components or when users modify the list. In this article, we'll explore ReactJS keys, understand their importance, how the
5 min read
Components in React
React ComponentsIn React, React components are independent, reusable building blocks in a React application that define what gets displayed on the UI. They accept inputs called props and return React elements describing the UI.In this article, we will explore the basics of React components, props, state, and render
4 min read
ReactJS Functional ComponentsIn ReactJS, functional components are a core part of building user interfaces. They are simple, lightweight, and powerful tools for rendering UI and handling logic. Functional components can accept props as input and return JSX that describes what the component should render.What are Reactjs Functio
5 min read
React Class ComponentsClass components are ES6 classes that extend React.Component. They allow state management and lifecycle methods for complex UI logic.Used for stateful components before Hooks.Support lifecycle methods for mounting, updating, and unmounting.The render() method in React class components returns JSX el
4 min read
ReactJS Pure ComponentsReactJS Pure Components are similar to regular class components but with a key optimization. They skip re-renders when the props and state remain the same. While class components are still supported in React, it's generally recommended to use functional components with hooks in new code for better p
4 min read
ReactJS Container and Presentational Pattern in ComponentsIn this article we will categorise the react components in two types depending on the pattern in which they are written in application and will learn briefly about these two categories. We will also discuss about alternatives to this pattern. Presentational and Container ComponentsThe type of compon
2 min read
ReactJS PropTypesIn ReactJS PropTypes are the property that is mainly shared between the parent components to the child components. It is used to solve the type validation problem. Since in the latest version of the React 19, PropeTypes has been removed. What is ReactJS PropTypes?PropTypes is a tool in React that he
5 min read
React Lifecycle In React, the lifecycle refers to the various stages a component goes through. These stages allow developers to run specific code at key moments, such as when the component is created, updated, or removed. By understanding the React lifecycle, you can better manage resources, side effects, and perfo
7 min read
React Hooks
Routing in React
Advanced React Concepts
React Projects