Skip to content

Instantly share code, notes, and snippets.

@ravi9
Forked from yangj1e/notebook.sh
Last active February 13, 2017 21:12
Show Gist options
  • Save ravi9/3d09d699a089045d11f0b66603cedbc5 to your computer and use it in GitHub Desktop.
Save ravi9/3d09d699a089045d11f0b66603cedbc5 to your computer and use it in GitHub Desktop.
Deploy Jupyter Notebook server on Amazon EC2 Instance
#!/usr/bin/env bash
cd ~
wget http://repo.continuum.io/archive/Anaconda2-4.0.0-Linux-x86_64.sh
bash Anaconda2-4.0.0-Linux-x86_64.sh -b
echo 'PATH="/home/ubuntu/anaconda2/bin:$PATH"' >> .bashrc
. .bashrc
jupyter notebook --generate-config
key=$(python -c "from notebook.auth import passwd; print(passwd())")
cd ~
mkdir certs
cd certs
certdir=$(pwd)
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.key -out mycert.pem
cd ~
sed -i "1 a\
c.NotebookApp.ip = '0.0.0.0'\\
c.NotebookApp.open_browser = False\\
c.NotebookApp.password = u'$key'\\
c.NotebookApp.port = 8888" .jupyter/jupyter_notebook_config.py
@ravi9
Copy link
Author

ravi9 commented Feb 13, 2017

#Execute the following two lines to setup Jupyter notebook.

git clone https://gist.github.com/ravi9/3d09d699a089045d11f0b66603cedbc5 nb
. nb/notebook.sh 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment