Run ipython notebook from a remote server

Ben picture Ben · Jun 30, 2014 · Viewed 11.2k times · Source

I'm trying to run a ipython notebook from my remote server(Ubuntu 14.04 64 bits on Amazon EC2).

I can access to ipython notebook via ssh tunnelling as described in coderwall blog:

remote$ipython notebook --no-browser --port=8889

local$ssh -N -f -L localhost:8888:localhost:8889 remote_user@remote_host

However I can't have a simple access using http protocol as described in the official doc or this tutorial

remote$ipython notebook --no-browser --port=8889

And point my local browser to http://mypublicip:8889, the browser fails without any warning.

Answer

Ben picture Ben · Jul 1, 2014

To resolve this problem, I needed to:

  1. Run the notebook server listening on all IP addresses adding cli flag --ip=*:

    remote$ipython notebook --no-browser --ip=* --port=8889

  2. Add inbound rule to the amazon ec2 instance in order to listen to port 8889. +-----------------+----------+------------+-----------+ | Type | Protocol | Port Range | Source | +=================+==========+============+===========+ | Custom TCP Rule | TCP | 8889 | 0.0.0.0/0 | +-----------------+----------+------------+-----------+

Of course now it's better to add authentification as the port is listening to all ip adresses