---
title: "Port 5000 in use on Mac: AirPlay Receiver and ControlCenter · Kilobat Guides"
url: "https://kilobat.app/guides/airplay-receiver-port-5000"
description: "On macOS 12 and later, AirPlay Receiver listens on ports 5000 and 7000. Find it with lsof, then move your dev server or turn AirPlay Receiver off."
---

Developers

# Port 5000 or 7000 is in use on a Mac: AirPlay Receiver

Apple lists TCP ports 5000 and 7000 for AirPlay. When AirPlay Receiver is on, a dev server cannot use these ports.

Applies to: macOS 12 Monterey and later. The setting is in General > AirDrop & Handoff, or AirDrop & Continuity in newer versions. · Checked: 29 October 2026

## Symptoms

- A Flask or other dev server on port 5000 stops with “address already in use”.
- `lsof` shows `ControlCenter` on port 5000 or 7000.
- `curl localhost:5000` returns a reply that is not from your app.

## Likely causes

- **AirPlay Receiver.** AirPlay Receiver lets other Apple devices stream to the Mac. Apple lists ports 5000 and 7000 for AirPlay.
- **Another server.** If the process is not ControlCenter, another app uses the port. See [Port already in use on a Mac](https://kilobat.app/guides/port-already-in-use).

## How to check

1. Find the process on port 5000.

   ```
   lsof -nP -iTCP:5000 -sTCP:LISTEN
   ```

   Output A line with `ControlCenter` in the COMMAND column means AirPlay Receiver.
2. Find the process on port 7000.

   ```
   lsof -nP -iTCP:7000 -sTCP:LISTEN
   ```

## How to fix it

1. The easiest fix is to use another port for your dev server, such as 5001 or 8000.
2. To free the ports, choose Apple menu > System Settings > General > AirDrop & Handoff. Newer versions call it AirDrop & Continuity.
3. Turn off AirPlay Receiver.
4. On macOS 12, the setting is in System Preferences > Sharing > AirPlay Receiver.
5. Run lsof again to make sure that the port is free.

   ```
   lsof -nP -iTCP:5000 -sTCP:LISTEN
   ```

## Questions

**Can I keep AirPlay Receiver on?**

Yes. Run your server on another port. You need to turn off AirPlay Receiver only if the app must use port 5000 or 7000.

**Why does the server work on Linux on port 5000?**

AirPlay Receiver is a macOS feature. Other systems do not use this port for it.

## Sources

- [Apple Support: TCP and UDP ports used by Apple software products](https://support.apple.com/en-us/103229)
- [Apple Support: Change AirDrop & Continuity settings on Mac](https://support.apple.com/guide/mac-help/mchl6a407f99/mac)
- lsof(8), man page installed with macOS 27.2

Sources checked on 29 October 2026. Man pages are the ones installed with macOS; open one with `man <name>` in Terminal.

## Related guides

- [Port already in use on a Mac](https://kilobat.app/guides/port-already-in-use): Only one process can listen on a TCP port and address.
- [Cannot reach a Docker container from the Mac](https://kilobat.app/guides/docker-container-from-mac): Docker on a Mac runs containers in a Linux virtual machine.
- [A container cannot reach localhost on the Mac](https://kilobat.app/guides/localhost-from-container): Each container has its own network stack.
- [An app cannot find devices on the local network](https://kilobat.app/guides/local-network-permission): macOS 15 Sequoia and later ask before an app connects to devices on your local network.
