A forgotten Jupyter Notebook session can keep a local port busy and leave kernels running after the browser tab is closed. Stopping the underlying Jupyter Server clears the listener and shuts down the kernels attached to that server.
Notebook 7 runs on Jupyter Server, so jupyter server list shows the active local server records and jupyter server stop stops one record by port. When the original foreground terminal is still open, Control-C is enough; the port-based stop is for a separate shell, a closed terminal, or a port conflict.
Match the port and notebook root before stopping anything, especially when several Notebook sessions are open. Treat tokenized URLs as secrets because the token printed by the list output grants access to the running session.
Steps to stop a running Jupyter Server:
- Open a terminal as the same user that started Jupyter Notebook.
Jupyter Server runtime records are user-specific. A different account may show an empty list even while another user's server is still running.
- List the running Jupyter Server instances.
$ jupyter server list Currently running servers: http://127.0.0.1:8898/?token=<token> :: /srv/notebooks
Match the port and notebook root before stopping a server. Do not share the real tokenized URL from this output.
- Stop the server on the matching port.
$ jupyter server stop 8898 [JupyterServerStopApp] Shutting down server on 8898...
Replace 8898 with the port shown by jupyter server list for the session you want to close.
- List running servers again and confirm the stopped port is absent.
$ jupyter server list Currently running servers:
Other entries can remain when separate Notebook sessions are still running. Stop only the ports that belong to sessions you intend to close.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.