Skip to content

Instantly share code, notes, and snippets.

@jigangkim
Last active July 7, 2021 11:30
Show Gist options
  • Save jigangkim/e9fc99cf969c5d63e5d78987e0950c95 to your computer and use it in GitHub Desktop.
Save jigangkim/e9fc99cf969c5d63e5d78987e0950c95 to your computer and use it in GitHub Desktop.
Jupyter notebook as a service on Ubuntu 18.04
  1. Install jupyter
conda activate base
which pip
pip install notebook==6.0.3
jupyter-notebook --generate-config
  1. Configure jupyter
gedit ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip = '192.168.xxx.1' # IP address of pritunl VPN server
c.NotebookApp.password_required = False
c.NotebookApp.port = 1312
c.NotebookApp.token = ''
  1. Install service
sudo cp jupyter.service /etc/systemd/system/
sudo systemctl enable jupyter.service
sudo systemctl daemon-reload
sudo systemctl start jupyter.service
systemctl status jupyter.service 
[Unit]
Description=Jupyter Daemon
After=network.target
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/home/<USER_NAME>/miniconda3/bin/jupyter-notebook
User=<USER_NAME>
Group=<GROUP_NAME>
WorkingDirectory=/home/<USER_NAME>/<PATH_TO_WORKSPACE>
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment