# JupyterHub Configuration Guide

{% hint style="success" %}
31/1/2023 I just the Littlest Jupyter Hub which is much easier to set up
{% endhint %}

## The TLJH

I decided that I will use the TLJH for my Security Team's Jupyter Hub after I read the documentation and did some lab with it (<https://tljh.jupyter.org/en/latest/>)

My Goal is to set up a Jupyter Hub for my team so that they can <mark style="color:yellow;">share their Jupyter notebook</mark> and also I can manage the Analyst that is <mark style="color:yellow;">actively crafting notebooks and making use of it.</mark>

The TLJH has something called the **TLJH Installer** which is small and easy to configure (You can read that in the documentation)

## Basic Configuration

{% hint style="info" %}
I use a VM that runs Ubuntu 18.04 to host this JupyterHub Server with a storage of 70GB  and 4GB of RAM
{% endhint %}

Using this command to download the installer and set up my version of JupyterHub, the user environment will include:&#x20;

* pandas
* matplotlibs
* networkx
* pyvis
* voila
* And a shared directory

{% code overflow="wrap" lineNumbers="true" %}

```bash
curl -L https://tljh.jupyter.org/bootstrap.py \
    | sudo python3 - \ --admin admin --show-progress-page \
    --user-requirements-txt-url https://raw.githubusercontent.com/https://raw.githubusercontent.com/Zeroska/tljh-user-env-requirement/main/requirement.txt
    --plugin git+https://github.com/kafonek/tljh-shared-directory --plugin git+https://github.com/Zeroska/tljh-voila-gallery@master
```

{% endcode %}

These will get you up and running but if you don't like the environment you can change the requirement or the shared folder's name&#x20;

## More Configuration

After the basic configuration, you might want to configure how the user will log in, and which port should we expose, I write a script that automates those stuff for you

{% code lineNumbers="true" %}

```bash
#/bin/bash
$PORT = 8888

echo "Start the Configuration"
sudo tljh-config set http.port ${PORT} # Set the port which you connected to
sudo tljh-config reload proxy 

```

{% endcode %}

&#x20;Summary the script will do these things:

* Expose port 8888 for the user to connect via IP Address
* Setup the Authentication (The user will change the password when login for the first time) which is set up by default (you have to go to this path \<your\_server\_ip>/hub/auth/change-password) to change your password

## Conclusion

Running this to help my team take notes and do data analysis is wonderful. Combine it with VLAN Monitoring you got yourself an interactive documentation.
