Skip to main content

Firebase Tools Install and Setup

1. Install package

npm install -g firebase-tools

or with yarn

yarn global add firebase-tools

You can also choose to install it as a dependency for your project rather than globally

npm install --save-dev firebase-tools

or with yarn

yarn add -D firebase-tools

2. Configure Firebase Tools

In your projects root directory run:

firebase init

or if your installed it within your project rather than globally

npx firebase init

or with yarn

yarn firebase init

This will ask you to login if you are not logged in already, the process will take you through a browser redirect to log you into Firebase.

3. Choose what Firebase features

firebase-tools displays Firebase features you want to configure.

? Which Firebase features do you want to set up for this directory? Press Space 
to select features, then Enter to confirm your choices. (Press <space> to select
, <a> to toggle all, <i> to invert selection, and <enter> to proceed)
◯ Realtime Database: Configure a security rules file for Realtime Database and
(optionally) provision default instance
◯ Firestore: Configure security rules and indexes files for Firestore
◯ Functions: Configure a Cloud Functions directory and its files
◯ Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub
Action deploys
◯ Hosting: Set up GitHub Action deploys
(Move up and down to reveal more choices)

4. Connect your repo to a Firebase project

The CLI will then walk you through making sure your repo is configured with a Firebase project.

? Please select an option: 
◯ Use an existing project
◯ Create a new project
◯ Add Firebase to an existing Google Cloud Platform project
◯ Don't set up a default project