Many times when running Jupyter notebooks I find myself wishing for a quick clean mechanism to cleanly shutdown &/or restart the server without having to go to the command window that it is running in and hit control-C and without the risk of not having saved and shutdown all kernals that may be running at the time.
Giving it some thought this feature needs a mechanism for disabling &/or hiding it on Jupyter servers that the user should not be able to shutdown or as a configuration item that on a specific machine this is enabled or not so that on a server the configuration would, _normally_, be no shutdown/restart entries - _possibly with the command line option of starting a server with them enabled for testing_ - but on a personal machine the option could be set to enable them, and possibly to hide the command window.
I think we can consider that covered by jupyterhub:

Which is reasonable to use even on a local machine.
Though it will not warn you if you have multiple notebook/kernels running.
@Carreau I suspect that many users would find running jupyterhub a little intimidating - certainly at work I only use Jupyter a part of the time so would not wish to have the hub running all of the time.
I do think it makes sense to have a way to shut down notebook servers besides interrupting them in a terminal. Nbmanager is one tool I wrote to do this. It probably needs some updates by now to work with Jupyter, but that should be easy enough if anyone's interested.
@GadgetSteve : We're doing a little housekeeping on our issue log and noticed this thread from 2016. Did you try nbmanager and were you able to find a solution to your issue? Please let us know! We'll close this issue if you found what you need. thanks!
@JamiesHQ : Thanks for pointing out nbmanager but I would have expected server shutdown to be a part of the core functionality of Jupyter rather than an external utility, or using Control-C in the shell/command window.
@takluyver : It is helpful that nbmanager shows the users currently running notebooks - I wonder if it wouldn't be possible to hook it into a button next to the jupyter logout, (with it defaulting to the current server selected).
We've also recently added a jupyter notebook stop <portno> command - #2388.
@takluyver so from another terminal, or a desktop shortcut, I can effectively send a control-c to the running server? That does help in the case where a server has been started without a terminal window to press control-c in but still means leaving the Jupyter UI.
Yup. I think I actually tried to add a 'shutdown server' button years ago when the notebook was quite new, but people didn't want it. Maybe it would be more welcome now. It goes to the tension between the notebook as a local application and as a web server.
@GadgetSteve : @gnestor is leading the classic notebook development these days. Copying him here. Thanks!
This is relevant for us – we currently run Jupyter notebook instances through SGE (actually inside Docker containers), and it would be nice to be able to shut down those notebook servers through the web front end, rather than issuing a qdel to terminate them.
/api/shutdown. I haven't tried to build UI for it yet.+1 on a shutdown UI, especially for local use. Beginners often are unfamiliar with using the terminal, and get confused why they need to close/quit two things (experience gathered at the occasion of large classes or training workshops).
As an aside, with such a UI, one often could just hide that terminal (e.g. if jupyter is started through an icon).
+1 for the shutdown in the UI as a nice to have.
My need is as well for a local use.
It might been put it as an option, disabled by default. In this way persons who really need it , will activate it in the options.
Ok it looks like there's some demand for this feature so see https://github.com/jupyter/notebook/pull/3004 for an implementation 👍

Looking forward to the next Jupyter release :-)
Thank you guys!
Most helpful comment
+1 on a shutdown UI, especially for local use. Beginners often are unfamiliar with using the terminal, and get confused why they need to close/quit two things (experience gathered at the occasion of large classes or training workshops).
As an aside, with such a UI, one often could just hide that terminal (e.g. if jupyter is started through an icon).