Monday, 16 February 2015

Running an iPython Notebook Server on AWS - EC2 Instance

Updates:
7th January, 2016 - changes made according to new Anaconda distribution (v2.4.1) which contains Jupyter Notebook.
1st December, 2016 - changes made for adding keyfile in notebook config
Note: The update to the video tutorial is still in progress so please don't refer it for now. Once, I have updated it, I'll remove this note from here.


I hope everyone is familiar with the AWS (Amazon Web Services) and how to use iPython (Now Jupyter) Notebooks. If you are not familiar with Jupyter Notebook and you work with Python, then you are definitely missing a very important tool in you work. Please go through this video which is a short tutorial on iPython (Jupyter) Notebook.

OK, to begin with, I'll list all the steps to create an Jupyter Notebook Server on an EC2 Instance in a step-wise fashion. I have also created a Youtube Video for this post, which you can check it out here. (update in progress to the video. please don't refer it for now)

The reason for deploying Jupyter Notebook Server on AWS is to access all my Notebooks from anywhere in the World, just using my browser and also be able to work with them.

Enough of talking, let's begin:

1. Login to your Amazon Management Console. If you don't have an account yet, you can create one for it. You get 1 yr of free access to some of the services, which you can check out at this link

2. Create a new EC2 Instance with Ubuntu. If you are not familiar with how to create an EC2 instance, you can check out the video of this blog, in which I go through the steps from the beginning.

3. The important thing to remember while creating the instance is to assign the security group settings as mentioned in the image below


