Skip to content

Instantly share code, notes, and snippets.

@johnrc
Last active May 27, 2020 00:39
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save johnrc/604971f7d41ebf12370bf5729bf3e0a4 to your computer and use it in GitHub Desktop.
Save johnrc/604971f7d41ebf12370bf5729bf3e0a4 to your computer and use it in GitHub Desktop.
JupyterHub setup on centos
#!/bin/sh
curl -O http://repo.continuum.io/archive/Anaconda3-4.0.0-Linux-x86_64.sh
chmod u+x Anaconda3-4.0.0-Linux-x86_64.sh
./Anaconda3-4.0.0-Linux-x86_64.sh -b -p /opt/anaconda3
export PATH=/opt/anaconda3/bin:$PATH
curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -
yum install nodejs -y
npm install -g configurable-http-proxy
pip install jupyterhub
jupyterhub --generate-config
openssl req \
-newkey rsa:2048 -nodes -keyout domain.key \
-x509 -days 365 -out domain.crt
jupyterhub -f jupyterhub_config.py
@siralfbaez
Copy link

@johnrc Brilliant, thanks for sharing.
I'm curios, why pip install jupyterhub instead of conda install -c conda-forge jupyterhub ?
I'm wondering if "pip install jupyterhub" will overcome all the issue I'm experiences.
I used "conda install -c conda-forge jupyterhub" expecting "To install JupyterHub along with its dependencies including nodejs/npm" well according to https://github.com/jupyterhub/jupyterhub
Any how:
I'm implementing this in CentOS 7.x
Do I need nodejs and configurable-http-proxy and even after conda install jupyterhub?

Thanks in advance.

Cheers
Alf

@johnrc
Copy link
Author

johnrc commented Oct 1, 2019

@siralfbaez First off, my "install" script is old and brittle. Also, conda will only help you install the Python dependencies but not other runtimes like nodejs. It sounds like nodejs is still required.

@siralfbaez
Copy link

@johnrc. Thanks for taking the time to shade some light on this, and correct. I found the conda part being strait forward to implemented, The painful part was JupyterHub with TLS. So I end up going with The JupyterHub Littliest distribution via PIP as described on this guide> https://tljh.jupyter.org/en/latest/install/amazon.html. Thanks.
Cheers
Alf

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