Port 8081

What’s running on port 8081 on my Mac?

8081 is Metro, the JavaScript bundler behind React Native and Expo. A Metro left over from another project is the most common reason a fresh npx expo start asks to use a different port.

Commonly used by

  • Metro (React Native CLI)npx react-native start runs the bundler on 8081.
  • Exponpx expo start serves Metro on 8081 too.
  • mongo-expressThe MongoDB web admin defaults to 8081, often via Docker.
  • Second web serverThe usual fallback when 8080 is already taken.

Check what’s on port 8081

lsof -nP -iTCP:8081 -sTCP:LISTEN
ps -o pid,etime,command -p <PID>

A node process with metro, react-native start or expo start in the command line is Metro. To see which app it’s bundling:

lsof -a -p <PID> -d cwd -Fn | tail -1

Metro also answers a status check:

curl http://localhost:8081/status

packager-status:running confirms it’s Metro and not something else on 8081.

With Stat Space: statspace port 8081.

Free it

kill <PID>

Metro is often started in a separate Terminal window by run-ios or run-android, so it outlives the build that opened it. If its parent is 1 (launchd), that window is gone. See finding orphaned Node processes.

Run it on another port

ToolCommand
React Native CLInpx react-native start --port 8082
Exponpx expo start --port 8082
Metro configserver: { port: 8082 } in metro.config.js
mongo-express (Docker)-p 127.0.0.1:8082:8081

For a React Native CLI app on Android, also forward the new port to the emulator or device: adb reverse tcp:8082 tcp:8082.

Who can reach it

Metro has to be reachable from your phone, so it listens on all interfaces. Anyone on the same Wi-Fi can download your app’s JavaScript bundle, including any API keys you’ve baked into it. That’s a good reason never to ship secrets in a React Native bundle, and to prefer USB debugging on public networks.

mongo-express is a different story: it’s a full database admin panel. Keep it on 127.0.0.1 with basic auth on. More in dev server exposed to the network.

Seeing it live

Stat Space lists 8081 with the project folder Metro is bundling, the launcher behind it and its uptime, so a Metro from yesterday’s project stands out. The row’s QR code opens the LAN URL on your phone.

Questions

Why does my app load an old bundle?

The simulator is talking to a Metro from another project that still holds 8081. Stop it, then restart Metro from the right folder with npx expo start --clear or npx react-native start --reset-cache.

How do I run Metro on a different port?

Use npx react-native start --port 8082 or npx expo start --port 8082. For React Native CLI builds, run the app with the same port, for example npx react-native run-ios --port 8082.

Why does Metro need my local network?

A physical phone loads the bundle from your Mac over Wi-Fi, so Metro listens on your LAN address. On shared networks, use a USB connection or a tunnel instead.

Get started

Know what your Mac is doing, without adding to it.

Free, no account. Pro is $9.99 once for the first 100 buyers.