Ubuntu Linux

How to Install JupyterLab on Ubuntu: A Step-by-Step Guide

Richard
Written by
Richard
Jan 26, 2024 Updated Mar 19, 2026 4 min read

This article explains how to install and use JupyterLab on Ubuntu Linux.

JupyterLab is a web-based interactive development environment allowing easy collaboration and sharing of code and data. It is flexible and can integrate third-party extensions that enhance its functionality.

Installing and using JupyterLab on Ubuntu Linux provides a powerful data analysis, visualization, and machine learning platform. It allows users to write and execute code, document their work, and share their findings with others.

Additionally, Ubuntu Linux is a popular data science and machine learning operating system, so installing JupyterLab on it can streamline the workflow for many users.

Prerequisites

Before installing JupyterLab, ensure that you have the following prerequisites installed:

  • Python 3.x
  • pip (Python package installer)

Update System Package Index

Open your terminal and begin by updating your system’s package index:

🐧Bash / Shell
sudo apt update
sudo apt upgrade

Install Python 3 and pip

If Python 3 is not already installed on your system, you can install it using the following command:

🐧Bash / Shell
sudo apt install python3 python3-pip python3-venv nodejs

After installing, check the version of Python and pip:

💻Code
python3 --version
pip3 --version

Install JupyterLab

With Python and pip ready, you can install JupyterLab via pip. First, create a new Python virtual environment for the Jupyter installation.

With this scenario, you will have an isolated development environment that won’t affect your whole system.

Create a new directory for your project called MyLab and change into the folder using the cd command.

Then, use the following command to create a new virtual environment called venv. The new directory venv will be created after the command is executed.

Command Prompt
mkdir -p ~/MyLab
cd ~/MyLab
python3 -m venv venv
source venv/bin/activate

After creating the virtual environment above, run the command below to install JupyterLab.

💻Code
pip3 install jupyterlab

Once the installation is completed, JupyterLab will be ready to use.

Run JupyterLab

To start JupyterLab, run the following command in your terminal:

💻Code
jupyter-lab

This should open your default browser and launch JupyterLab. Alternatively, if it doesn’t open automatically, you can manually visit the URL it provides, usually something like http://localhost:8888/lab.

Create a New Notebook

In the JupyterLab interface,

  1. Click the “+” button to open a new tab.
  2. Under the “Notebook” section, you can create a notebook in different programming languages, depending on your installed kernels. Choose a Python 3 notebook to create a new one.

Use the Notebook

Once your notebook is open, you can start typing Python code into the cells. Press Shift + Enter to execute the code in the current cell.

Here’s an example of a simple print statement:

💻Code
print("Hello, JupyterLab!")

Saving and Exiting

To save your notebook, press the save icon or go to File -> Save Notebook. To close JupyterLab, simply close the browser tabs and stop the server by pressing Ctrl + C in the terminal where it’s running.

Uninstall JupyterLab (Optional)

If you wish to remove JupyterLab from your system, you can do so using pip:

💻Code
pip3 uninstall jupyterlab

Confirm the uninstallation when prompted.

Conclusion:

  • JupyterLab offers a powerful environment for data analysis, visualization, and machine learning
  • Explore the features of JupyterLab and consider installing extensions to enhance your experience
  • Consider JupyterLab as a valuable tool for collaborative work and efficient workflow in data-centric tasks

Frequently Asked Questions

What are the prerequisites for installing JupyterLab on Ubuntu?

To install JupyterLab on Ubuntu, you need Python 3.x and pip (Python package installer) installed on your system. Make sure to update your system's package index before starting the installation.

How do I create a virtual environment for JupyterLab?

You can create a virtual environment for JupyterLab by using the command 'python3 -m venv venv' after creating a new directory for your project. This isolates your JupyterLab installation from the rest of your system.

How can I start JupyterLab after installation?

To start JupyterLab, run the command 'jupyter-lab' in your terminal. This will open JupyterLab in your default web browser, or you can manually visit the provided URL, usually http://localhost:8888/lab.

Can I use different programming languages in JupyterLab notebooks?

Yes, JupyterLab supports multiple programming languages through the use of different kernels. You can create notebooks in various languages, but ensure that the necessary kernels are installed for the languages you want to use.

How do I save my work in a JupyterLab notebook?

To save your work in a JupyterLab notebook, you can click the save icon or navigate to the File menu and select 'Save Notebook'. This ensures that your code and outputs are preserved for future use.

Was this guide helpful?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Exit mobile version