Learn how to deploy your React Js application on firebase

Rohit Malhotra
2 min readAug 6, 2019

Hola Amigos, if you wondering about how to deploy your react js app, here I will tell you deploying your application on the firebase’s free hosting service in just few simple steps.

# Remember your system should have node js installed on it before you start.

  1. First create an app in your firebase account.

# No need to setup google analytics for now.

2. Then in your firebase dashboard go to hosting section and click on get started.

3. Now, open terminal/cmd and run the following command and click next in firebase console

npm install -g firebase-tools

4. Then just do a firebase login through your pc by running the below command.

firebase login

5. Now initialise the firebase project in your project directory by running the below command in your project directory.

firebase init

6. Now select the below option from the list of options

Hosting: Configure and deploy Firebase Hosting sites

7. Now select the name of the remote firebase project to which you want to link this local project repository.

8. Now you will be asked to choose your public directory folder. Now type build (build folder will be the directory with asset files) and hit enter.

9. Now you will be asked that you want to configure it as a single-page app. type yes (as react app is single page)and hit enter.

10. Your Firebase config is done, now just create a production build on you machine by running the below command in the project directory.

npm run build

11. Now deploy this build to firebase.

firebase deploy

12. Now just go to hosting section in firebase console and click on the link provided there and your react application is there.

Hurray!!, we just deployed our react application. Now you just have to use the firebase deploy command from next time to deploy.

--

--