How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts

How to Install the Littlest JupyterHub (TLJH) on Debain 11/12 and Ubuntu 20.04 LTS/22.04 LTS

The Littlest Jupyter Hub (TLJH) is a Jupyter Hub distribution. The main goal of this project is to make it easy to set up Jupyter Hub for a small number of users (100 users at most) on a single server. TLJH allows the users to use Jupyter Lab in their own isolated environment.

In this article, we will show you how to install The Littlest Jupyter Hub (TLJH) on Debian 11, Debian 12, Ubuntu 20.04 LTS, and Ubuntu 22.04 LTS operating systems. We will also show you how to access Jupyter Hub, create new TLJH users, and manage the TLJH user sessions. We will show you how to install the new Python libraries for all TLJH users as well.

Topic
of Contents:

  1. Installing the Dependency Packages for TLJH
  2. Installing The Littlest Jupyter Hub (TLJH)
  3. Checking If TLJH Is Working
  4. Accessing TLJH
  5. Creating TLJH Users and Managing the TLJH User Sessions
  6. Installing Python Libraries for All Jupyter Hub Users
  7. Conclusion
  8. References

Installing the Dependency Packages for TLJH

First, update the APT package database cache with the following command:

$ sudo apt update

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 105

To install the required dependency packages for Jupyter Hub, run the following command:

$ sudo apt install python3 python3-dev python3-pip git curl

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 106

To confirm the installation, press “Y” and then press .

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 107

The dependency packages are being downloaded. It takes a while to complete.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 108

The dependency packages are being downloaded. It takes a while to complete.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 109

The dependency packages should be installed on your Ubuntu/Debian machine at this point.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 110

Installing The Littlest Jupyter Hub (TLJH)

Before you install TLJH on your Ubuntu/Debian machine, you have to find the username of the user that you want to configure as a TLJH administrator. Usually, you will configure the login user of your Ubuntu/Debian machine as a TLJH administrator unless you have something else in mind. You can configure any user as TLJH administrator depending on your requirements.

See also  How to Install Sublime Text 4 Editor on Ubuntu

You can find the username of your login user with the following command:

$ whoami

In our case, the login user name is “shovon”.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 111

To install TLJH on your Ubuntu/Debian machine, run the following command:

$ curl -L https://tljh.jupyter.org/bootstrap.py | sudo -E python3 – –admin $(whoami)

NOTE: We are configuring our login user as TLJH administrator. If you want to configure some other user as TLJH administrator, replace –admin $(whoami) with –admin in the previous command.

TLJH is being installed on your Ubuntu/Debian machine. It takes a while to download and install all the TLJH components.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 112

At this point, TLJH should be installed on your Ubuntu/Debian machine.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 113

Checking If TLJH Is Working

To verify that TLJH is working on your computer, check first whether the TLJH proxy service traefik is working with the following command:

$ sudo systemctl status traefik.service

As you can see, the traefik proxy service is running and it’s configured to automatically start on system boot.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 114

Also, check whether the JupyterHub service is working with the following command:

$ sudo systemctl status jupyterhub.service

As you can see, the JupyterHub service is also running and it’s configured to automatically start on system boot.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 115

As the traefik proxy and JupyterHub “systemd” services are running correctly, The Littelest Jupyter Hub (TLJH) is working just fine.

Accessing TLJH

To access TLJH from a web browser, you need to know the IP address (or DNS name if configured) of your Ubuntu/Debian machine. In our case, the IP address is 192.168.189.128. It might be different for you. So, make sure to replace it with yours from now on.

$ ip a

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 116

Open a web browser app and visit http://192.168.189.128 and you will see the JupyterHub login page.

See also  How to Assign Multiple IP Addresses to Single NIC in Ubuntu 20.04 LTS

Type in your admin username, your desired login password (that you want to set for the admin user of JupyterHub), and click on “Sign in”.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 117

You should be logged in to JupyterHub.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 118

Creating TLJH Users and Managing the TLJH User Sessions

To create new TLJH users, log in to JupyterHub as the admin user and click on File > Hub Control Panel.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 119

Click on “Admin”.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 120

All the TLJH users and user sessions/hubs should be listed.

Click on “Add Users”.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 121

Type in the usernames that you want to add to TLJH[1]. You can add a single user or multiple users to TLJH at once. To add multiple users to TLJH, type in each username in a separate line.

If you want the newly created users to have administrative access to TLJH, tick on “Admin”[2].

Once you’re done, click on “Add Users”[3].

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 122

The new TLJH users should be created[1].

From the “Admin” page, you can manage (Start/Stop) the TLJH user sessions/hubs for each user[2] and all users[3].

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 123

To log in as one of the TLJH users, type in the username and the password that you want to set for the new user and click on “Sign in”.

NOTE: The password that you use to log in for the first time will be set as the login password for the new user.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 124

You should be logged in to JupyterHub as the new user.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 125

The TLJH admin user can see the users who are logged in to TLJH and manage the user sessions/hub.

See also  Canonical provides the ideal platform for Microsoft Azure IoT Operations

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 126

Installing the Python Libraries for All Jupyter Hub Users

Each TLJH user can install any Python libraries with Python PIP from their Jupyter Hub session. But to save the disk space, you can install the most commonly used Python libraries system-wide so that all Jupyter Hub users can access them without needing to reinstall them.

First, log in to TLJH as the admin user and click on “Terminal” from the “Launcher” tab.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 127

To install the matplotlib Python library (let’s say) for all TLJH users, run the following command:

$ sudo -E pip3 install matplotlib

Matplotlib is being installed. It takes a while to complete.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 128

At this point, the matplotlib Python library should be installed for all TLJH users.

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 129

To check whether other TLJH users can use the matplotlib Python library, login as one of the TLJH users, create a new Jupyter Notebook, and run the following lines of codes (that we copied from the matplotlib documentation):

import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4])
plt.ylabel(‘some numbers’)
plt.show()

If the TLJH user can access matplotlib, the code should generate a graph as shown in the following screenshot:

How to install the littlest jupyterhub (tljh) on debain 11/12 and ubuntu 20. 04 lts/22. 04 lts 130

Conclusion

In this article, we showed you how to install The Littlest Jupyter Hub (TLJH) on Debian 11, Debian 12, Ubuntu 20.04 LTS, and Ubuntu 22.04 LTS operating systems. We also showed you how to access TLJH from a web browser, create new TLJH users, and manage the TLJH user sessions. We showed you how to install the new Python libraries for all TLJH users as well.

References:


Discover more from Ubuntu-Server.com

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply