localhost:5000

Two big frameworks share port 5000: Flask (Python) and ASP.NET Core (.NET). If you're building Python web apps or .NET APIs, this is your default dev address.

Open localhost:5000

What Uses Port 5000?

FrameworkLanguage
FlaskPython
ASP.NET CoreC# / .NET
Docker RegistryContainer
AirPlay (Mac)System service

Flask Quick Start

# app.py
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello():
    return 'Hello, World!'

if __name__ == '__main__':
    app.run(debug=True)  # Runs on localhost:5000
# Run Flask
python app.py

# Or with flask command
flask run

ASP.NET Core

# Create new project
dotnet new webapi -o MyApi
cd MyApi
dotnet run

# Runs on http://localhost:5000 (HTTP)
# and https://localhost:5001 (HTTPS)

Change Flask Port

# In code
app.run(port=3000)

# Command line
flask run --port 3000

# Environment variable
export FLASK_RUN_PORT=3000

Mac: AirPlay Conflict

On macOS Monterey+, AirPlay Receiver uses port 5000. Fix:

  • System Preferences → Sharing → Disable "AirPlay Receiver"
  • Or use a different port: flask run --port 5001

Related Ports

PortCommon Use
8000Django, Python HTTP
3000Node.js, React
5432PostgreSQL