Friday, July 12, 2013

Run IPython notebook on remote server

This comes in very useful if you want to run your notebook on a remote machine (e.g. your data is on that machine, or the machine is a lot faster than your own). From hints here.
  1. Start ipython notebook on remote machine: ipython notebook --pylab inline --no-browser --port=7000 
  2. Setup tunneling on local machine: ssh -N -f -L localhost:7000:localhost:7000 login@the.remote.machine 
  3. Open up localhost:7000 on your browser


  1. Why is step #2 necessary? Can't one just access the remote server at http://the.remote.machine:7000/ directly? Isn't this too much trouble for the client?

  2. I'm not an expert on this aspect, but I believe you don't want to expose the port directly for security reasons. Hence the need for a tunnel.