Use the emulator
The Google Cloud CLI provides a local, in-memory emulator for Cloud Bigtable, which you can use to test your application. Because the emulator stores data only in memory, it will not persist data across runs. It is intended to help you use Bigtable for local development and testing, not for production deployments.
You can use the emulator with all Bigtable client libraries.
The emulator does not provide administrative APIs to create or manage instances and clusters. After the emulator starts up, you can connect to it using any project and instance name to create tables and read or write data. The emulator doesn't support a secure connection.
Install and run the emulator
The two most common ways to run the emulator are by using the gcloud CLI and Docker. Choose the way that is appropriate for your application development and test workflow.
Update your gcloud CLI installation to get the latest features:
gcloud components update beta
Run the following command to start the emulator:
gcloud beta emulators bigtable start
If the emulator is not installed already, you will be prompted to download and install the binary for the emulator.
The emulator prints the host and port number where it is running.
By default, the emulator chooses
localhost:8086. To bind the emulator to a specific host and port, use the optional
--host-portflag, replacing [HOST] and [PORT]:
gcloud beta emulators bigtable start --host-port=[HOST]:[PORT]
Type Control-C to stop the emulator.
Make sure Docker is installed on your system and available on the system path.
Start the emulator:
docker run -p 127.0.0.1:8086:8086 --rm -ti google/cloud-sdk gcloud beta emulators bigtable start --host-port=0.0.0.0:8086
This command runs the emulator and maps the ports in the container to the same ports on your local host.
You can also use the emulator as part of your existing Docker Compose configuration (
For more information about Docker Compose, see Docker Compose Overview.
Use the client libraries with the emulator
BIGTABLE_EMULATOR_HOST environment variable to use the client libraries with the emulator:
Linux / macOS
When your application starts, the client library automatically checks for
BIGTABLE_EMULATOR_HOST and connects to the emulator if it is running.
BIGTABLE_EMULATOR_HOST is set, you can test the emulator by following the
hello world samples.
To stop the emulator, type Control-C, then unset
BIGTABLE_EMULATOR_HOST with the following command:
Java wrapper for the emulator
The Java wrapper bundles the built-in Bigtable emulator and provides a Java interface to write tests.
For more information about using the Java wrapper, see the GitHub repository.
The following documentation provide more information about the emulator Java packages:
The emulator supports all filters, except the
Sink limiting filter.
Issues related to the Bigtable emulator are tracked in the google-cloud-go GitHub repository, where you can file bug reports and feature requests or comment on existing issues.