Accessing a Remote Jupyter Notebook Server
Suhas Somnath
Advanced Data and Workflows Group
National Center for Computational Sciences
Oak Ridge National Laboratory
10/9/2017
The guides below walk you through setting up the port-tunneling to access a Jupyter Notebook server running on a remote machine at port 8889. For the sake of simplicity, we will assume that the Jupyter server is running on a virtual machine on CADES Cloud.
The same instructions can be used for connecting to other remote severs such as a TensorBoard server.
Windows:
Win Setup
This guide assumes that you have already followed CADES' instructions to set up basic SSH access using PuTTY
and have saved the configuration (such as JupyterVM
, in this example).
- Open
PuTTY
from theStart
menu. -
Under
Load, save, or delete a stored session
, select your saved configuration and then clickLoad
. You should see the value inside theHost Name (or IP address)
box at the top change and reflect the address for your remote machine. -
On the left-hand pane (
Category
), Go toSSH
→Tunnels
-
Set the following:
1. `Source port`: `8889` 2. `Destination`: `127.0.0.1:8889`
3. Click on the `Add` button. You should see the following under `Forwarded ports`:
-
Go back to
Session
on the left-hand pane. Highlight the name of the configuration (JupyterVM
in this case) underSaved Sessions
. and click on theSave
button. -
You can verify that the tunneling settings have been saved by:
- Closing PuTTY
- Reopening PuTTY
- Loading the configuration
JupyterVM
- Navigating to
SSH
→Tunnels
- The line containing the port forwarding should still be there.
- If it is not, re-do the appropriate steps above.
Win Access
Once you start the Jupyter server correctly on your remote machine:
1. Open PuTTy
2. Select the correct configuration (JupyterVM
in this case)
3. Click Load
. You should see the IP address update in the box at the top.
4. Click on the Open
button in the bottom. You will be presented with a new SSH connection to the VM. You can close this if you do not need it.
5. Open a browser and go to: http://localhost:8889/
MacOS
Mac Setup
- Open the
Terminal
application and go toShell
→New Remote Connection
- Click on the
+
icon under the right-hand column (Server
). -
Type:
-N -L localhost:8889:localhost:8889 cades@172.22.3.50
. Replace the IP address with that of your machine. ClickOK
.
Mac Access
Once you start the Jupyter server correctly on your remote machine:
- Open the
Terminal
application and go toShell
→New Remote Connection
- Click on the correct configuration on the right-hand pane
- Click on the
Connect
button shown above to establish the connection with your Jupyter server.
You will be presented with a newTerminal
window once you click onConnect
. Closing this terminal window will cause the connection to your Jupyter server to terminate. Therefore, close this terminal only when you want to close the port forwarding. - To reestablish the connection to your Jupyter server, just follow steps 1-3.