Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run ipython notebook from a remote server

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.

like image 406
Ben Avatar asked Jun 30 '14 12:06

Ben


1 Answers

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

like image 152
Ben Avatar answered Oct 16 '22 08:10

Ben