Jupyter Notebook is a web app for building inline applications (predominantly focused on Python although you can also run bashor other commands if setup). Code can be written and shared in documents with explanations on usage. Notebooks is often bundled with Anaconda (www.anaconda.com).

Assuming you’ve got your Ubuntu server running you can get Jupyter setup pretty quickly. This tutorial shows how to install Jupyter and open ports to make the service available to your web-browser.

Installing Jupyter Notebooks

Prior to install we need to prep the server for all Jupyter’s dependencies. Python is required for the installation. Worth executing all the operations in bold.

sudo apt-get install python-pip python-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
Use ‘ apt autoremove’ to remove them.
The following additional packages will be installed:
.
.
Setting up libpython-all-dev:amd64 (2.7.14-4) …
Setting up gcc (4:7.3.0-3ubuntu2) …
Setting up python-all-dev (2.7.14-4) …
Setting up g++ (4:7.3.0-3ubuntu2) …
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (12.4ubuntu1) …
Processing triggers for libc-bin (2.27-0ubuntu2) …

# sudo pip install –upgrade pip

The directory ‘ /home/user1/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’ s -H flag.
The directory ‘ /home/user1/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’ s -H flag.
Collecting pip
Downloading pip-9.0.3-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 466kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Not uninstalling pip at /usr/lib/python2.7/dist-packages, outside environment /usr
Successfully installed pip-9.0.3

# sudo pip install jupyter

The directory ‘ /home/user1/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’ s -H flag.
The directory ‘ /home/user1/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’ s -H flag.
Collecting jupyter
Downloading jupyter-1.0.0-py2.py3-none-any.whl
Collecting nbconvert (from jupyter)
Downloading nbconvert-5.3.1-py2.py3-none-any.whl (387kB)
100% |████████████████████████████████| 389kB 2.0MB/s
Collecting ipywidgets (from jupyter)
Downloading ipywidgets-7.2.1-py2.py3-none-any.whl (106kB)
100% |████████████████████████████████| 112kB 1.2MB/s
Collecting qtconsole (from jupyter)
Downloading qtconsole-4.3.1-py2.py3-none-any.whl (108kB)
100% |████████████████████████████████| 112kB 1.2MB/s
.
.
Successfully installed MarkupSafe-1.0 Send2Trash-1.5.0 backports-abc-0.5 backports.shutil-get-terminal-size-1.0.0 bleach-2.1.3 configparser-3.5.0 decorator-4.2.1 entrypoints-0.2.3 functools32-3.2.3.post2 html5lib-1.0.1 ipykernel-4.8.2 ipython-5.6.0 ipython-genutils-0.2.0 ipywidgets-7.2.1 jinja2-2.10 jsonschema-2.6.0 jupyter-1.0.0 jupyter-client-5.2.3 jupyter-console-5.2.0 jupyter-core-4.4.0 mistune-0.8.3 nbconvert-5.3.1 nbformat-4.4.0 notebook-5.4.1 pandocfilters-1.4.2 pathlib2-2.3.0 pexpect-4.5.0 pickleshare-0.7.4 prompt-toolkit-1.0.15 ptyprocess-0.5.2 pygments-2.2.0 python-dateutil-2.7.2 pyzmq-17.0.0 qtconsole-4.3.1 scandir-1.7 simplegeneric-0.8.1 singledispatch-3.4.0.3 terminado-0.8.1 testpath-0.3.1 tornado-5.0.2 traitlets-4.3.2 wcwidth-0.1.7 webencodings-0.5.1 widgetsnbextension-3.2.1

# jupyter notebook –allow-root
[I 04:12:38.206 NotebookApp] Writing notebook server cookie secret to /home/user1/.local/share/jupyter/runtime/notebook_cookie_secret
[I 04:12:38.663 NotebookApp] Serving notebooks from local directory: /home/user1
[I 04:12:38.663 NotebookApp] 0 active kernels
[I 04:12:38.664 NotebookApp] The Jupyter Notebook is running at:
[I 04:12:38.664 NotebookApp] http://localhost:8888/?token=7a761a8de8e07b774fb1971503ad69dffa48b058598ac903
[I 04:12:38.664 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 04:12:38.665 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=7a761a8de8e07b774fb1971503ad69dffa48b058598ac903
[I 04:12:55.942 NotebookApp] Accepting one-time-token-authenticated connection from 127.0.0.1
[I 04:13:22.434 NotebookApp] Creating new directory in
[I 04:13:35.541 NotebookApp] Creating new directory in
[W 04:14:39.432 NotebookApp] delete /Untitled Folder 1
[I 04:14:59.713 NotebookApp] Creating new file in
[I 06:29:53.174 NotebookApp] 302 GET /edit/untitled.txt (127.0.0.1) 75.78ms