DEV Community

Will Ceolin
Will Ceolin

Posted on • Edited on

3 2

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

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

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?

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay