Get started using Firebase with an existing Google Cloud project

A Firebase project is a Google Cloud project that has some additional Firebase-specific configurations and services enabled. This is commonly called "adding Firebase" to a Google Cloud project. This page describes how to "add Firebase", along with some frequently asked questions (FAQs).

When you add Firebase to a Google Cloud project, Firebase automatically enables several APIs and creates service accounts to simplify the use of all Firebase services and interfaces. Firebase also adds a firebase:enabled label to your project within the Labels page of the Google Cloud console. Learn more details about what happens when you "add Firebase".

Relationship between a Firebase project and a Google Cloud project

Since a Firebase project is a Google Cloud project:

  • You can access and interact with the project in the Firebase console as well as in the Google Cloud console and Google APIs console.

  • You can interact with the project using the Firebase CLI, the gcloud CLI, and any Terraform resource from Google.

  • You can use products and APIs from both Firebase and Google Cloud in the project.

  • IAM permissions and roles for the project are shared across Firebase and Google Cloud. Any access a project member (that is, a principal) has to your Google Cloud project will also apply to your Firebase project (and vice-versa).

  • Billing for the project is shared across Firebase and Google Cloud. If billing is enabled on your Google Cloud project, then your Firebase project will be on Firebase's pay-as-you-go Blaze pricing plan.

  • Unique identifiers for the project (like project number and project ID) are shared across Firebase and Google Cloud.

  • Any resource hierarchy applied to your Google Cloud project (for example, organization, folders, etc.) will also apply to your Firebase project.

  • Deleting the project deletes it across Firebase and Google Cloud.

  • Deleting or modifying a resource or data within the project applies across Firebase and Google Cloud.

How to add Firebase to an existing Google Cloud project

You can "add Firebase" to an existing Google Cloud project using any of the following options. Make sure that you have the required permissions to add Firebase to the Google Cloud project.

Be aware that once you "add Firebase" to an existing Google Cloud project, it can't be undone (that is, you can't fully "remove Firebase" from the Google Cloud project). Learn more in this FAQ.

Firebase console

  1. Go to the Firebase console.

  2. Sign in with the same Google Account that allows you to access the existing Google Cloud project.

  3. Click Create a project.

  4. At the bottom of the page, click the link for Already have a Google Cloud project?

  5. In the text field, start entering the project ID of the existing project, and then select the project from the displayed list.

  6. Click Open project.

  7. If prompted, accept the Firebase Terms.

  8. Follow the on-screen instructions to "add Firebase" and set up a Firebase project.

    Note that enabling Google Analytics is optional.

Firebase CLI

  1. If you haven't already, install the Firebase CLI.

  2. Log in with the same Google Account that allows you to access the existing Google Cloud project.

  3. Run the following command:

    firebase projects:addfirebase
  4. When prompted, select the existing Google Cloud project from the displayed list.

  5. If you haven't already accepted the Firebase Terms, open a Firebase project in the Firebase console to accept the Terms. Learn more about the requirement for Firebase Terms in this FAQ.

REST API

  1. Enable the Firebase Management API in the existing Google Cloud project.

  2. Generate your API access token.

  3. Enable Firebase services for the project by calling projects.addFirebase.

    Note that you'll need the resource name of your project to make this call.

  4. If you haven't already accepted the Firebase Terms, open a Firebase project in the Firebase console to accept the Terms. Learn more about the requirement for Firebase Terms in this FAQ.

For detailed instructions, see Add Firebase services to your project in the Firebase guide: "Set up and manage a Firebase project using the Management REST API". Make sure to follow all the instructions in the Before you begin section of that guide.

Terraform

  1. Enable the Firebase Management API (firebase.googleapis.com) in the existing Google Cloud project.

  2. Enable Firebase services for the project using the google_firebase_project resource.

  3. If you haven't already accepted the Firebase Terms, open a Firebase project in the Firebase console to accept the Terms. Learn more about the requirement for Firebase Terms in this FAQ.

For detailed information about using Firebase and Terraform, see Get started with Terraform and Firebase.

FAQs and troubleshooting

Next steps

  • Check out the following resources for learning more about Firebase projects:

    • Understand Firebase projects — provides brief overviews of several important concepts about Firebase projects, including their relationship with Google Cloud and the basic hierarchy of a project and its apps and resources.

    • General best practices for setting up Firebase projects — provides general, high-level best practices for setting up Firebase projects and registering your apps with a project so that you have a clear development workflow that uses distinct environments.

  • Get started using Firebase in your mobile and web apps by registering your apps with your Firebase project and connecting them to Firebase: iOS+ | Android | Web | Flutter | Unity | C++.