Ben
Ben

Reputation: 1301

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.

Upvotes: 5

Views: 11379

Answers (2)

kotrfa
kotrfa

Reputation: 1331

As Monkpit wrote below, your shell might try to glob * character. In that case you should write --ip=\*- Explicitly adding ip address to localhost also helped:

 ipython notebook --no-browser --ip=localhost  --port=7777

Upvotes: 4

Ben
Ben

Reputation: 1301

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

Upvotes: 18

Related Questions