Allow JupyterHub users to install their own JupyterLab extensions

Hello,

I’m wondering if there is a way for individual users logged in through JupyterHub to be able to install their preferred JupyterLab extensions from the JupyterLab extensions side panel? Currently when I try to do so I get 500-errors, which I suspect is from the user not being able to install to the path. Is there a way to have JupyterHub start an instance of JupyterLab from a users virtual environment?

Any help on this matter would be great.

Thanks,
Bobo

It should be possible, but it depends on how you’ve deployed and configured JupyterHub. For instance if you’re using DockerSpawner then each user gets their own container, optionally with a mounted persistent home directory.

Thank for the reply @manics!

I’m pretty novice to jupyterHub, so my setup is pretty vanilla at the moment, that is to say that my config file is the default one. JupyterHub is launched from systemd on boot, but none of the users who login are able to make any changes to JupyterLab extensions.

Does this help?

JupyterHub is very flexible, and there isn’t a “vanilla” install. Can you show us which instructions you followed to setup your JupyterHub?

@manics, understood.

I followed along:

The uncommented lines from my jupyterhub_config.py are:

c.JupyterHub.bind_url = 'http://:8888
c.Spawner.default_url = '/lab'

and the Systemd launcher configuration file looks like:

[Unit]

Description=JupyterHub
After=syslog.target network.target

[Service]

User=root
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/jupyterhub/bin"
ExecStart=/opt/jupyterhub/bin/jupyterhub -f /opt/jupyterhub/etc/jupyterhub/jupyterhub_config.py

[Install]
WantedBy=multi-user.target

As it currently stands, the system works, I am able to make virtual environments as a user, add the kernel and see it available when I log in via JupyterHub, but when I try to install an extension I am unable to do so (Error 500: Internal Server Error).

The effect I am looking for is to have JupyterHub launch a JupyterLab instance from the users environment where they have permission to install extensions as they please.

Many Thanks,

Bobo