4. Launch your instance and ssh into it to perform the following operations
  • First of all we are going to use Anaconda Python Distribution for installing all the required Python libraries. This is a free distribution and we are going to use the Linux version of it. Remember to verify the latest version of the distribution from the site. This blog is updated to reflect the changes in the latest Anaconda distribution - 2.4.1.
    $ wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda2-2.4.1-Linux-x86_64.sh
       
  • Next we will bash to run this .sh file. You need to accept the license terms and set the installation directory for the anaconda distribution. I use the default one only, which is "/home/ubuntu/anaconda2/". Also, it asks you to add the default path of anaconda python to your .bashrc profile. You can accept to do it or add it manually.
    $ bash Anaconda2-2.4.1-Linux-x86_64.sh
       
  • Now you need to check, which python version you are using, just to confirm if we are using the one from Anaconda Distribution or not. You can do this by using
    $ which python
       
    This will list the python your system is currently using. If it does not mentions the one from ".../anaconda2/..." folder, then you can use the following command to re-load your .bashrc, so as to set the correct python
    $ source .bashrc
       
  • Open the iPython Terminal to get an encrypted password so as to use it for logging into our iPython Notebook Server. Remember to copy and save the output of this command, which will be an encrypted password, something like "sha1..."
    $ ipython
    In [1]:from IPython.lib import passwd
    In [2]:passwd()
    and exit out of ipython terminal using "exit" command. [ I'm not gonna use this password(shown in the pic below), so don't waste your time trying to copy and use it. ;) ]
  • Now we're going to create the configuration profile for our Jupyter Notebook server
    $ jupyter notebook --generate-config
       
  • The next thing is going to be to create a self-signed certificate for accessing our Notebooks through HTTPS
    $ mkdir certs
    $ cd certs
    $ sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.key -out mycert.pem
       
    it will ask some questions, please answer them to the best of your knowledge as some of them are required to successfully create the certificate.
  • It's time to change the config settings of our server
    $ cd ~/.jupyter/
    $ vi jupyter_notebook_config.py
       
    You will see a long list of configuration settings. You can go through each one of them and uncomment them as you like, but for me I know what I want, so I'll add the following settings to the top of the file and leave the rest commented as it is.
    c = get_config()
    
    # Kernel config
    c.IPKernelApp.pylab = 'inline'  # if you want plotting support always in your notebook
    
    # Notebook config
    c.NotebookApp.certfile = u'/home/ubuntu/certs/mycert.pem' #location of your certificate file
    c.NotebookApp.keyfile = u'/home/ubuntu/certs/mycert.key' #location of your certificate key
    c.NotebookApp.ip = '*'
    c.NotebookApp.open_browser = False  #so that the ipython notebook does not opens up a browser by default
    c.NotebookApp.password = u'sha1:68c136a5b064...'  #the encrypted password we generated above
    # It is a good idea to put it on a known, fixed port
    c.NotebookApp.port = 8888
    




  • We are almost done. Now its time to start our Jupyter notebook server. For this, first I'll create a new folder which will store all my notebooks
    $ cd ~
    $ mkdir Notebooks
    $ cd Notebooks
       
    and now I'll start my notebook server
    $ jupyter notebook
       




  • 5. And that is all. Now you can access your Notebook from anywhere through your browser. Just navigate to the DNS name, or Public IP of your instance, along with the port number. (By default, the browser adds "http" to the url. Please remember to update it to "https")
    You will be asked by your browser to trust the certificate, as we have signed it on our own, so we know we can trust it. See images for reference below:




    6. Login, using the password you specified when you used the iPython Terminal to create an encrypted version of it and you are good to go.

    7. One thing to note is that if you close the ssh access to your instance, your notebook server will not work. To keep it working, even when you close the ssh access to the server you can use the following command
    $ nohup jupyter notebook
      
    This will put your server process as no-hangup and will keep it running even if you close the ssh access to the instance

    8. Later, if you decide you want to stop this process, you have to find the PID of this process. you can do so by going into your notebooks folder and using the command
    $ lsof nohup.out
      
    which will list the PID of the nohup process which is running(if any).
    Then you can use the kill command to kill this process and stop your ipython notebook server.
    $ kill -9 "PID"
      
    replace "PID" with the ID of the process you get from the "lsof" command.

    So, that is all you need to run an iPython Notebook on AWS EC2 instance. Please leave your comments about this blog post and do remember to check out its video.(update in progress to the video. please don't refer it for now)

    Until next time... :)

    107 comments:

    1. I have a problem at the end of step 4. When I try:
      ipython notebook --profile=nbserver


      I get:
      Ipython notebook requires javascript

      and I cannot connect on ipython notebook with my browser.

      What is the solution?

      Btw, thank you for this great post, it is helpful!

      ReplyDelete
      Replies
      1. Please check if following is set in the config file:

        c.NotebookApp.open_browser = False

        NotebookApp.open_browser is set to True by default, which is why it tries to open a browser. I think you are doing this in a terminal(which has a text browser), it will not start javascript. Make sure that open_browser is set to False.

        Hope it helps. Feel free to check out the video for this post too for verification of the steps. (https://www.youtube.com/watch?v=q4PrYQOShnE)

        Delete
      2. config file has this property set to False, but stiil doesn't work shows same error.
        is there anyway to reload the properties ?

        Delete
      3. After you edit the config file, make sure you save and exit. Hit Esc then type :wq

        Delete
      4. I have encountered the same problem.Its throwing js not enabled error.Could you please advise any workarounds? Thanks

        Delete
    2. Hi Piyush, Thanx for the post

      I am however getting the follwing error message in my terminal when I enter the (public ip of my aws instance):8888 in the browser

      SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:590)

      ReplyDelete
      Replies
      1. I had the same error using Safari browser but worked fine with chrome..

        Delete
      2. I am also using Chrome, but I keep getting the error!

        Delete
      3. Hi Aakash, could you check the video once, if you followed every step as directed in the video. Maybe you missed a step or did it differently.

        Delete
      4. make sure to use https and not just http

        Delete
      5. The same for me, but Luis is right in my case, it happened only because I don't used htpps.
        Thanks Luis for the answer and Piyush for the helpful article.

        Delete
      6. Good to point that out. Although, it is shown in the image screenshot to use https, but I'll still include it in the text. Thanks guys!

        Delete
    3. Everything worked for me until Step 5. trying to navigate to my notebook, my browser says " This webpage is not available"

      ReplyDelete
      Replies
      1. I believe the case might be with your AWS instance. If you restarted your instance then your ip would have been changed. Please check the IP address of the AWS instance and also you have to start the ipython server again by using the mentioned commands above.

        Delete
    4. http://stackoverflow.com/a/32527607/2482894

      ReplyDelete
    5. Great, very clear instruction and video, thanks!

      ReplyDelete
    6. I am having a problem with step 4

      When I try to create the profile the file ipython_notebook_config.py is not being created.

      In forums everybody says that it should be a dependency problem but when I run
      pip install ipython['all'] I don't get any result.

      Any Idea of how to solve it ?

      ReplyDelete
    7. after entering "ipython notebook --profile=nbserver" I am getting this:
      2015-11-17 03:51:33.444 [NotebookApp] Using existing profile dir: u'/home/ubuntu/.ipython/profile_nbserver'
      2015-11-17 03:51:33.450 [NotebookApp] Using MathJax from CDN: https://cdn.mathjax.org/mathjax/latest/MathJax.js
      2015-11-17 03:51:33.465 [NotebookApp] The port 8888 is already in use, trying another random port.
      2015-11-17 03:51:33.465 [NotebookApp] Serving notebooks from local directory: /home/ubuntu/iPython_Notebooks
      2015-11-17 03:51:33.465 [NotebookApp] 0 active kernels
      2015-11-17 03:51:33.465 [NotebookApp] The IPython Notebook is running at: https://[all ip addresses on your system]:8889/
      2015-11-17 03:51:33.465 [NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

      I cannot understand how the port 8888 is used. Is it the reason that I cannot open the notebook?

      ReplyDelete
      Replies
      1. Hi Amartya, hope you got this resolved by the method I sent over to you on mail. Please post your solution so that it might help any others in future.

        Delete
    8. Hi,
      I'm able to run the notebook without any issue,but I have a different requirement. Can you please give suggestions ?
      I need my ipython-notebook to run even if I terminate my terminal in the laptop. In current situation if I close the Terminal I should start the notebook again and run the code again from beginning, Since I need to process a large data set, it has to run for at least 3 days continuously.is there is any option to configure like that in aws ?

      ReplyDelete
      Replies
      1. One way I can think of doing that is that if you keep a browser window open on your laptop/desktop and connect to your notebook using it. This will allow you to keep the session open as long as you want while the processing is going on.
        In the meantime you can do rest of your work as this process is not using your system's resources.

        Another option can be to increase the size of RAM on your AWS instance so that the computation is performed faster. This could incur some charges so please make sure to look into that before hand.

        Delete
    9. This still works, as of January 15, 2016. Thank you Piyush!!!!! I have a notebook I can use ANYWHERE now.

      For me, the blog instructions did not work and I got an error related to SSL (gone now, didn't copy...sorry :-( ).

      Instructions in the video worked perfectly. But, the key part to get the notebook started was adding the "--profile-nbserver" to the launch command like it says in position 14:19 of the YouTube video:
      'ipython notebook --profile=nbserver"

      When I just did ipython notebook, lots of errors.

      For those who have problems getting iPython notebook installed on their AMI, because of pyzmq, this worked for me:

      "sudo pip install --upgrade pyzmq"

      This came from: http://askubuntu.com/questions/100529/how-to-install-python-package-pyzmq-properly

      ReplyDelete
    10. Hi piyush... I have downloaded the latest anaconda distribution mentioned in this blog. When I executed $ ipython profile create nbserver, I am just getting two config files instead of three mentioned in your video... ipython_notebook_config.py is missing but i have other two files.

      How to proceed now??

      ReplyDelete
      Replies
      1. Hi, please verify if you are able to view a note on the update made to this blog. It will be the first paragraph of the post. If not, I'd suggest to please refresh your browser cache (or use incognito mode) to load this blog post.
        This update lists the steps used to install the Jupyter Notebooks (previously known as iPython Notebooks). The config files have all changed. Please don't refer to the video as it is still according to the old version. I'll update it as soon as I get some time.

        Delete
    11. Hello, Thx a lot for this tuto. I have a problem in step 5. When I try to acces to https://ec2-xxxxxx.compute-1.amazonaws.com:8888/, I have the following error : ERR_TIMED_OUT.
      Do you have any idea to resolve this problem?
      Thx a lot,
      regards

      ReplyDelete
      Replies
      1. This comment has been removed by the author.

        Delete
      2. Please check your instance settings. Did you open the port 8888?

        Delete
      3. Also check if you created the self signed certificate and mentioned the path to the certificate file in the jupyter config file...

        Delete
      4. This comment has been removed by the author.

        Delete
      5. This comment has been removed by the author.

        Delete
      6. from this log, it looks like the ssl certificate keyfile path is not set properly in the config file. Please verify if you added the following line to your file:
        c.NotebookApp.certfile = u'Your keyfile path'

        Delete
      7. This comment has been removed by the author.

        Delete
      8. This comment has been removed by the author.

        Delete
      9. If anyone is facing the same issue:
        This issue occurs if you have not created the Certificate file correctly. Please answer the questions when creating certificate file as some of them are required for proper working.

        Thanks William for bringing this to notice...

        Delete
      10. Thx a lot Piyush, I didn't answer to the question in step 4, all is ok now

        Delete
      11. This comment has been removed by the author.

        Delete
    12. This comment has been removed by the author.

      ReplyDelete
    13. It seems like I forgot the password to log into Ipython Notebook running on my server. Any suggestion?

      ReplyDelete
      Replies
      1. 1. access your ec2 instance.

        2. Create a new password hash using the following commands:
        ipython
        In [1]:from IPython.lib import passwd
        In [2]:passwd()

        3. Copy-paste the new hashed password in your ipython/jupyter notebooks config file.

        Delete
      2. This comment has been removed by the author.

        Delete
    14. Thanks for a great tutorial!

      Should it be possible to save or show plots in this setup?

      I try to run:

      import matplotlib.pyplot as plt
      import numpy as np

      t = np.arange(0.0, 2.0, 0.01)
      s = np.sin(2*np.pi*t)
      plt.plot(t, s)

      plt.xlabel('time (s)')
      plt.ylabel('voltage (mV)')
      plt.title('About as simple as it gets, folks')
      plt.grid(True)
      plt.savefig("test.png")
      plt.show()


      And get a long error message pointing at "plt.plot(t, s)" and ending with:
      RuntimeError: Invalid DISPLAY variable

      ReplyDelete
      Replies
      1. i'm getting a similar error

        Delete
      2. i ended up solving it with:

        sudo apt-get install libsm6 libxrender1 libfontconfig1

        I guess it's an issue of minimal debian dependencies for anaconda
        https://github.com/conda/conda/issues/1051

        Delete
    15. This comment has been removed by the author.

      ReplyDelete
    16. Very good one, thank you Piyush! I'm using Jupyter on our own supercomputer using your guidance.

      ReplyDelete
    17. Have you notices any slowness on t.micro instances. I'm able to reach the server from the browser, but kernels won't connect! Any thoughts?

      ReplyDelete
    18. I also have the issue of kernels not connecting (also using t.micro). Any tips welcome!

      ReplyDelete
    19. Piyush,
      I want to say "Thank you" for this excellent post.

      ReplyDelete
    20. fantastic Blog. Super Easy to follow

      ReplyDelete
    21. Every step of the tutorial works beautifully. Thanks Piyush

      One question: say I close the browser tab in which Jupyter notebook is running. when I reopen the notebook it appears to have discontinued the execution of code.

      Is this how it is supposed to behave ?

      ReplyDelete
      Replies
      1. I think that is how it supposed to happen as when you close the tab, you in-turn close that python session.
        Thanks for liking the post :)

        Delete
    22. hi. awesome tutorial this totally got me up and running.

      only thing not working is pyplot. when i try to import it, i get some long verbose error... i've double checked the jupyter_notebook_config.py and everything there looks solid.

      i also tried reinstalling matplotlib from various repos including conda and pip... still no luck.

      any ideas on what the issue could be?

      ReplyDelete
      Replies
      1. @markodude: try

        %matplotlib inline
        import matplotlib.pyplot as plt

        Delete
      2. i get the same error if i do %matplotlib inline or just %matplotlib

        Delete
      3. i ended up solving it with:

        sudo apt-get install libsm6 libxrender1 libfontconfig1

        I guess it's an issue of minimal debian dependencies for anaconda
        https://github.com/conda/conda/issues/1051

        Delete
    23. This comment has been removed by the author.

      ReplyDelete
    24. Hi piyush.. I was able to install it successfully and run my code.. But for a specific code my kernel dies... is it anyway related to the installation or the code I am using?

      ReplyDelete
      Replies
      1. I think it might be because of memory limitations on your machine. I'd suggest to check for any big background tasks. If you always want to run various other tasks along with the ipython kernel, you might think of increasing the memory size.

        Delete
    25. Thank you a lot! This was of tremendous help. I figured out the aws cli commands to achieve what you show via the console maybe useful and you might want to integrate this in the main post: https://gist.github.com/dengemann/3245552bcdbf7f8f2293abb96c2348f4

      ReplyDelete
      Replies
      1. Thanks Denis. If you can let me know exactly what cli commands you are talking about here, then I can probably integrate them into the gist.

        Delete
      2. Did you see my gist (link above)? It shows the aws cli commands which allow you to do the config from the command line.

        Delete
    26. Thank you very much for the installation steps. Followed the steps but when I try to connect the notebook with the https://ec2-107-22-138-210.compute-1.amazonaws.com:8888/ address , it just shows the message that 'This site cannot be reached. The site refused to connect'.
      Could you please help ? Any hint on what could be the reason?

      ReplyDelete
      Replies
      1. It should give you a "Your connection is not private" warning.

        If you are not getting this pls cross check your url/port ?

        Delete
      2. Thank you the reply, but I could not see the warning? Where it is shown?

        Delete
      3. Please verify your AWS settings and see if you have opened a port 8888 in your security group. Also, please answer all the questions when creating the certificate file. I have known few people to get an issue because of it.
        If nothing works, I'd suggest please try to repeat all the steps from the beginning - sometimes that helps too.

        Delete
      4. Thank you for the reply. Once again installed everything as per the instructions. But still when I tried to access the notebook via https://54.236.163.221:8888/, it showed that the "The site can't be reached'
        Try:
        Reloading the page
        Checking the connection
        Checking the proxy and the firewall
        ERR_CONNECTION_REFUSED

        Delete
      5. just checked, its working. click on "Show Advanced". Refer to step 5 above.

        Delete
      6. Thank you very much for the reply, but from this machine I am still not able to access. I think some other reason. Should I change any settings in chrome?

        Delete
      7. This looks like an issue with some firewall or security settings. I tried it from home and was able to access it, but am not able to access from my work network. Try checking your Firewall settings or try to use this website on a completely different network.

        Delete
      8. Thank you very much for checking this issue. Here, also same observation, could access from another network through Operah browser. Still trying to access from my machine. Once it is solved, I shall update.

        Delete
      9. Thank you very much. Followed the steps I met the same problem as you.
        I verified my AWS settings and a port 8888 in my security group.

        But still when I tried to access the notebook via https://52.199.253.246:8888/, it showed that the "The site can't be reached'
        Try:
        Reloading the page
        Checking the connection
        Checking the proxy and the firewall
        ERR_CONNECTION_REFUSED

        If you have fixed this problem, you can share the solution.

        Delete
      10. if possible, try from a different network or browser. Also, I'd suggest to check the nohup.out for any possible errors when running the notebook.

        Delete
    27. Very nice tutorial! Thank you Piyush! I got the service running nicely until I opened up a notebook and it couldn't connect to the kernel. I did a git clone from my github repository and tried to run the notebook. And in the terminal there was a warning saying this notebook is not trusted. Do you have any idea about this? Thanks!

      ReplyDelete
      Replies
      1. I'm not sure about this but you can go through this link to see if something works. https://ipython.org/ipython-doc/3/notebook/security.html

        One thing I can think of is that while creating the notebook we create a self-signed ssl certificate which might be the cause of this issue here. Do post a comment if you figure out how to fix this specific issue. Thanks!!

        Delete
    28. Hey how do iherher this to run the server at start of the machine?

      ReplyDelete
    29. I think what I want to say is how do I get this command to run at the restart of the machine It is running on?

      I have it on a Digital Ocean server which I dont want to run your command by ssh. I just want it to restart the notebook server when the server restarts.

      thanks

      ReplyDelete
      Replies
      1. not sure, will look into it

        Delete
      2. I found this website and followed the systemd.service file but didnt do it as a new user. I just used the same user I had installed anaconda with.

        After pointing it to my anaconda location ass works on reboot of system!

        https://amitksaha.wordpress.com/2013/09/22/managing-ipython-notebook-server-via-systemd-part-i/

        Delete
    30. Piyush how do u run multiple instances on jupyter notebook server each with its own config file ?

      ReplyDelete
      Replies
      1. check the EDIT section for your solution on this link - https://www.reddit.com/r/IPython/comments/3jn4ub/is_it_possible_to_deploy_multiple_jupyter/

        Delete
    31. Took me a few attempts, but I eventually got it set up. I was hung up on the http/https part of the url for a little while.

      Great tutorial though, thanks!

      ReplyDelete
      Replies
      1. Thanks Dan! It would be really helpful if you could put in a comment what issues you faced and how were you able to resolve them.

        Delete
    32. Thanks for tutorial. I have created AMI so that I dont have to run these steps again. However when I start my AMI I need to run command "jupyter notebook" from terminal again. Is there a way to configure my server to automatically start jupyter notebook on AMI startup without going into terminal?

      ReplyDelete
      Replies
      1. check this tutorial from Amazon - http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html

        Hope this is what you are looking for...

        Delete
    33. At our company we pass resources through a AWS LB to bring the ip into a range that gets through our fw. One frustrating issue that cropped up was the LB itself needs to map to TCP and not just to HTTP. (this is due to ws) Websockets do not pass through the LB if you only specify http 80 to your http port for jupyter Websockets are used when you start the Kernel so without this you can see your notebooks but can not run anything.

      ReplyDelete
    34. Hi, I got this exception while tried to open jupyter through browser as "https://myec2instance:8888". I have no idea why this might have happened.

      [E 07:14:22.247 NotebookApp] Exception in callback (, )
      Traceback (most recent call last):
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/ioloop.py", line 883, in start
      handler_func(fd_obj, events)
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/stack_context.py", line 275, in null_wrapper
      return fn(*args, **kwargs)
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/netutil.py", line 274, in accept_handler
      callback(connection, address)
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/tcpserver.py", line 239, in _handle_connection
      do_handshake_on_connect=False)
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/netutil.py", line 510, in ssl_wrap_socket
      context = ssl_options_to_context(ssl_options)
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/netutil.py", line 487, in ssl_options_to_context
      context.load_cert_chain(ssl_options['certfile'], ssl_options.get('keyfile', None))
      IOError: [Errno 21] Is a directory
      [E 07:14:22.259 NotebookApp] Exception in callback (, )
      Traceback (most recent call last):
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/ioloop.py", line 883, in start
      handler_func(fd_obj, events)
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/stack_context.py", line 275, in null_wrapper
      return fn(*args, **kwargs)
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/netutil.py", line 274, in accept_handler
      callback(connection, address)
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/tcpserver.py", line 239, in _handle_connection
      do_handshake_on_connect=False)
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/netutil.py", line 510, in ssl_wrap_socket
      context = ssl_options_to_context(ssl_options)
      File "/home/ec2-user/anaconda2/lib/python2.7/site-packages/tornado/netutil.py", line 487, in ssl_options_to_context
      context.load_cert_chain(ssl_options['certfile'], ssl_options.get('keyfile', None))
      IOError: [Errno 21] Is a directory

      ReplyDelete
      Replies
      1. check your certfile setting. looks like you only put in the path of the folder containing the certfile and forgot to mention the name of the .cert file itself.

        Delete
      2. I hope you were able to resolve this issue. If not you I know what exactly the issue is.
        You'll need to create a keyfile (just like certfile) and then add that as a config.
        c.NotebookApp.keyfile = ""

        I'll update the post soon...

        Delete
    35. Hi, nice tutorial! I have everything working perfect but in "read only" mode. Any ideas why is this happening? The Jupyter Notebook output is: "Permission denied: .ipynb_checkpoints". In previous lines of the output it says: "Notebook myNotebook.ipynb is not trusted".

      Is this related to file permissions in Ubuntu or any other configuration missing with Jupyter?

      Thanks in advance!

      ReplyDelete
      Replies
      1. I think this might be something to do with the user access on the system. check if the user is a sudoer and has full access to the system and then start jupyter with this user

        Delete
    36. Hi Piyush
      I followed your tutorial just like you mentioned but when I try to run the jupyter notebook by typing
      jupyter notebook
      I get an error Permission denied: '/home/ubuntu/.local/share/jupyter/notebook_secret'

      ReplyDelete
    37. Thank you for sharing this useful story.
      I think your shared information is helpful to me and who are want update their knowledge,
      who want to started their career with Oracle cloud fusion procurement Online Training.
      oracle fusion financials training
      oracle fusion financials online training
      oracle fusion Procurement training training
      oracle fusion procurement online training

      ReplyDelete
    38. This is a really well written blog. I’ll be sure to bookmark it and return to read more of your useful information. Thanks for the post.
      Big Data Analytics Training in Chennai | Python Training in Chennai

      ReplyDelete
    39. I admire the valuable information you offer in your articles. I will bookmark your blog and have my friends check up here often. I am quite sure they will learn lots of new stuff here than anybody else! Regards aws jobs in hyderabad.

      ReplyDelete
    40. Thanks for your informative blog!!! Keep on updating your with such awesome information.
      Aws Online Training

      ReplyDelete
    41. Hello and thank you for this great tutorial.
      Unfortunately, the url does not work at all, says it's too long.
      Even if all the info in the terminal once I typed "jupyter notebook" completely match yours.
      Do you have any idea? I already added this : "c.NotebookApp.open_browser = False" in the config file.
      Kind regards

      ReplyDelete
      Replies
      1. I don't think I have ever seen that error in particular. Maybe you are missing a step or there is a typo somewhere in the config. I'd suggest to take a look at the video tutorial (remember it's still an old one so you'll have to verify the config settings from the blog instead of the video) but I hope it will serve as a good reference point. Lmk how it goes..

        Delete
      2. Thank you for your quick reply. Maybe I'm missing a step, it's just that everything is going so well at every stage, absolutely everything !!
        Here is what I have:
        ubuntu@ip-172-31-X-YY:~/Notebooks$ jupyter notebook
        [I 17:55:36.027 NotebookApp] Serving notebooks from local directory: /home/ubuntu/Notebooks
        [I 17:55:36.027 NotebookApp] 0 active kernels
        [I 17:55:36.027 NotebookApp] The IPython Notebook is running at: https://[all ip addresses on your system]:8889/
        [I 17:55:36.027 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

        Thank you so much for your inputs.

        Delete
      3. so does that means you got it working and have no problems accessing the notebook anymore?

        Delete
      4. no sorry that means that I've got this in the terminal once I launch "jupyter notebook" but the address does not work in the browser, neither https://[public ip]:8889/ nore https://ec2-[IP].us-west-2.compute.amazonaws.com:8889.

        Delete
      5. That's weird! Did you check out the video tutorial link for this blog post (https://www.youtube.com/watch?v=q4PrYQOShnE), maybe that helps?

        I'll try to setup a new server later today and see if I also run into the same issue. Maybe they updated something in the jupyter cofig (highly unlikely, but I'll still verify if you are not able to get it working even after referring the video).

        Delete
      6. Thank you so much (yes I did it with the video and the tutorial).

        Delete
    42. Thank you for the great tutorial but i'm facing the issue "ERR_CONNECTION_TIMED_OUT" while trying to access "https://ec2-xx-xx-xxx-xx.xx-xxxxx-x.compute.amazonaws.com:8888/".

      I Have tried all the option that you have mentioned in the above problem which was similar. I'm on Windows 10 & using Chrome

      ReplyDelete