Upgrading to JupyterLab on Ubuntu
Tags: datascience, python, devops
Published: 2019-06-23 21:05:51

---
title: Upgrading to JupyterLab on Ubuntu
published: true
tags: Data Science,Python,DevOps
canonical_url: https://hackersandslackers.com/upgrading-to-jupyter-lab-on-ubuntu/
---

 ![Upgrading to JupyterLab on Ubuntu](https://hackersandslackers.com/content/images/2019/04/jupyterlab-1-1.jpg)

Last we chatted, we walked through the process of getting started with [Jupyter notebooks on a Ubuntu server](https://dev.to/hackersandslackers/running-jupyter-notebooks-on-a-ubuntu-server-3340). The classic Jupyter notebook interface is certainly well-suited to the job done. That said, it only takes some time of getting lost in the interface to start thinking we can do better. That's where Jupyter Lab comes in.

## Why JupyterLab?

JupyterLab is sometimes referred to as "the next generation of Jupyter notebooks," which is a statement I can attest to. JupyterLab offers an improved interface for Jupyter notebooks which is both available out of the box, as well as highly customizable for your workflow.

Out of the box, the traditional Jupyter interface is extended to include a tree file manager: similar to what you might expect from an IDE. This allows you to easily browse _all_ available notebooks on your server. In addition, the notebook interface has been simplified to reduce noise brought on by (mostly useless) toolbars and excessive buttons. Take a look at the interface prior to any customization:

<!--kg-card-begin: image-->

![Upgrading to JupyterLab on Ubuntu](https://hackersandslackers.com/content/images/2019/04/jupyterlab-no-customization.png)

<!--kg-card-end: image-->

Even more appealing than an updated interface is JupyterLab's openness to _customization_. JupyterLab has a strongly growing ecosystem for extension development: we'll be getting a taste of some of those goodies in just a moment.

## Getting Started

If you're starting from scratch, go ahead and follow the same steps in the [Jupyter Notebook setup tutorial](https://dev.to/hackersandslackers/running-jupyter-notebooks-on-a-ubuntu-server-3340) up until Conda is set up and activated.

With a Ubuntu server prepped and ready, install Jupyter Lab with the following command:

<!--kg-card-begin: markdown-->
```
$ conda install -c conda-forge jupyterlab

```
<!--kg-card-end: markdown-->

Before we go any further, make sure you're tunneled into your server - we need to do this in order to launch notebooks, remember?:

<!--kg-card-begin: markdown-->
```
$ ssh -L 8888:localhost:8888 myuser@your_server_ip

```
<!--kg-card-end: markdown-->

Start up the Jupyter Lab environment like this:

<!--kg-card-begin: markdown-->
```
$ conda activate your_env
$ jupyter lab

```
<!--kg-card-end: markdown-->

If everything went well, you should be greeted with a fancy Jupyter Lab loading screen and then thrown into the Jupyer Lab environment.

<!--kg-card-begin: image-->

![Upgrading to JupyterLab on Ubuntu](https://hackersandslackers.com/content/images/2019/04/jupyter-lab-home.png)<figcaption>Home sweet home.</figcaption>

<!--kg-card-end: image-->

Things are looking good right off the bat. Without any added libraries, we've already beefed up our Jupyter Notebook workspace. The tree view is available, we can launch terminals, and don't forget: we can split screen by dragging snapping windows where we see fit.

## Customizing Your Workspace

JupyterLab uses NodeJS to enable some of its cooler functionality and extensions.  Go ahead and install Node:

<!--kg-card-begin: markdown-->
```
$ cd /tmp
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs

```
<!--kg-card-end: markdown-->

Nice! Now we have all we need to go nuts with extensions. Here are the ones I recommend:

### Status Bar
<!--kg-card-begin: hr-->
* * *
<!--kg-card-end: hr--><!--kg-card-begin: image-->

![Upgrading to JupyterLab on Ubuntu](https://hackersandslackers.com/content/images/2019/04/jupyterlab-statusbar.gif)<figcaption>Keep an eye on your environment's vitals.</figcaption>

<!--kg-card-end: image-->

Repository found [here](https://github.com/jupyterlab/jupyterlab-statusbar). Installation steps:

<!--kg-card-begin: markdown-->
```
$ pip install nbresuse
$ jupyter serverextension enable --py nbresuse
$ jupyter labextension install @jupyterlab/statusbar

```
<!--kg-card-end: markdown-->
### Table of Contents
<!--kg-card-begin: image-->

![Upgrading to JupyterLab on Ubuntu](https://hackersandslackers.com/content/images/2019/04/jupyterlab-toc.gif)<figcaption>Auto-generate table of contents to help navigate and organize your notebooks.</figcaption>

<!--kg-card-end: image-->

Repository found [here](https://github.com/jupyterlab/jupyterlab-toc). Installation steps:

<!--kg-card-begin: markdown-->
```
$ jupyter labextension install @jupyterlab/toc

```
<!--kg-card-end: markdown-->
### Variable Inspector
<!--kg-card-begin: hr-->
* * *
<!--kg-card-end: hr--><!--kg-card-begin: image-->

![Upgrading to JupyterLab on Ubuntu](https://hackersandslackers.com/content/images/2019/04/jupyterlab-vars.gif)<figcaption>Keep tabs on every variable used in your notebook and their respective values.</figcaption>

<!--kg-card-end: image-->

Repository found [here](https://github.com/lckr/jupyterlab-variableInspector). Installation steps:

<!--kg-card-begin: markdown-->
```
$ jupyter labextension install @lckr/jupyterlab_variableinspector

```
<!--kg-card-end: markdown-->
### Git Integration
<!--kg-card-begin: hr-->
* * *
<!--kg-card-end: hr--><!--kg-card-begin: image-->

![Upgrading to JupyterLab on Ubuntu](https://hackersandslackers.com/content/images/2019/04/jupyter-git.gif)<figcaption>A visual approach to version control.</figcaption>

<!--kg-card-end: image-->

Repository found [here](https://github.com/jupyterlab/jupyterlab-git). Installation steps:

<!--kg-card-begin: markdown-->
```
$ jupyter labextension install @jupyterlab/git
$ pip install jupyterlab-git
$ jupyter serverextension enable --py jupyterlab_git

```
<!--kg-card-end: markdown-->
### Draw.io
<!--kg-card-begin: hr-->
* * *
<!--kg-card-end: hr--><!--kg-card-begin: image-->

![Upgrading to JupyterLab on Ubuntu](https://hackersandslackers.com/content/images/2019/04/drawio.gif)<figcaption>Create Draw.io diagrams right from your notebook.</figcaption>

<!--kg-card-end: image-->

Repository found [here](https://github.com/QuantStack/jupyterlab-drawio). Installation steps:

<!--kg-card-begin: markdown-->
```
$ jupyter labextension install jupyterlab-drawio

```
<!--kg-card-end: markdown-->
## Additional Resources

You have everything you need to go nuts from here forward. INSTALL ALL THE EXTENSIONS!

If you're looking for more extension goodness, I'd start with the [Awesome Jupyter](https://github.com/markusschanta/awesome-jupyter#jupyterlab-extensions) repo on Github- there's a section specifically for JupyterLab.

If you're totally into JupyterLab now and want to join a gang, the community page can be found [here](https://github.com/topics/jupyterlab-extension).

Lastly, if you've gone totally off the deep end and already want to start creating extensions of your own, check out the [extension documentation](https://jupyterlab.readthedocs.io/en/stable/user/extensions.html). That's all folks!