以下URLを参照

https://qiita.com/taka4sato/items/2c3397ff34c440044978

useradd -s /bin/bash -d /opt/jupyter jupyter
su - jupyter -c 'pip3 install -U pip --user'
su - jupyter -c 'pip3 install -U jupyterlab --user'

su - jupyter -c 'jupyter notebook --version'
su - jupyter -c 'mkdir ~/.jupyter/'

su - jupyter -c 'tee ~/.jupyter/jupyter_notebook_config.py << _EOF_ > /dev/null
c = get_config()
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8080
c.NotebookApp.token = ''
_EOF_'

tee -a /etc/systemd/system/jupyter.service << _EOF_ > /dev/null
[Unit]
Description=Jupyter notebook

[Service]
Type=simple
PIDFile=/var/run/jupyter-notebook.pid
ExecStart=/opt/jupyter/.local/bin/jupyter lab
User=jupyter
Group=jupyter
WorkingDirectory=/opt/jupyter
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
_EOF_

systemctl daemon-reload
systemctl start jupyter
systemctl enable jupyter

firewall-cmd --permanent --add-port 8080/tcp 
firewall-cmd --reload

广告
将在 10 秒后关闭
bannerAds