Port 8888

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.

Commonly used by

  • Jupyter Notebook / JupyterLabjupyter lab and jupyter notebook serve on localhost:8888, then 8889, 8890…
  • Netlify Devnetlify dev proxies 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
COMMANDTool
python3.x / PythonJupyter
nodeNetlify Dev
java or CharlesCharles Proxy

For Jupyter, the quickest answer is its own list:

jupyter server list

With Stat Space: statspace port 8888.

Free it or change it

ToolStopUse another port
Jupyterjupyter server stop 8888jupyter lab --port 8899
Netlify DevCtrl-Cnetlify dev --port 8899, or port under [dev] in netlify.toml
CharlesQuit the appProxy › 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 localhost and requires a token. Keep both.
  • --ip=0.0.0.0 puts 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.

Get started

Know what your Mac is doing, without adding to it.

Free, no account. Pro is $9.99 once for the first 100 buyers.