How To Install Jupyter Notebook On Ubuntu 20.04 / 19.10

We can install jupyter notebook in ubuntu 20.04. you need to have anaconda installed on the machine. Let’s see, how to install jupyter on ubuntu.

Jupyter is an open-source web application that allows you to create and share documents that contain live codes with narrative text and equations.

Check Out: How To Install Postman On Ubuntu 20.04 and Windows 10

How To Install Jupyter Notebook On Ubuntu 20.04 / 19.10

You must have conda installed on your machine. you can follow these documents to install conda on ubuntu 20.04. we also need to install the PIP on ubuntu.

Once you have installed the above packages, you need to install jupyterlab and conda-forge package on ubuntu.

conda install -c conda-forge jupyterlab

Install the Jupyter core using the below command and press “y” to continue the installation. 

ubuntu@ubuntu:~/Desktop$ sudo apt install jupyter-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
python3-decorator python3-ipython-genutils python3-jupyter-core python3-traitlets
The following NEW packages will be installed:
jupyter-core python3-decorator python3-ipython-genutils python3-jupyter-core python3-traitlets
0 upgraded, 5 newly installed, 0 to remove and 19 not upgraded.
Need to get 138 kB of archives.
After this operation, 804 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

Installing ipython and jupyter using the PIP command:

Use the below command to install them and This process can take time, totally depends on your internet speed. Create a directory at /opt/lvmfolder

sudo mkdir -p /opt/lvmfolder/jupyter
cd /opt/lvmfolder/jupyter
sudo apt-get -y install ipython
sudo pip3 install jupyter

You can check the jupyter version.

ubuntu@ubuntu:/opt/lvmfolder/jupyter$ jupyter --version
jupyter core : 4.6.3
jupyter-notebook : 6.1.3
qtconsole : not installed
ipython : 7.18.1
ipykernel : 5.3.4
jupyter client : 6.1.7
jupyter lab : not installed
nbconvert : 5.6.1
ipywidgets : not installed
nbformat : 5.0.7
traitlets : 4.3.3

Check Out: How To Upgrade Linux Kernel Version On CentOS

Once the command is completed. we can start jupyter notebook. You can also start jupyter with non-root users as well. I will start juypter as root by using the flag –allow-root 

ubuntu@ubuntu:/opt/lvmfolder/jupyter$ jupyter notebook --allow-root
[I 03:20:49.247 NotebookApp] Writing notebook server cookie secret to /home/ubuntu/.local/share/jupyter/runtime/notebook_cookie_secret
[I 03:20:49.478 NotebookApp] Serving notebooks from local directory: /opt/lvmfolder/jupyter
[I 03:20:49.478 NotebookApp] Jupyter Notebook 6.1.3 is running at:
[I 03:20:49.478 NotebookApp] http://localhost:8888/?token=27f3b3243eb0cadf9fbf527a4ffe18f59d6fc4f692d07f3
[I 03:20:49.479 NotebookApp] or http://127.0.0.1:8888/?token=27f3b3243eb0cadf9fbf527a4ffe18f59d6fc4f692d07f3
[I 03:20:49.479 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 03:20:49.628 NotebookApp] 

To access the notebook, open this file in a browser:
file:///home/ubuntu/.local/share/jupyter/runtime/nbserver-11133-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=27f3b3243eb0cadf9fbf527a4ffe18f59d6fc4f692d07f3
or http://127.0.0.1:8888/?token=27f3b3243eb0cadf9fbf527a4ffe18f59d6fc4f692d07f3

Pick up any of the URL to hit in the browser and you will see the output like: 

When you will create any file inside the directory /op/lvmfolder/jupyter and those files will automatically be uploaded on the notebook.  

ubuntu@ubuntu:/opt/lvmfolder/jupyter$ ls
testingfile   tokenlink

Now refresh the URL:

You can also create any file using the portal and click on “New“. 

jupyter install in ubuntu

Check Out: How To Create Swap file Without Disk Partition On Linux

You can check the token using the below command. 

ubuntu@ubuntu:/opt/lvmfolder/jupyter$ jupyter notebook list
Currently running servers:
http://localhost:8888/?token=27f3b3243eb0cadf9fbf527a4ffe18f59d6fc4f692d07f23 :: /opt/lvmfolder/jupyter

We will logout and login again with the above token and you will be able to log in.

jupyter notebook install

That’s it.

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment