Home / Localhost / localhost:8501

localhost:8501 (Streamlit): not working, port and fixes

Port 8501 is Streamlit’s default. How to open your app, change the port and fix errors.

Open this address: http://localhost:8501This opens on your own computer. It only works if the program is running.

localhost:8501 is the default address of a Streamlit app. It works while the streamlit command keeps running in your terminal.

localhost:8501 in a browser address bar reaches port 8501 on your computer, where Streamlit is running

What runs on localhost:8501

Commands to start and test port 8501

Start an app
streamlit run app.py
Use another port
streamlit run app.py --server.port 8502
Allow other devices on your network
streamlit run app.py --server.address 0.0.0.0

Find what is using port 8501

Run these in a terminal on your computer. Nothing is sent to this site.

If localhost:8501 will not open

Streamlit opens at 127.0.0.1 but not at localhost
server.address is unset by default. If you set it, Streamlit’s config reference says the server is reachable only at that address, not at aliases such as localhost. Use --server.address 0.0.0.0 for every address, or leave it unset.
The browser does not open by itself
server.headless is false by default, except on Linux with no display. When it is true Streamlit does not open a browser, so open the printed URL yourself. browser.serverAddress (default localhost) is the address Streamlit prints and uses for CORS and XSRF checks.
The app is stuck on “Please wait” behind a proxy
Streamlit talks to the browser over WebSockets. A reverse proxy such as Apache or nginx must pass WebSocket upgrade requests through, or the page never finishes loading.
Changes are not picked up
server.fileWatcherType accepts auto, watchdog, poll and none. Try poll on network drives or WSL. streamlit config show prints every setting in use.
Upload or form errors behind a proxy
server.enableCORS and server.enableXsrfProtection are both true by default. Behind a proxy with a different public address, set browser.serverAddress to that address before turning protections off.
Port 8501 is already in use
An older Streamlit app is still running. Stop it, or start the new one with --server.port 8502.
streamlit: command not found
Install it with pip install streamlit and activate the right Python environment.
Blank page
Read the terminal for Python errors. Streamlit shows them there and in the page.
Cannot open it from your phone
Use --server.address 0.0.0.0 and your computer’s IP address. See how to open localhost from your phone.

Other ports like 8501

PortUsually used by
localhost:3000React, Next.js, Express
localhost:5173Vite dev server
localhost:4200Angular dev server
localhost:5000Flask
localhost:8000Django, PHP, Python
localhost:8080Tomcat, Spring Boot, Docker
localhost:8888Jupyter Notebook

Questions about localhost:8501

What is port 8501?
The default port of Streamlit apps.
How do I run two Streamlit apps?
Start the second with a different port, such as --server.port 8502.

Updated 2026-10-20

Free tools that help

Related pages