官网 https://jupyterhub.readthedocs.io/en/latest/installation-guide.html
文件结构
/srv/jupyterhub for all security and runtime files
/etc/jupyterhub for all configuration files
/var/log for log files
pip、conda和docker三种安装方式
JupyterHub can be installed with pip
(and the proxy with npm
) or conda
:
pip, npm:
python3 -m pip install jupyterhub
npm install -g configurable-http-proxy
python3 -m pip install notebook # needed if running the notebook servers locally
conda (one command installs jupyterhub and proxy):
conda install -c conda-forge jupyterhub # installs jupyterhub and proxy
conda install notebook # needed if running the notebook servers locally
Starting JupyterHub with docker
docker
The JupyterHub docker image can be started with the following command:
docker run -d --name jupyterhub jupyterhub/jupyterhub jupyterhub
This command will create a container named jupyterhub
that you can stop and resume with docker stop/start
.
检测是否安装成功
jupyterhub -h
configurable-http-proxy -h
启动服务
jupyterhub
访问浏览器 https://localhost:8000 即可,底层还是jupyter notebook,只是增加了一些功能封装。有时候8000接口被占用,这个时候启动会自动选择一个未占用接口,看命令窗口的信息即可。
配置文件
生成配置文件
jupyterhub --generate-config
一般我们把文件放到 /etc/jupyterhub
创建相关文件夹,然后设置该路径配置
jupyterhub -f /etc/jupyterhub/jupyterhub_config.py