Analytics Vidhya
Published in

Analytics Vidhya

Jupyter Lab on Raspberry PI

<span>Photo by <a href=”;utm_medium=referral&amp;utm_content=c
Photo by Harrison Broadbent on Unsplash

Install Jupyter Lab

$ sudo apt-get update
$ sudo apt-get install python3-pip
$ sudo pip3 install setuptools
$ sudo apt install libffi-dev
$ sudo pip3 install cffi
$ pip3 install jupyterlab
$ mkdir notebooks
$ jupyter lab --notebook-dir=~/notebooks
$ jupyter lab

Setup Jupyter lab as a service

$ which jupyter-lab
$ sudo nano /etc/systemd/system/jupyter.service
Description=Jupyter Lab
ExecStart=/bin/bash -c "/home/pi/.local/bin/jupyter-lab --ip="" --no-browser --notebook-dir=/home/pi/notebooks"
$ sudo systemctl enable jupyter.service
$ sudo systemctl daemon-reload
$ sudo systemctl start jupyter.service
$ sudo systemctl stop jupyter.service
$ sudo systemctl status jupyter.servicejupyter.service - Jupyter Notebook
Loaded: loaded (/etc/systemd/system/jupyter.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2020-08-30 16:12:27 PDT; 2s ago
Main PID: 4864 (jupyter-lab)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/jupyter.service
└─4864 /usr/bin/python3 /usr/local/bin/jupyter-lab --ip= --no-browser --notebook-dir=/home/pi/notebooks
  1. Add password (easy)
  2. Using SSL for encrypted communication (recommended)
  3. SSH port forwarding (recommended)

Add password

$ jupyter notebook --generate-config
Writing default config to: /home/pi/.jupyter/
$ jupyter notebook password
Enter password: ****
Verify password: ****
[NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json

Using SSL for encrypted communication

SSH port forwarding (tunneling)

ExecStart=/bin/bash -c "/usr/local/bin/jupyter-lab --no-browser --notebook-dir=/home/pi/notebooks"
ssh -L 8888:localhost:8888 pi@192.168.xx.xx



Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store