running a ipython Notebook on AWS

I recently started using iPython notebooks …they are so cool! (http://ipython.org/notebook.html)… but it took some finagling to figure out how to get an ipython Notebook running on an AWS. I struggled with this some as my data was on an AWS server  and while I could “run” the ipython notebook on the server, I could not “view” it on my local browser ! My AWS server was on a VPC and setting up a profile_nbserver did not work.

Its a really neat hack:  the basic idea is that you use the AWS default settings (ie configuration from/home/ubuntu/.ipython/profile_default), not any particular  profile_nbserver setting (which is what the tutorials ask you to do.)  Essentially you  you want to  run the  ipython notebook loaclly on the AWS server and mirror it on your local machine. From what I understand, we are remote port forwarding, ie transferring a remote (AWS)  connection to your machine.

So after installing ipython on your AWS server;

  • On the AWS machine terminal run:  
    • ipython notebook  – this runs the the default configuration (not ipython notebook inline –profile=nbserver )
    • on your local machine type:                                                                                                                                                     ssh -L 9000:localhost:8888 ubuntu@ec2-xx-xx-xx-xx.us-west-1.compute.amazonaws.com (or whatever                                      your server public DNS name is) – oh and of course make sure you have a public IP address!
    • open your favorite browser and go to                                                                                                                                        http://localhost:9000/

and  Voila!! enjoy!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s