2
votes

How do I run and access iPython Notebook (in Docker on EC2) from the browser?

This is what I tried:

  • From EC2 Quick Start menu, selected Amazon Linux AMI 2015.03 on t2.micro instance.
  • Everything left as default, except 3 rules created for "Configure Security Group":

    • Type: "SSH"; Protocol: "TCP"; Port Range: "22"; Source: "Anywhere";
    • Type: "HTTPS"; Protocol: "TCP"; Port Range: "443"; Source: "Anywhere";
    • Type: "Custom TCP Rule"; Protocol: "TCP"; Port Range: "8888"; Source: "Anywhere";
  • After SSH'ing to instance:

    $ sudo yum install -y docker ; sudo service docker start
    
    $ sudo docker pull continuumio/miniconda # Anaconda includes iPython Notebook
    
    $ sudo docker run -it -p 8888:8888 continuumio/miniconda ipython notebook
    
  • Then launching browser to https://ec2-xx-x-x-xxx.compute-1.amazonaws.com:8888 didn't work.

1

1 Answers

-1
votes

I wouldn't be too comfortable opening 443 and 8888 on the Internet for my EC2 instances. My common setup is Anaconda on an Ubuntu box.

I usually ssh port forward my ipython notebook sessions to my localhost on my macbook with this ssh command:

ssh -i myPrivateSSHKey.pem [email protected] -L 8888:localhost:8888

Then I open Chrome and request URL:

http://127.0.0.1:8888