Jupyterlab server extension on JupyterHub

Hey all!
I developed a jupyterlab extension which includes front end and server extension.
I tried to deploy this on Jupyterhub.
I ran
Jlpm run build
Jupyter labextension install .

However, im able to see only the UI element and the server api results in 404 not found. If I run jupyter server extension list, it shows the extension and enabled.

What am I missing here?
What is the best way to install a jupyterlab server extension on jupyterhub?

In general JupyterHub spawns a singleuser-server (JupyterLab), but after that it’s up to the application how it behaves. Configuration is usually in the singleuser-server’s environment rather than JupyterHub’s. For example, if you’re using DockerSpawner JupyterLab is configured inside the Docker singleuser image, there’s nothing to be done on the JupyterHub side.

1 Like

Thanks for the information.
I have an environment where 100+ users use the Hub.
How do I install a server extension for every user globally ? Is there any way to achieve this?

What does jupyter serverextension list show (please note no space), as in contrast to jupyter server extension list (with space)?

ah! jupyter serverextension list without the space does not list the extension, whereas with the space lists the extension!

how are these two different? and in the git repo with examples it includes the space to install. Am I missing something?

And, thanks for enlightening me that both are different commands

Long story short: jupyter serverextension list (no space) shows extensions enabled for the old notebook server, while jupyter server extension (with space) shows extensions enabled for the new jupyter-server. The extension may not load on your JupyterHub because - depending on version and configuration - it may use the old notebook server rather than the new jupyter-server.

If you are the developer of the extension you can make it backward compatible by adding the notebook extension config as in Add backward compatibility hook for notebook server by fcollonval · Pull Request #155 · jupyterlab/extension-cookiecutter-ts · GitHub or Add config for the classic notebook server extension by jtpio · Pull Request #504 · jupyter-lsp/jupyterlab-lsp · GitHub.

If this is a third-party extension and the author does not intend to support the old notebook server the way forward may be to configure JupyterHub to use the new jupyter-server. Please see JupyterLab 3.0 extensions with backend server extension do not start-up · Issue #3340 · jupyterhub/jupyterhub · GitHub for some hints if you are using JupyterHub < 2.0; according to the docs JupyterHub ≥ 2.0 should use jupyter-server by default (but I think it is still in release candidate as for today - see the other post in jupyterhub category if you wish to help testing it).

For an overview of differences and motivation for the migration to the new server see: What is the difference between `jupyter notebook` and `jupyter server`? - Stack Overflow


This was really very helpful! You are a superhero! Thanks!