This guide explains how to run a Jupyter Notebook on a department server and access it from your browser. The steps differ depending on
whether the server has a public IP address or not.
Servers without public IP addresses (Turing, Kepler, Ada, Ampere, Neumann)
These servers require SSH tunneling through a public-facing server. Turing is used as an example here — replace it with the server you
are using.
- SSH into Tesla (a public-facing server).
- From Tesla, SSH into Turing.
-
Create a conda environment on Turing and activate it.
Read instructions
-
Install Jupyter:
conda install jupyter
-
Start the notebook:
jupyter notebook --no-browser --port=8889 --ip=0.0.0.0
- You will see a token in the output. Copy it.
-
On your local machine, open WSL (Windows) or Terminal (Linux/Mac) and set up an SSH tunnel:
ssh -N -f -L localhost:8888:turing.ce.pdn.ac.lk:8889 YOUR_USERNAME@tesla.ce.pdn.ac.lk
-
Open your browser and go to
http://localhost:8888
. Paste the token when prompted.
Servers with public IP addresses (Tesla, Aiken)
These servers can be accessed directly. Tesla is used as an example here.
- SSH into Tesla.
-
Create a conda environment and activate it.
Read instructions
-
Install Jupyter:
conda install jupyter
-
Start the notebook:
jupyter notebook --no-browser --port=8080 --ip=0.0.0.0
-
You will see a URL like
http://SOMETHING:8080/tree?token=abc123def456
-
Open your browser and go to
http://tesla.ce.pdn.ac.lk:8080/tree?token=abc123def456
(replace the token with yours).
NOTE:
If you are accessing Tesla from outside the university network, you will need to set up a SSH tunnel to Tesla to get access to a local
port.