# macOS: Address already in use — Port 5000 is in use by ControlCenter (AirPlay Receiver)

**Code:** `Port 5000/7000 already in use (AirPlay Receiver)` · **Category:** macOS · **Seen on:** macOS

Since macOS Monterey the AirPlay Receiver listens on ports 5000 and 7000, colliding with dev servers like Flask or Docker registries.

## Meaning

Turn off System Settings → General → AirDrop & Handoff → AirPlay Receiver, or run your service on another port. `lsof -i :5000` shows `ControlCenter` as the owner. Common with Flask (5000) and Rails/others on 7000.

## Common causes

- AirPlay Receiver enabled (default)
- Flask default port 5000
- Docker registry/other services on 5000
- Another app on 7000
- Multiple dev servers

## Quick fix

1. Disable AirPlay Receiver in System Settings
2. Use another port: `flask run -p 5001`
3. Check: `lsof -nP -iTCP:5000 -sTCP:LISTEN`

## Detailed fix by platform

### macOS

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

## How to diagnose

1. **Owner** — ControlCenter?
2. **Setting** — AirPlay Receiver on?
3. **Alternative** — Different port?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/macos/port-5000-airplay-receiver)
