Using DockerSpawner with The Littlest JupyterHub
The Littlest JupyterHub (TLJH) is a simple distribution of JupyterHub - that is, a nice easy standardised way to run your own JupyterHub server on a single machine, with a lot of the config taken care of for you.
One thing currently missing as standard is the option to use Docker for your individual users’ Jupyter servers. Work continues to automate this, but for now here are the instructions for getting it running.
You need the Docker daemon to be installed and running on the server. When you installed TLJH, you should have seen some instructions for connecting to your server by SSH. Do that, and enter these four command lines:
If you want to understand these commands in more detail, please see this guide.
Next, we need to install a component called DockerSpawner (used by JupyterHub to start individual users’ Jupyter servers within Docker containers).
Tell TLJH to use DockerSpawner
Then add some config to TLJH telling it to use DockerSpawner.
If you are comfortable using the vi text editor, create this new config file:
and paste the following contents:
Alternatively, to avoid using vi, just run this command instead:
Download the Docker image
To avoid waiting the first time you start a Jupyter server, ideally you should ‘pull’ the server image that we are using, just so it’s ready in advance:
Reload TLJH with the new config
To restart TLJH, run:
And that’s it! Hopefully this will become even simpler if a plugin is developed to do all of this in one simple tljh-config command.
Please get in touch if you have any questions about this.