ContextCleaner: see every entry in the Windows 11 right-click menu, and which app added it — on the Microsoft Store.
Engineering PortDetective

Firebase Emulator "Port 8080 Is Not Open on localhost" on Windows: Find What Holds the Port

Published November 27, 2026 Updated November 27, 2026 7 min read

When firebase emulators:start prints “Port 8080 is not open on localhost, could not start Firestore Emulator” and then “Could not start Firestore Emulator, port taken”, another process is already listening on that emulator’s port, very often a Java process left behind by an earlier emulator run. Find the owner before you change anything: Port Detective from Automata Labs shows which process holds 8080 (or 9099, 9000, 8085, 9199, 5001) on Windows, with its name and PID, plus the full executable path in Port Detective Pro, so you can close the right thing and start the emulators again.

See which process holds your Firebase emulator port before you restart the suite.

Get it fromMicrosoft

What does the error actually mean?

The message comes from the port check in the Firebase CLI (firebase-tools). Before an emulator starts, the CLI tests whether it can listen on the configured host and port. If the port is not free on the primary address and the emulator is not allowed to move, the CLI logs:

Port 8080 is not open on localhost, could not start Firestore Emulator.
To select a different host/port, specify that host/port in a firebase.json config file
Error: Could not start Firestore Emulator, port taken.

The same wording appears for other emulators, with their own port and name: “Authentication Emulator” on 9099, “Database Emulator” on 9000, “Pub/Sub Emulator” on 8085, “Storage Emulator” on 9199 and “Functions Emulator” on 5001. If the host resolves to more than one address, the CLI adds them in brackets, for example localhost (127.0.0.1,::1).

“Not open” here means “not available for the emulator to open”, not that a firewall blocked it.

Which emulators move to another port and which stop?

This is the detail that confuses most people: some emulators quietly pick the next free port, while others refuse to start. In the CLI source, the emulator UI, the hub, the logging emulator, Hosting and App Hosting look for an available port by default. Firestore, Realtime Database, Authentication, Functions, Pub/Sub, Storage and Extensions do not.

EmulatorDefault port (Firebase docs and CLI)If the port is taken
Emulator UI4000Moves to a free port; check the CLI log
Emulator hub4400Moves, with a warning such as “unable to start on port 4400, starting on 4401”
Hosting5000Moves to a free port
Cloud Functions5001Stops with “port taken”
Cloud Firestore8080Stops with “port taken”
Pub/Sub8085Stops with “port taken”
Realtime Database9000Stops with “port taken”
Authentication9099Stops with “port taken”
Cloud Storage9199Stops with “port taken”

So if your UI ended up on 4001 and Firestore refused to start, both symptoms can come from the same leftover run. Fixed ports are deliberate: your app and tests connect to them by number, so moving silently would point your SDK at nothing.

Why is port 8080 already taken on Windows?

The common causes, roughly in the order worth checking:

  • A previous emulator run that did not exit. The Firestore and Realtime Database emulators run as Java processes. If a terminal was closed, VS Code restarted, or a test runner was killed, java.exe can keep listening on 8080 or 9000 after the CLI has gone.
  • A second project’s emulators. Two repos with default firebase.json settings both want 8080, 9099 and 9000.
  • Another tool on 8080. 8080 is a popular default for local web servers, proxies and Java app servers, so something unrelated may own it.
  • emulators:exec started while emulators:start is still running. Both try to start the same emulators on the same ports.
  • Security software listening on localhost. A GitHub issue on firebase-tools describes an antivirus web shield holding connections on 8080. Treat this as a rare case and check the owning process rather than disabling protection.

Look up any port and get the owning process, PID and executable path in one step.

Get it fromMicrosoft

How do you find the process with Port Detective?

  1. Open Port Detective and type the port from the error, such as 8080.
  2. Read the owner. You get the process name, PID and connection state. A java.exe entry is usually the Firestore or Database emulator; Port Detective Pro also shows the full executable path and parent and child lineage, which tells you whether it came from the Firebase CLI, your IDE or something else.
  3. Decide what to stop. If it is a stale emulator, end it. Port Detective Pro does this in one click and checks a secure process token first, so a recycled PID cannot point the kill at the wrong program.
  4. Run firebase emulators:start again.
  5. Pin the ports you use. Pin 8080, 9099 and 9000 to the dashboard. With Pro, Port Guard can watch them from the tray and notify you when something else grabs one.

