19

Jupyter notebook comes with the useful command:

jupyter notebook list

which outputs all the running server instances for the current user. Besides it lists the relevant access tokens.

Jupyter lab seems not to have this feature.

Cruising through the jupyter lab manual I could not find the analogous command (not the analogous syntax seems to work).

Any suggestion on how to get ports and tokens for the running servers?

Acorbe
  • 8,367
  • 5
  • 37
  • 66

3 Answers3

19

If you are using JupyterLab 3.0+, the command you're looking for is:

jupyter server list
krassowski
  • 13,598
  • 4
  • 60
  • 92
abdallahrrrr
  • 206
  • 2
  • 2
11

It seems like you can still call jupyter notebook list within any terminal to list all the running notebook instances, including those within jupyter lab.

TYZ
  • 8,466
  • 5
  • 29
  • 60
  • 7
    Not in my case... list shows empty... maybe different versions? I'm sure however that the server is running. Thanks though. – Acorbe May 30 '18 at 16:05
  • @Acorbe I'm running jupyter==1.0.0 and jupyterlab==0.31.12 as a reference. – TYZ May 30 '18 at 16:07
2

One can now use the list command with Jupyter lab to show running servers:

jupyter lab list

If you want to list the associated sessions for that server there doesn't appear to be built-in command but (as mentioned here) you can run this to a get prettified (with jq) JSON list using the Jupyter REST API - assuming your server runs at localhost:8888 and :

curl -sSLG localhost:8888/api/sessions --data-urlencode `jupyter lab list | awk '/token/ {split($1,a,"?")} END {print a[2]}'`  | jq
Pierz
  • 7,064
  • 52
  • 59