localhost:5000
Port 5000 is commonly used by lightweight local API servers and Flask-style development workflows.
Fast checklist
- 1 Start the local API server.
- 2 Open the root URL or the exact API route your code defines.
- 3 If the browser shows JSON, the service is responding.
- 4 If a frontend cannot call it, check protocol, port, route, and CORS settings.
Quick diagnostic checks
flask --app app run --port 5000Use your real app module name. If the command fails, fix the server startup error before debugging the browser.
http://localhost:5000/healthMany APIs do not serve a useful homepage at /. Check the route your backend actually defines.
lsof -i :5000If nothing owns port 5000, a frontend error is probably reporting an API that is not running.
Live request check
What this page sees
HTTP request headers
Sensitive headers such as cookies and authorization tokens are filtered before display.
API routes are not always homepages
A local API might not show a polished page at /. Try the documented endpoint, such as /api, /health, or /docs.
Frontend to API debugging
When a frontend on one port calls an API on another port, the browser treats them as different origins. That is where CORS configuration becomes important.
Related localhost guides
localhost:3000
Open localhost:3000, learn which development servers commonly use port 3000, and fix connection errors quickly.
Port guidelocalhost:8000
Use localhost:8000 for Python, Django, and local file servers, then check routes, port ownership, and refused connection errors.
TroubleshootingLocalhost not working
Use a practical localhost not working checklist for wrong URLs, stopped servers, port conflicts, HTTPS mistakes, and path problems.
Developer toolLocalhost Port Lookup
Look up common localhost ports, what they are usually used for, and which command can check if a port is busy.
FAQ
Why does localhost:5000 show JSON?
That usually means the server is an API rather than a regular website. JSON is a valid response for API routes.
Why can my frontend not call localhost:5000?
Check the exact URL and CORS policy. A frontend on localhost:3000 and an API on localhost:5000 are different origins.
What should I check first when this localhost port does not open?
Check whether the development server is still running, then copy the exact URL printed in the terminal. If the terminal shows a different port, use that port instead.
Can I replace localhost with 127.0.0.1 for this port?
Usually yes for browser testing on the same computer. If one works and the other fails, check host binding, IPv6 behavior, certificates, or your hosts file.
Why does the browser show a blank page or JSON on this port?
The service may be an API, a backend health route, or a server that does not serve a polished page at /. Try the documented path such as /api, /docs, /admin, or the route your framework prints.