Skip to content
statance
MenuClose
← All ports

Port 8888: Jupyter Notebook / JupyterLab

High risk

Port 8888 is the default for Jupyter Notebook and JupyterLab, which run Python and other code from a browser. It should not be reachable from the public internet.

Port
8888
Protocol
TCP
Service
Jupyter Notebook / JupyterLab
Expose to internet?
No
Also used by
Jupyter, some HTTP proxies, development servers

Is port 8888 safe to open?

Jupyter is remote code execution by design: anyone who can open a notebook can run commands as the user running Jupyter. It is protected by a token, but people disable it or run with an empty password to make access easier. Exposed notebooks are actively searched for and used to install miners.

How to secure Jupyter Notebook / JupyterLab

  • Keep token or password authentication on; never start it with an empty token.
  • Bind to localhost (--ip=127.0.0.1, the default) and use an SSH tunnel: ssh -L 8888:localhost:8888 user@host.
  • For teams, use JupyterHub behind TLS and single sign-on.
  • Do not run Jupyter as root.

Check if port 8888 is open

Linux: what is listening on this port

sudo ss -tlpn | grep ':8888 '

Windows (PowerShell): what is listening

Get-NetTCPConnection -LocalPort 8888 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}

From another machine: is it reachable

nc -zv HOST 8888 # or nmap -p 8888 HOST # Windows Test-NetConnection HOST -Port 8888

Test the Jupyter Notebook / JupyterLab service itself

curl -sI http://HOST:8888/api

Restrict port 8888 in the firewall

Replace 10.0.0.0/8 with the network or address that needs access. Docker publishes container ports through its own iptables rules, which bypass ufw; bind published ports to 127.0.0.1 (-p 127.0.0.1:8888:8888) instead of relying on the host firewall.

ufw: allow only your private network, deny everyone else

sudo ufw allow from 10.0.0.0/8 to any port 8888 proto tcp sudo ufw deny 8888/tcp

firewalld: allow one source network only

sudo firewall-cmd --permanent --remove-port=8888/tcp sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="8888" protocol="tcp" accept' sudo firewall-cmd --reload

iptables

sudo iptables -A INPUT -p tcp --dport 8888 -s 10.0.0.0/8 -j ACCEPT sudo iptables -A INPUT -p tcp --dport 8888 -j DROP

Windows Firewall (PowerShell, as Administrator)

New-NetFirewallRule -DisplayName "Block 8888 from internet" -Direction Inbound -Protocol TCP -LocalPort 8888 -RemoteAddress Internet -Action Block

Monitor port 8888

Run a TCP port monitor against your public IP on port 8888: here, a failed connection is the healthy result, so you know the firewall is still doing its job. On Linux, the Statance agent also reports every listening port on the server. TCP port monitoring.

Related ports

Port 8000HTTP alternate / development serversMedium risk
Port 5000Flask / Docker Registry / AirPlayMedium risk
Port 22SSHMedium risk

FAQ

What is port 8888 used for?

Port 8888 is the default for Jupyter Notebook and JupyterLab, which run Python and other code from a browser. It is also used by Jupyter, some HTTP proxies, development servers.

Is it safe to open port 8888?

Not to the public internet. Jupyter is remote code execution by design: anyone who can open a notebook can run commands as the user running Jupyter. It is protected by a token, but people disable it or run with an empty password to make access easier. Exposed notebooks are actively searched for and used to install miners.

Is port 8888 TCP or UDP?

Jupyter Notebook / JupyterLab uses TCP on port 8888.

How do I check if port 8888 is open?

On the server, run sudo ss -tulpn | grep ':8888 ' (Linux) or Get-NetTCPConnection -LocalPort 8888 (Windows) to see what is listening. From another machine, run nc -zv HOST 8888 or Test-NetConnection HOST -Port 8888.

All ports →

Know the moment a port stops answering.

TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.