DEV Community

Will Ceolin
Will Ceolin

Posted on • Edited on

Running multiple instances of the Firebase Emulator

When doing local development using the Firebase Emulator, it might be useful to run multiple instances of the emulator.

For example, I like to keep one instance of the emulator running for interactive development and another one for running my automated tests in the background.

You can run another instance of the emulator by passing a different configuration file using the --config file:

firebase emulators:exec --project testing --config="./firebase.test.json" 'jest'
Enter fullscreen mode Exit fullscreen mode

Then, make sure to change the default ports in your firebase.test.json file:

{
  "emulators": {
    "auth": {
      "port": 9098
    },
    "functions": {
      "port": 5002
    },
    "firestore": {
      "port": 8081
    },
    "database": {
      "port": 9001
    },
    "pubsub": {
      "port": 8086
    },
    "ui": {
      "enabled": true,
      "port": 4001
    }
}
Enter fullscreen mode Exit fullscreen mode

That will allow you to run two instances of the Firebase Emulator at the same time.


Follow me on Twitter

Top comments (1)

Collapse
 
victor_palologue_d90dbe9 profile image
Victor Paléologue

How about the storage emulator?
Did you manage to run two of them?
It appears that you cannot change the port it listens to.
Or did I miss anything?