gcloud emulators firestore start

NAME
gcloud emulators firestore start - start a local Firestore emulator
SYNOPSIS
gcloud emulators firestore start[--database-mode=DATABASE_MODE][--export-on-exit=EXPORT_ON_EXIT][--host-port=HOST_PORT][--import-data=IMPORT_DATA][--licenses][--rules=RULES][GCLOUD_WIDE_FLAG]
DESCRIPTION
This command starts a local Firestore emulator.
EXAMPLES
To start the local Firestore emulator, run:
gcloudemulatorsfirestorestart

To bind to a specific host and port, run:

gcloudemulatorsfirestorestart--host-port=0.0.0.0:8080

To run the local Firestore emulator with a Firebase Rules set, run:

gcloudemulatorsfirestorestart--rules=firestore.rules

To run the local Firestore emulator in Datastore Mode, run:

gcloudemulatorsfirestorestart--database-mode=datastore-mode

To import data at the start of the Firestore emulator, run:

gcloudemulatorsfirestorestart--import-data=<path/to/file>

To export emulator data upon emulator shutdown, run:

gcloudemulatorsfirestorestart--export-on-exit=<path/to/directory>
FLAGS
--database-mode=DATABASE_MODE
The database mode to start the Firestore Emulator in. The valid options are:
`firestore-native`(default):starttheemulatorinFirestoreNative`datastore-mode`:starttheemulatorinDatastoreMode
--export-on-exit=EXPORT_ON_EXIT
Directory path in which emulator data will be saved upon shutdown.Example:/home/user/myexports/2024-03-26/
--host-port=HOST_PORT
The host:port to which the emulator should be bound. Can take the form of asingle address (hostname, IPv4, or IPv6) and/or port:
[ADDRESS][:PORT]

In this format you must enclose IPv6 addresses in square brackets: e.g.

[2001:db8:0:0:0:ff00:42:8329]:8080

The default value is localhost:8080.

--import-data=IMPORT_DATA
File path to the data to be loaded into the emulator upon start up.Example:/home/user/myexports/sampleExport/sampleExport.overall_export_metadata.
--licenses
If set, the emulator will print open-source dependencies and licenses, thenexit.
--rules=RULES
If set, all projects will use the security rules in this file. More informationon Firebase Rules and the syntax for this file is available athttps://firebase.google.com/docs/rules.
GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

NOTES
These variants are also available:
gcloudalphaemulatorsfirestorestart
gcloudbetaemulatorsfirestorestart

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-22 UTC.