How to install Jupyter on an Ubuntu Linux VM?
Overview
Jupyter Notebook is widely used for creating and sharing computational documents. It is a web-application, Jupyter supports 40+ languages like Python, Julia, R etc.
In this tutorial, we will cover the installation of Jupyter notebook on Ubuntu Linux OS.
Prerequisites
There are certain prerequisites that need to be met before you begin.
Knowledge of Linux commands
Good command over OpenStack security groups (OSSG)
Minimum system requirements (2 GB RAM, 20 GB Storage, 4-core CPU)
Get Started
Before we get into the nitty-gritty of the installation process, you should first have the OpenStack instance created. Click here to read the instructions on how to create an OpenStack instance.
Once done, follow the steps given below for installing Jupyter notebook on an Ubuntu system.
1) Upgrade and Update Packages
Before starting the installation, you need to ensure that the system is up-to-date. You can check that by running the Update command which will update APT list of packages and also the versions. Also, you need to execute upgrade command to install the latest packages.
2) Building Python Dependencies
Now, we install pip, Python 3 plus other required packages for building Python dependencies which help in avoiding errors by providing vital software components.
Here's the command for installing Python:
3) Installing python using Python virtualenv
Upgrade the pip version to fetch the latest version of the package manager. Post that, install Python using virtualenv package, which allows you to manage Python packages for several projects and avoids installing packages globally which may break other projects or system tools.
In this command, -H is used for security policy to set the “HOME” environment variable and store the file in home directory.
4) Creating a Virtual Environment for Python
Creating a Python virtual environment is important to prevent installing the packages globally in order to not break other projects or system tools. For this,
Make a directory in home directory (or other location if you wish to do so). The new directory is our code directory. To make a new directory type the following command:
Then go to the directory andthen make a Python virtual environment called jptrenv.
Now, we have to load and activate the virtual environment using the following command.
5) Installing the Jupyter Notebook
Enter the below command in your system’s terminal to install Jupyter n/b using pip.
6) Create a rule in OpenStack security group
Next step is to create a rule in OpenStack security group. This step is necessary to allow Jupyter to access your web browser in order to function properly. To create a rule in OpenStack security group, follow the below given steps:
Go to the Security group assigned to your instance
Click create new rule top-right corner
Enter the port number and IP details as shown
Click create rule
7) Running the Jupyter Notebook
Once you have installed all required packages and dependencies, it's time to run the Notebook. Execute the below stated command: Note: Please enter your IP Address in <your server IP Address> and Port number in <Your Port>
This command opens Jupyter's homepage. You may choose Python3 by clicking on the new menu, or you can choose another choice, such as Terminal, Text File, or Folder, based on your choice. It will open a new Jupyter page in your browser.
Last updated