'How to run a jupyter notebook through a remote server on local machine?

I have a remote access to remote server from my university and I'm accessing it through my local machine! However, my local machine has not enough memory to run multiple jupyter notebooks. Is there any way to run them through the remote server, which probably speed up tasks!! I'm not quite sure though!

I access the server from the terminal in macOS. Thanks!!



Solution 1:[1]

There's quite a good tutorial here

Essentially you just run the notebook on the remote in no browser mode.

jupyter notebook --no-browser --port=8080

Then setup up an ssh tunnel:

ssh -L 8080:localhost:8080 <REMOTE_USER>@<REMOTE_HOST>

Then in your local browser go to: http://localhost:8080/

EDIT:

Running on a specific port is not necessary. The --no-browser tag is.

Solution 2:[2]

I think you might be looking for port-forwarding.

e.g. when you're logged into your remote via ssh you can:

  1. On the remote machine, start jupyter notebook from your current directory and specify the port:

    jupyter notebook --no-browser --port=9999
    
  2. On the local machine, catch the forwarded port:

    ssh -NfL localhost:9999:localhost:9999 your_user_name@remote_ip_address
    
  3. Go to http://localhost:9999. You should be able to select your notebook and you'll be good to go.

Solution 3:[3]

you can run jupyter notebook --no-browser --ip="<remote server ip>" on your remote machine terminal. And access notebooks using http://:8888/?token=<> from your browser on local machine.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 nihilok
Solution 2 double-beep
Solution 3 Janhavi D