How To deploy React App to Firebase

Prafull Kumar
3 min readOct 13, 2020

--

Step 1) Go to Firebase Hosting =>get started

You will See bellow Screen Shot

Step 2) install firebase-tools globally if you dont installed . if you have installed then dont need to install firebase-tools

npm install -g firebase-tools

Step 3) Click on Next you will see “Intialize your project”

Step 4) Go to the terminal set your directory where your react app is located

Example: Mine is /gallaryfire

Step 5) firebase login

Check if your logged in or not if not then it will redirect to the login page automatically

Step 5) npm run build

it will create build folder in to the your react-app (Wait until it finishes)

Step 6) firebase init

Use up-down arrow key move => to select use Space Bar=>select Hosting:Configure and deploy Hosting sites To=>Hit Enter

when you press space bar at particular Hosting: it will turn to green like as shown screen shot

Next Step: auto selected Use an existing Project=>Hit enter

Next step:Select The Project Name (Here i have testdata-c7958(textData))=>Hit Enter

After Selecting It will ask 3 question

1)What do you want to use your public directory?build(type manually)

2)Configure Single-page app ? type Yes/y

3)Till will ask for re-write?Type No/n =>Hit Enter

Step 7)firebase use testdata-c7958(project-ID)

To get Project id follow the steps

Click on Setting button=>Project Setting=> project Id

Next hit Enter =>You will get Now your using textdata-c7958

Step 8) firebase deploy

At last till give the Hosted Link(see screen Shot)

--

--

Prafull Kumar
Prafull Kumar

No responses yet