gcloud alpha firestore databases create

NAME
gcloud alpha firestore databases create - create a Google Cloud Firestore database via Firestore API
SYNOPSIS
gcloud alpha firestore databases create--location=LOCATION[--database=DATABASE; default="(default)"][--delete-protection][--edition=EDITION; default="standard"][--enable-firestore-data-access][--enable-mongodb-compatible-data-access][--enable-pitr][--enable-realtime-updates][--kms-key-name=KMS_KEY_NAME][--tags=[KEY=VALUE,…]][--type=TYPE; default="firestore-native"][GCLOUD_WIDE_FLAG]
EXAMPLES
To create a Firestore Enterprise database named foo in nam5 for use with MongoDBCompatible API with Data Access Mode enabled.
gcloudalphafirestoredatabasescreate--database=foo--edition=enterprise--location=nam5--enable-mongodb-compatible-data-access

To create a Firestore Enterprise database named foo in nam5 for use withFirestore API Data Access Mode enabled and Realtime Updates disabled.

gcloudalphafirestoredatabasescreate--database=foo--edition=enterprise--location=nam5--enable-firestore-data-access

To create a Firestore Enterprise database named foo in nam5 for use withFirestore API Data Access Mode enabled and Realtime Updates enabled.

gcloudalphafirestoredatabasescreate--database=foo--edition=enterprise--location=nam5--enable-firestore-data-access--enable-realtime-updates

To create a Firestore Native database innam5.

gcloudalphafirestoredatabasescreate--location=nam5

To create a Firestore Native database inus-central1 with tags.

gcloudalphafirestoredatabasescreate--location=us-central1--tags=key1=value1,key2=value2

To create a Datastore Mode database inus-east1.

gcloudalphafirestoredatabasescreate--location=us-east1--type=datastore-mode

To create a Datastore Mode database inus-east1 with a databaseIdfoo.

gcloudalphafirestoredatabasescreate--database=foo--location=us-east1--type=datastore-mode

To create a Firestore Native database innam5 with deleteprotection enabled.

gcloudalphafirestoredatabasescreate--location=nam5--delete-protection

To create a Firestore Native database innam5 with Point In TimeRecovery (PITR) enabled.

gcloudalphafirestoredatabasescreate--location=nam5--enable-pitr

To create a Firestore Native database innam5 encrypted by aCustomer-managed encryption key (CMEK).

gcloudalphafirestoredatabasescreate--location=nam5--kms-key-name=projects/PROJECT_ID/locations/us/keyRings/KEY_RING_ID/cryptoKeys/CRYPTO_KEY_ID
REQUIRED FLAGS
--location=LOCATION
The location to operate on. Available locations are listed athttps://cloud.google.com/firestore/docs/locations.

For example, to operate on locationus-east1:

gcloudalphafirestoredatabasescreate--location='us-east1'
OPTIONAL FLAGS
--database=DATABASE; default="(default)"
The ID to use for the database, which will become the final component of thedatabase's resource name. If database ID is not provided, (default) will be usedas database ID.

This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ withfirst character a letter and the last a letter or a number. Must not beUUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.

Using "(default)" database ID is also allowed.

--delete-protection
Whether to enable delete protection on the created database.

If set to true, delete protection of the new database will be enabled and deleteoperations will fail unless delete protection is disabled.

Default to false.

--edition=EDITION; default="standard"
The edition of the database.EDITION must be one of:standard,enterprise.
--enable-firestore-data-access
Whether to enable Firestore API Data Access on the created database.

If set to true, Firestore API Data Access on the new database will be enabled.By default, this feature is disabled for Enterprise edition databases. Toexplicitly disable, use --no-enable-firestore-data-access.

--enable-mongodb-compatible-data-access
Whether to enable MongoDB Compatible API Data Access on the created database.

If set to true, MongoDB Compatible API Data Access on the new database will beenabled. By default, this feature is enabled for Enterprise edition databases.To disable, use --no-enable-mongodb-compatible-data-access.

--enable-pitr
Whether to enable Point In Time Recovery (PITR) on the created database.

If set to true, PITR on the new database will be enabled. By default, thisfeature is not enabled.

--enable-realtime-updates
Whether to enable Realtime Updates feature on the created database.

If set to true, Realtime Updates feature on the new database will be enabled. Bydefault, this feature is disabled for Enterprise edition databases. Toexplicitly disable, use --no-enable-realtime-updates.

--kms-key-name=KMS_KEY_NAME
The resource ID of a Cloud KMS key. If set, the database created will be aCustomer-Managed Encryption Key (CMEK) database encrypted with this key. Thisfeature is allowlist only in initial launch.

Only a key in the same location as this database is allowed to be used forencryption. For Firestore's nam5 multi-region, this corresponds to Cloud KMSlocation us. For Firestore's eur3 multi-region, this corresponds to Cloud KMSlocation europe. Seehttps://cloud.google.com/kms/docs/locations.

This value should be the KMS key resource ID in the format ofprojects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.How to retrieve this resource ID is listed athttps://cloud.google.com/kms/docs/getting-resource-ids#getting_the_id_for_a_key_and_version.

--tags=[KEY=VALUE,…]
Tags to attach to the destination database. Example:--tags=key1=value1,key2=value2

For example, to attach tags to a database:

$ --tags=key1=value1,key2=value2

--type=TYPE; default="firestore-native"
The type of the database.TYPE must be one of:firestore-native,datastore-mode.
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
This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudfirestoredatabasescreate
gcloudbetafirestoredatabasescreate

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 2026-01-13 UTC.