Predictive Hacks

How to Close the Running Jupyter Notebook Servers

When you work on a server, let’s say the EC2, and you launch a Jupyter notebook, the notebook server will be running unless you close it from the GUI clicking on the “QUIT” button.

The first thing that we need to get the running jupyter notebook servers. We can get a list of the running servers by running the following command:

jupyter notebook list

And we get:

(base) ds@domain ~$ jupyter notebook list
Currently running servers: :: /home/ds :: /home/ds :: /home/ds :: /home/ds :: /home/ds :: /home/ds :: /home/ds :: /home/ds :: /home/ds :: /home/ds

You can easily open any running server by copy-paste the URL address to your browser.

We can close all the running servers by running the command:

pkill jupyter


pkill -9 jupyter

Since the running notebooks can belong to different users, if you want to close only the ones that you own you can run:

pkill -u `id -u` jupyter

Another approach could be to copy-paste the URL address and then close the server with QUIT button.

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore


Image Captioning with HuggingFace

Image captioning with AI is a fascinating application of artificial intelligence (AI) that involves generating textual descriptions for images automatically.


Intro to Chatbots with HuggingFace

In this tutorial, we will show you how to use the Transformers library from HuggingFace to build chatbot pipelines. Let’s