A while ago, I wrote a post, “Setup and use Jupyter Notebook (IPython) Notebooks on AWS”. While that approach benefits from being easy to setup, but requires you to have key to access. This approach allows for multiple people to access the server with just a password. With that, here let’s just started.
If you get lost, I recommend opening the video in a separate tab.
- Install Anaconda. If you don’t have it installed alreday, please see AWS EC2: Install Anaconda on Linux Instance.
- ssh to your EC2 instance. If you don’t know how to do this, please see the tutorial AWS EC2: Connect to Linux Instance using SSH.
ssh -i /path_to_key/my_key.pem user_name@public_dns_name
2a. Type ipython into the terminal. This will open ipython.
2b. The following lines are used for password athentication to the jupyter server we will launch.
from IPython.lib import passwd
2c. After you verify your password, Be sure to save the output.
2d. type exit() to exit out of ipython
3. In the terminal, type
jupyter notebook --generate-config
sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
c = get_config()
c.IPKernelApp.pylab = 'inline'
c.NotebookApp.certfile = u'/home/ubuntu/certs/mycert.pem'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
# Your password below will be whatever you copied earlier
c.NotebookApp.password = u'sha1:941c93244463:0a28b4a9a472da0dc28e79351660964ab81605ae'
c.NotebookApp.port = 8888
5. Exit out of the .py file and type the following into the terminal
nohup jupyter notebook
6. To access your server, enter