localhost:5000: what runs on it and how to open it
Port 5000 is Flask’s default and clashes with AirPlay on macOS. How to open it and fix it.
Open this address: http://localhost:5000This opens on your own computer. It only works if the program is running.
localhost:5000 is the default address for Flask apps. On a Mac it often fails because AirPlay Receiver already uses port 5000.
What runs on localhost:5000
- Flask with
flask run - ASP.NET Core (older templates used 5000 for HTTP)
- macOS AirPlay Receiver, which listens on 5000 on macOS Monterey and newer
Commands to start and test port 5000
flask runflask run --port 5001python app.pyFind what is using port 5000
Run these in a terminal on your computer. Nothing is sent to this site.
If localhost:5000 will not open
- Address already in use on a Mac
- macOS AirPlay Receiver is using port 5000. Turn it off in System Settings, General, AirDrop & Handoff, or run Flask on 5001.
- Flask: command not found
- Activate your virtual environment first, and check Flask is installed with
pip show flask. - 404 Not Found
- The server runs but that URL has no route. Check the
@app.routepaths.
Other ports like 5000
| Port | Usually used by |
|---|---|
| localhost:3000 | React, Next.js, Express |
| localhost:5173 | Vite dev server |
| localhost:4200 | Angular dev server |
| localhost:8000 | Django, PHP, Python |
| localhost:8080 | Tomcat, Spring Boot, Docker |
| localhost:8888 | Jupyter Notebook |
| localhost:9000 | PHP-FPM, SonarQube |
Questions about localhost:5000
- Why is port 5000 in use on my Mac?
- On macOS Monterey and newer, AirPlay Receiver listens on port 5000. Turn it off in System Settings or use another port.
- How do I run Flask on a different port?
- Run flask run --port 5001, or call app.run(port=5001) in your script.
- Is localhost:5000 safe?
- Yes, as long as it stays on localhost. Only your own computer can reach localhost:5000. It becomes reachable from other devices only if you start the program on 0.0.0.0 or your computer's IP address. Development servers are for testing, so do not put them on the public internet.
- Can I use a different port instead of 5000?
- Yes. Most programs let you choose the port with a setting or a command option. Pick a free port above 1024 and open that number instead, for example localhost:5001.
- How do I check what is using port 5000?
- Use the port checker on this page. It shows the command for Windows, macOS and Linux and does not send anything to this site.
- Can I open localhost:5000 from my phone?
- Yes, if both are on the same Wi-Fi. Start the program so it listens on all addresses, then open your computer's IP address with :5000 on the phone. A firewall on the computer can still block it.
Free tools that help
- Common ports listSearch a list of common TCP and UDP port numbers: SSH 22, HTTP 80, HTTPS 443, MySQL 3306, PostgreSQL 5432 and more, with dev server ports.