Home / Localhost / localhost:4040

localhost:4040 (ngrok, Spark UI): not working and fixes

Port 4040 is used by the ngrok inspector and the Apache Spark web UI. How to open it and fix errors.

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

localhost:4040 shows the ngrok request inspector while an ngrok tunnel is running, and the Apache Spark web page while a Spark application is running. If nothing is running, the page will not open.

localhost:4040 in a browser address bar reaches port 4040 on your computer, where ngrok inspector, Spark UI is running

What runs on localhost:4040

Commands to start and test port 4040

Start an ngrok tunnel
ngrok http 3000
Open the inspector
http://127.0.0.1:4040

Find what is using port 4040

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

If localhost:4040 will not open

What the ngrok inspector shows
Open http://localhost:4040 on the same computer. ngrok’s docs say it lists each request with time, duration, source IP, headers, query parameters, request and response bodies (JSON and XML are formatted), and lets you filter them. Replay resends a request straight to your local service, and Replay with Modifications lets you edit it first. /status shows endpoint configuration and traffic. It works for HTTP endpoints only.
This site can’t be reached (ERR_CONNECTION_REFUSED)
The server is not running. Start it and keep that terminal open. See the full checklist.
Spark: the page is on port 4041
When 4040 is busy, Spark uses the next ports. Check the terminal output for the right address.
Port 4040 is already in use
Another program is on port 4040. Find it with the tool below and stop it, or start yours on another port.

Other ports like 4040

PortUsually used by
localhost:11434Ollama (AI models)
localhost:5601Kibana
localhost:11501Khajane 2 helper (reported)
localhost:9200Elasticsearch
localhost:5672RabbitMQ
localhost:15672RabbitMQ admin page
localhost:9090Prometheus

Questions about localhost:4040

What runs on localhost:4040?
The ngrok inspector while ngrok runs, or the Spark UI while a Spark application runs.
Is localhost:4040 safe?
Yes while it stays on localhost. Tools like this often show sensitive data, so keep them off the public internet and put a login in front of them if other people can reach the port.

Updated 2026-10-20

Free tools that help

Related pages