The Port Detective guide to ports already in use covers the same workflow for other dev servers.

How do you do it from the command line?

Built-in Windows tools work too. In PowerShell:

Get-NetTCPConnection -LocalPort 8080 -State Listen |
  Select-Object LocalAddress, LocalPort, OwningProcess
Get-Process -Id <PID>

Or in Command Prompt:

netstat -ano | findstr :8080
tasklist /FI "PID eq <PID>"
taskkill /PID <PID>

Check the process name before you run taskkill. A PID from netstat can be reused if the original process exits between the two commands; our post on the PID race when killing a process explains why. Many answers online suggest npx kill-port 8080, which ends whatever is listening without telling you what it was. That is fine when you already know it is your own emulator, and risky when it is not; we compare the options in npx kill-port vs portrm vs Port Detective.

When should you change the port in firebase.json instead?

If something else legitimately needs 8080, move the emulator. The Firebase docs show ports set per emulator in firebase.json:

"emulators": {
  "firestore": { "port": "8180" },
  "auth": { "port": "9099" },
  "ui": { "enabled": true, "port": 4001 }
}

You can also run firebase init emulators and accept or change the port prompts; the docs describe it as non-destructive. After a change, point the SDK at the new port, for example connectFirestoreEmulator(db, "127.0.0.1", 8180) in the web SDK, and update any FIRESTORE_EMULATOR_HOST environment variable your server code or tests use. The CLI may also warn when you choose a port that Chrome and other browsers restrict, and it suggests another one.

SituationBetter fix
A stale emulator from your last runEnd that process and restart
Two Firebase projects at onceGive one project its own ports in firebase.json
An unrelated app needs 8080Move Firestore to another port
It happens every dayPin the ports and find which tool keeps leaving processes behind

How do you stop it happening again?

  • Stop the emulators with Ctrl+C in the terminal that started them, and wait for “Shutting down emulators” to finish before closing the window.
  • If you keep test data with --export-on-exit, remember the export runs when the emulators shut down, which is one more reason to let them shut down properly.
  • Keep one emulator session per project, and prefer emulators:exec for test runs rather than starting a second suite next to a running one.
  • Check the port owner when the error appears instead of reaching for a blind kill.

Frequently asked questions

Why does the emulator UI start on 4001 but Firestore fails?

The UI, hub, logging and Hosting emulators are allowed to move to a free port, while Firestore and the other data emulators use fixed ports, so they stop with “port taken” instead.

Is “not open” a firewall problem?

Usually not. The CLI means it could not listen on that port because something already is. A firewall affects incoming connections from other machines, not whether a local port can be opened.

Is the java.exe on port 8080 safe to end?

If its path or command line shows the Firebase emulator jar from your own run, yes. If it belongs to another Java app, move the emulator instead.

Does Port Detective work with WSL or Docker?

It shows Windows processes and their ports. Port Detective Pro can also map host ports published by Docker back to the container and image.

Try Port Detective

Get Port Detective (Free) or Port Detective Pro from the Microsoft Store. Free has fewer features than Pro, and Pro offers a free trial on its listing. Both listings require Windows 10 version 17763.0 or higher.

Find the leftover emulator on 8080 and get the Firebase suite running again.

Get it fromMicrosoft

Port Detective is a product of Automata Labs. Firebase, Cloud Firestore and Chrome are trademarks of Google LLC. Java is a trademark of Oracle and/or its affiliates. Windows and PowerShell are trademarks of the Microsoft group of companies.

Last updated 27 November 2026. Published by Automata Labs, a software company in Canada.

// release_radar

Get notified about new releases.

We build native, local-first tools for professionals who refuse SaaS fatigue. Drop your email to hear about new apps, major updates, and zero-telemetry releases as they land on the Microsoft Store. No spam — just release news.