NextFire main logoNextFire
Docs X
Introduction
Get Started
Clone repo
Run the app
Configuration
Firebase
Create firebase app
Authentication
Firestore
Storage
Functions
Global configuration
Public
Site config
Payments
Stripe
One time
Subscriptions
Webhooks
Usage
Project structure
Static pages
Public pages
Protected pages
Auth
Client auth
Server auth
Data fetching
Firestore client
Firestore admin
Functions
Storage
Content
Blog
Documentation
Components
Markdown
Cards
Diagrams
Filetree
Lists
Maths
Notes
Steps
Table
Tabs
Public
Deep
Deeper
Even deeper
  1. Firebase
  2. Firestore

Enable Cloud Firestore (DB)

Step-by-step guide to setting up and configuring Firestore in Firebase Console.

In this section, you’ll enable Cloud Firestore in your project. We’ll walk through creating your database, adding data, and securing it with rules — all inside the Firebase Console.


1

Open Your Firebase Project

  1. Go to https://console.firebase.google.com.
  2. Select the project where you want to enable Firestore.
2

Navigate to Firestore

From the left-hand menu:

  1. Click “Create” → “Firestore Database”.
  2. You’ll arrive at the Firestore overview page.

Firestore Database Section (Add screenshot: Firebase console showing Firestore Database option under Build)

3

Create a Firestore Database

  1. Click “Create database”.
  2. Choose your security rules mode:
    • Start in production mode — best for live apps (locked by default).
    • Start in test mode — open for development and testing.
  3. Click Next.

Create Firestore Database Screen (Add screenshot: Firestore create database popup with security rules options)

4

Choose Your Database Location

  1. Select a Cloud Firestore location (for example: us-central, europe-west).

    ⚠️ This can’t be changed later — choose carefully!

  2. Click Enable to create your Firestore instance.

Select Firestore Location Screen (Add screenshot: Firestore location selection dropdown)

5

Review and Edit Security Rules

  1. Click the “Rules” tab at the top of the Firestore dashboard.

  2. You’ll see default rules like:

    rules_version = '2';
    service cloud.firestore {
      match /databases/{database}/documents {
        match /{document=**} {
          allow read, write: if false;
        }
      }
    }
    
    
  3. For now, we can just allow authenticated users to write, adjust later as needed

          allow read: if true;
          allow write: if request.auth.uid != null;
    

Note:

If not already done, you need to update your DATABASE_URL in your .env.example file

DATABASE_URL=project-id.firebaseio.com
AuthenticationStorage

Content

FeedbackEdit page

© 2025 Ship IT.

Rubix Studios logo