What’s running on port 8888 on my Mac?
If 8888 is busy, it’s most likely a Jupyter server you forgot about. Netlify Dev and Charles Proxy use it too, and each needs a different fix.
Updated
Commonly used by
- Jupyter Notebook / JupyterLab
jupyter labandjupyter notebookserve on localhost:8888, then 8889, 8890… - Netlify Dev
netlify devproxies your framework’s server and serves it on 8888. - Charles ProxyThe HTTP debugging proxy listens on 8888 by default.
Check what’s on port 8888
lsof -nP -iTCP:8888 -sTCP:LISTEN
COMMAND | Tool |
|---|---|
python3.x / Python | Jupyter |
node | Netlify Dev |
java or Charles | Charles Proxy |
For Jupyter, the quickest answer is its own list:
jupyter server list
With Stat Space: statspace port 8888.
Free it or change it
| Tool | Stop | Use another port |
|---|---|---|
| Jupyter | jupyter server stop 8888 | jupyter lab --port 8899 |
| Netlify Dev | Ctrl-C | netlify dev --port 8899, or port under [dev] in netlify.toml |
| Charles | Quit the app | Proxy › Proxy Settings › HTTP Proxy port |
Jupyter doesn’t fail when 8888 is taken; it moves to 8889 and up. So a list of several servers usually means old ones are still running, each holding a Python kernel and its memory. To make Jupyter use a fixed port, set c.ServerApp.port = 8899 in ~/.jupyter/jupyter_server_config.py.
With Netlify Dev, 8888 is the proxy, not your app. Your framework still runs on its own port (targetPort), such as 5173 or 3000, so you’ll see two listeners.
Security: Jupyter runs code
A Jupyter server is a remote shell with a web UI. Anyone who can reach it and has the token can run any command as you.
- By default it binds to
localhostand requires a token. Keep both. --ip=0.0.0.0puts it on your network. Combined with--NotebookApp.token=''or--IdentityProvider.token='', it’s open to anyone on the same Wi-Fi.- Tokens appear in the terminal and in
jupyter server list. Treat them like passwords.
Check with lsof: 127.0.0.1:8888 is right. More in dev server exposed to the network.
Seeing it live
Stat Space lists each Jupyter server on 8888 and above with its working folder and uptime, so a week-old notebook server is easy to find, and it warns if one is bound to 0.0.0.0.
Questions
How do I see which Jupyter servers are running?
Run jupyter server list (or jupyter notebook list on older versions). It prints each server's URL, token and folder.
How do I stop a Jupyter server I can't find the terminal for?
Run jupyter server stop 8888, or find the PID with lsof -nP -iTCP:8888 -sTCP:LISTEN and kill <PID>.
Why does my browser lose internet when port 8888 is closed?
Charles or another proxy may still be set as your system proxy. Quit Charles normally so it restores your settings, or check System Settings › Network › your connection › Details › Proxies.
Know what your Mac is doing, without adding to it.
Free, no account. Pro is $9.99 once for the first 100 buyers.