Running Jupyter Notebook on Research IT Servers at Iowa State

Page

Jupyter Notebook is an application that runs in your web browser that allows you to develop, document, and execute code. Here's how to get up and running with Jupyter Notebook on Research IT computers like rit1, rit2, speedy, and so on.

In this tutorial I'll be connecting to speedy from my Mac.

I am going to use two Terminal windows. In one, I will connect to speedy using ssh:

Logging in

Once connected, load python:

Loading python module

Then start jupyter notebook. Pass a couple of options, too. Since we are in a terminal session, we do not want jupyter to try to open a web browser on the server. We'll do that ourselves in a moment. Therefore, we pass the --no-browser option.

Jupyter is also going to want to listen to a port. I've chosen 9998 for this port. You can also leave this off and let Jupyter choose a port for you. So the command to start juypter notebook is:

jupyter notebook --no-browser --port 9998

Starting juypter notebook

Hooray! Juypter is now running, waiting for connections. But the research IT machines don't just accept connections from anyone. To get around that, I will use a second terminal window on my computer to create an ssh tunnel from my computer to the server.

What this means is, I will connect to port 9998 on my own machine and it will tunnel through my ssh connection and actually connect to port 9998 on speedy.

Tunneling a connection

Super!

Now I'll open a web browser on my computer and go to http://localhost:9998/?token=7e848dff55a1ca9a72b6f6e261582f653d74b127075... and presto, I have connected to jupyter notebook, and I'm looking at my home directory on speedy.

Note that your link will be different as jupyter generates a different random token each time.

Jupyter in browser

When you have finished using Jupyter Notebook, close your tunnel by typing Control-C into your second terminal window, and then stop the jupyter notebook server by typing Control-C into your first terminal window.

Category: