Jupyter Notebookの自分用環境をIBM Cloud IaaS で用意する。

$ sudo nano jupyter-install.sh

#!/bin/bash
sudo apt-get -y update
sudo apt-get -y upgrade
sudo timedatectl set-timezone Asia/Tokyo
sudo apt-get install -y build-essential python3-dev python3-setuptools libfreetype6-dev
ln -s /usr/include/freetype2/ft2build.h /usr/include/
sudo easy_install3 pip
sudo pip install numpy scipy matplotlib seaborn scikit-learn pandas psycopg2 ipython-sql pymysql
sudo pip install jupyter
cd
jupyter notebook --generate-config
date
sudo apt-get install -y iproute2
ip a
echo "Success"

$ sudo chmod a+x jupyter-install.sh $ ./jupyter-install.sh $ cp ~/.jupyter/jupyter_notebook_config.py ~/.jupyter/jupyter_notebook_config.py.origin $ vi ~/.jupyter/jupyter_notebook_config.py

#c.NotebookApp.allow_remote_access = False
c.NotebookApp.allow_remote_access = True

#c.NotebookApp.ip = 'localhost'
c.NotebookApp.ip = '*'

#c.NotebookApp.open_browser = True
c.NotebookApp.open_browser = Flase

#c.NotebookApp.port = 8888
c.NotebookApp.port = 8888

#c.NotebookApp.token = '<generated>'
c.NotebookApp.token = '任意の英数字' 
例 c.NotebookApp.token = 'zaq12wsx' 

$ nohup jupyter notebook &

$ sudo tail -f ~/nohup.out

Webブラウザで、サーバーのIPアドレス:8888 でアクセス。Tokenにc.NotebookApp.tokenで指定した文字列を入力してログイン。