Deploy Firebase Emulator Suite

A self-hosted Firebase emulator suite with core services and web UI.

Deploy Firebase Emulator Suite

Just deployed

/data

Deploy and Host Firebase Emulator Suite on Railway

Firebase Emulator Suite provides local emulators for core Firebase services, allowing applications to be developed and tested without connecting to production Firebase resources.

This deployment includes Authentication, Cloud Firestore, Realtime Database, Cloud Storage, and the Firebase Emulator Suite web UI.

About Hosting Firebase Emulator Suite

Firebase Emulator Suite runs as a single Railway service with the following emulators:

  • Authentication
  • Cloud Firestore
  • Realtime Database
  • Cloud Storage
  • Emulator Suite UI

The emulators use their standard Firebase Emulator Suite ports and are available through Railway networking.

Persistent storage can be used to retain emulator snapshots across supported restarts and redeployments.

No PostgreSQL, Redis, MySQL, MongoDB, or real Firebase account is required.

Common Use Cases

  • Develop Firebase applications without using production Firebase services
  • Test Authentication flows
  • Test Firestore reads, writes, queries, and security rules
  • Test Realtime Database integrations
  • Test Cloud Storage integrations
  • Run integration tests and CI workflows
  • Create isolated Firebase development environments
  • Share a reusable Firebase testing environment with a development team

Dependencies for Firebase Emulator Suite

This deployment requires:

  • Railway
  • Node.js
  • Java Runtime Environment
  • Firebase CLI
  • Firebase Emulator Suite
  • A Railway Volume for persistent emulator snapshots

No external database, cache, Firebase account, or Google Cloud project is required.

Included Emulators

ServicePort
Emulator Suite UI4000
Emulator Hub4400
Logging4500
Cloud Firestore8080
Realtime Database9000
Authentication9099
Cloud Storage9199

All emulator services bind to 0.0.0.0 so they can be reached through Railway networking.

Accessing the Web UI

The Firebase Emulator Suite UI is available on port 4000.

After generating a public Railway domain for this port, open the domain in your browser:

https://your-firebase-emulator.up.railway.app

From the UI, you can inspect supported emulator state, including:

  • Authentication users
  • Firestore documents
  • Realtime Database data
  • Storage data
  • Emulator logs

The public Railway domain is intended primarily for accessing the Emulator Suite UI.

Connecting Applications

Applications running inside the same Railway project can connect to the individual emulators using Railway private networking.

For a service named firebase-emulator-suite, the endpoints would look similar to:

Authentication:
firebase-emulator-suite.railway.internal:9099

Firestore:
firebase-emulator-suite.railway.internal:8080

Realtime Database:
firebase-emulator-suite.railway.internal:9000

Storage:
firebase-emulator-suite.railway.internal:9199

Use the appropriate endpoint for each Firebase SDK or Google Cloud client that connects to the emulators.

Persistent Emulator Data

Emulator state can be persisted using a Railway Volume mounted at:

/data

The deployment exports emulator state during graceful shutdown and stores the resulting snapshot in the persistent volume.

On startup:

  1. The service checks for an existing Firebase export.
  2. Existing snapshot metadata is validated.
  3. A valid snapshot is imported automatically.
  4. If no snapshot is available, the emulators start with a fresh environment.

On graceful shutdown:

  1. Firebase Emulator Suite exports its state to a temporary directory.
  2. The export is validated.
  3. The previous snapshot is backed up temporarily.
  4. The new snapshot is copied into the persistent volume.
  5. Export metadata is committed last.
  6. The previous snapshot is removed after the new snapshot is validated.

This process preserves the mounted volume while updating the emulator snapshot safely.

Persistence Limitations

Persistence depends on Firebase Emulator Suite receiving a graceful shutdown signal.

Events such as:

  • abrupt container termination
  • infrastructure failure
  • forced termination before export completes

may prevent the latest emulator state from being exported.

When possible, the previously completed snapshot remains available as the recovery point.

Firebase Emulator Suite should still be treated as a development and testing environment rather than a production database.

Development Security Rules

This deployment includes permissive Firestore, Realtime Database, and Storage security rules so the emulators are immediately usable for development and testing.

These rules are not suitable for production.

Do not copy permissive emulator rules into a production Firebase project.

Public and Private Networking

The Emulator Suite UI is exposed publicly through port 4000.

Other emulator APIs remain available through their respective ports.

For applications deployed inside the same Railway project, Railway private networking is the recommended way to access:

  • Authentication
  • Firestore
  • Realtime Database
  • Storage

If external applications need direct public access to individual emulator APIs, additional networking configuration may be required.

What Is Not Included

This deployment does not enable:

  • Cloud Functions Emulator
  • Firebase Hosting Emulator
  • Pub/Sub Emulator
  • Eventarc Emulator

These services usually depend on application-specific source code or additional configuration and are better enabled in dedicated development environments.

Important Notes

  • Firebase Emulator Suite is intended for development and testing.
  • It is not a self-hosted replacement for production Firebase.
  • No real Firebase account is required.
  • No Google service account credentials are required.
  • No PostgreSQL, Redis, MySQL, or MongoDB service is required.
  • The Emulator Suite UI runs on port 4000.
  • Emulator state can persist through a Railway Volume mounted at /data.
  • Java-based Firebase emulators may require significant memory depending on workload.
  • Use the same Firebase project ID across all clients connecting to the emulators.

Why Deploy Firebase Emulator Suite on Railway?

Railway provides a managed platform for running infrastructure without requiring users to maintain servers or handle complex deployment configuration.

Deploying Firebase Emulator Suite on Railway provides a shared Firebase-compatible development environment for applications, CI pipelines, development teams, and test environments without requiring every user to run the Emulator Suite locally.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
47
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51