=========================
Installing Team Notebooks
=========================

This topic provides guidance on installing Team Notebooks.

#. Log in to your JupyterHub instance as a root user. 
#. Download the installer by running the following command:

   .. code-block:: shell

       # Replace <INSTALLER_LOCATION> with the provided location of your installer
       curl -O <INSTALLER_LOCATION>

   The ``jupyterhub.sh`` installer script you just downloaded requires an environment file to pass configuration values to it for use during installation.

#. Create a file named ``.env``. 
#. Enter the following information into the ``.env`` file:

   .. code-block:: shell

       # Replace <URL> with your Package Security Manager URL
       # Replace <PATH_TO_CERT> with the path to your TLS/SSL certificate
       # Replace <PATH_TO_KEY> with the path to your TLS/SSL key
       # Replace <PATH_TO_CA_CERT> with the path to your CA_CERT file. Only uncomment this line if you are using self signed certificates.
       ANACONDA_SERVER=<URL>
       CERT=<PATH_TO_CERT>
       KEY=<PATH_TO_KEY>
       #CA_CERT=<PATH_TO_CA_CERT>

#. Save your work and close the file. Find and note the full path to the ``.env`` file you just created by running the command: 

   .. code-block:: shell 

      echo $PWD 

#. Run the installer with the following command:

   .. code-block:: shell

       # Replace <INSTALLER> with the installer file you just downloaded
       bash <INSTALLER>

#. Review and accept the terms of the license agreement. 
#. Accept the default installation location of ``/opt/jupyterhub`` for the installation. 
#. Enter the path to the ``.env`` file you created when prompted with ``FILE PATH:``. 

   For example: ``/home/centos/.env``
   
#. Allow the installer to initialize JupyterHub by running ``conda init`` when prompted. 
 
With JupyterHub installed, you are ready to :doc:`integrate with Package Security Manager <integrate>`!
