PortGate

Resources · Port reference · port 8888

Port 8888 (Jupyter): what it is and how to secure it

Jupyter on port 8888 is a shell in a browser. Bind it to localhost and reach it through an SSH tunnel, with a token or password always set.

Check command

sudo ss -tlnp | grep ':8888 '

Copied.

Port 8888 is Jupyter's default. A Jupyter server can run any code as the user who started it, open a terminal, and read every file that user can read. Treat it like SSH: keep it on localhost and connect through a tunnel.

What port 8888 is for

Jupyter Notebook and JupyterLab serve their web interface on 8888. They are popular on GPU servers for machine learning, and many Docker images (such as the Jupyter Docker Stacks) start with -p 8888:8888.

Why an open 8888 is dangerous

  • Code execution is the feature. Anyone who reaches the interface and gets past the login can run commands on the server.
  • Tokens get turned off. Tutorials sometimes set an empty token or password to "make it easier". With --ip=0.0.0.0, that is an open shell on the internet.
  • Expensive hardware. Exposed Jupyter on GPU servers is a known target for cryptominers.

Check yours

sudo ss -tlnp | grep ':8888 '
jupyter server list 2>/dev/null || jupyter notebook list

0.0.0.0:8888 is public. From another machine, curl -sI http://YOUR_SERVER_IP:8888 returning anything means it is reachable.

Fix it

Start Jupyter on loopback (its default, unless something overrode it):

jupyter lab --ip=127.0.0.1 --port=8888 --no-browser

For Docker, publish on loopback only:

docker run -p 127.0.0.1:8888:8888 quay.io/jupyter/base-notebook

Then open a tunnel from your laptop and browse to http://localhost:8888:

ssh -L 8888:127.0.0.1:8888 you@your-server

Keep authentication on. Use the token Jupyter prints, or set a password with jupyter server password (older installs: jupyter notebook password). Never start it with an empty token.

If a team needs shared access, use JupyterHub behind HTTPS with real user accounts, not one public notebook server.

Check whether someone already got in

If the port was public without a token, assume it may have been used. Look for:

  • unknown processes using a lot of CPU or GPU (top, nvidia-smi), the usual sign of a cryptominer;
  • new files in the notebook folder, and new entries in crontab -l and ~/.ssh/authorized_keys for the user that ran Jupyter;
  • outgoing connections you do not recognise: sudo ss -tnp state established.

If you find any of these, rotate every key and password that user could read, and rebuild the server if you are not sure what was changed.

Common mistakes

  • --ip=0.0.0.0 --NotebookApp.token='' copied from a tutorial.
  • Running Jupyter as root.
  • Trusting UFW for a Docker-published port. Bind to 127.0.0.1 instead.

FAQ

Is the token enough? It stops casual access, but anything public is still scanned and attacked. The tunnel removes that exposure completely.

How do I get warned? PortGate's Server Guard alerts when 8888, or any new port, starts answering on a public address.