localhost:7860 (Gradio, Stable Diffusion): not working and fixes
Port 7860 is the default for Gradio apps and the Stable Diffusion web UI. How to open it, and fix refused to connect and port in use.
Open this address: http://localhost:7860This opens on your own computer. It only works if the program is running.
localhost:7860 opens the web page of a Gradio app. This includes the Stable Diffusion web UI, which uses Gradio.
What runs on localhost:7860
- Gradio apps (default port 7860)
- Stable Diffusion web UI (AUTOMATIC1111)
- Many local AI demos built with Gradio
Commands to start and test port 7860
./webui.sh --listendemo.launch(server_port=7861)sudo ss -tlnp | grep :7860Find what is using port 7860
Run these in a terminal on your computer. Nothing is sent to this site.
If localhost:7860 will not open
- Connection refused
- The app is not running or is still loading its model. Wait for the “Running on local URL” line in the terminal.
- Port 7860 busy
- Gradio tries the next free ports when none is set. Otherwise stop the old app or set
server_port. - Cannot open it from another device
- Start with
--listen(Stable Diffusion web UI) orserver_name="0.0.0.0"(Gradio). - A public link appears
- The share option creates a public internet link. Leave it off unless you want that.
- The Stable Diffusion web UI never reaches the Running line
- The first start downloads files and loads a model, which can take several minutes. Wait for
Running on local URL: http://127.0.0.1:7860. If it ends with an error, read the last red lines: missing Python packages, a wrong Python version and not enough graphics memory are the usual causes. - Out of graphics memory
- Add launch options in webui-user (COMMANDLINE_ARGS), for example
--medvramor--lowvram, then restart. Smaller images also use less memory. - Gradio in Docker is not reachable
- Inside a container Gradio must listen on all addresses. Set
GRADIO_SERVER_NAME=0.0.0.0and publish the port with-p 7860:7860. - Change the port without editing code
- Set the environment variable
GRADIO_SERVER_PORT=7861, or passserver_porttolaunch(). - VPN or proxy interferes
- Turn the VPN off, or add
localhost,127.0.0.1to your no-proxy setting, then reload the page.
Other ports like 7860
| Port | Usually used by |
|---|---|
| localhost:3000 | React, Next.js, Express |
| localhost:5173 | Vite dev server |
| localhost:4200 | Angular dev server |
| localhost:5000 | Flask |
| localhost:8000 | Django, PHP, Python |
| localhost:8080 | Tomcat, Spring Boot, Docker |
| localhost:8888 | Jupyter Notebook |
Questions about localhost:7860
- What is localhost:7860?
- The default address of Gradio apps and the Stable Diffusion web UI.
- Is the share link safe?
- It makes your app reachable from the internet. Only use it when you understand that.
- Can I use the web UI from another computer?
- Yes, if you start it with
--listenand open your computer’s IP address with :7860 from the same network. Do not expose it to the internet without a password.