Skip to content

Instantly share code, notes, and snippets.

@ian-whitestone
Created August 29, 2018 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ian-whitestone/7c5f3804c5fc259a4086161dac471b49 to your computer and use it in GitHub Desktop.
Save ian-whitestone/7c5f3804c5fc259a4086161dac471b49 to your computer and use it in GitHub Desktop.
Setting up jupyter lab on a ubuntu instance

Setting Up Jupyter Lab on an EC2

  1. Install Jupyter Lab

conda install -c conda-forge jupyterlab

  1. Create certs

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mycert.pem -out mycert.pem

Doesn't matter what your inputs are.

  1. Create a hashed password
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:XXXXX'
  1. Generate jupyter config

$ jupyter notebook --generate-config

$ vi ~/.jupyter/jupyter_notebook_config.py

Add this to bottom of config file:

c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.password = 'XXX' # from step 3
c.NotebookApp.certfile = '/home/ubuntu/mycert.pem' # created in step 2
  1. Launch jupyter lab

$ jupyter lab

  1. IP Address

Grab it from the AWS console after you find your EC2 instance.

Resources

Issues

Conda environments aren't showing up in available kernels despite having done:

$ conda install nb_conda_kernels -y
$ conda install nb_conda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment