Installing Jupyter over SSH

Follow along with the video here: Installing Jupyter Notebook over SSH at brickbox.io - YouTube

In this short demo, we will demonstrate how to install Jupyter on a brickbox.io instance and connect to it via an SSH tunnel.

Like all things Python, there are countless ways to do this. We opted to go for the most basic, simplistic way, using pip as our package manager and a basic SSH tunnel for connectivity.


First, we want to start an instance
image

Next, we want to connect to the instance using our unique SSH address and port.


Once connected, we will want to update the package list:
apt-get update

After the package list is updated, we need to install the python pip package manager:
apt-get install python3-pip


With pip installed, we’re ready to install Jupyter Notebook:
pip install jupyterlab

Once pip completes the installation process and Jupyter is installed, start a Jupyter notebook:
jupyter-lab --allow-root
Note: we add the --allow-root flag as we are the root user on the brickbox instance.

Once Jupyter is running, the terminal will output an address with a unique token


Next, we want to open a new terminal and create our SSH tunnel:
ssh -NL 8888:localhost:8888 root@vm.brickbox.io -p 1040

Finally, visit the address provided by Jupyter (include the unique token!) in the browser and enjoy access to your Jupyter Notebook!