References:

Vultr

How to Install Jupyter Notebook on Ubuntu 24.04

https://docs.vultr.com/how-to-install-jupyter-notebook-on-ubuntu-24-04

Prerequisites

  • Ubuntu 24.04
  • Internet access

Install Jupyter Notebook with pip

  1. Update the APT package index: sudo apt update
  2. Install the virtualenv package: sudo apt install python3-virtualenv -y
  3. Create a virtual environment: virtualenv jupyter_env
  4. Activate the virtual environment: source jupyter_env/bin/activate
  5. Install Jupyter Notebook: pip install jupyter
  6. Verify the installed version: jupyter-notebook --version

You can deactivate the virtual environment at any time by running deactivate.

If u need more gudelines please visit Vultr

Modify the configuration

# Edit the configuration file
vim ~/.jupyter_notebook_config.py

c.ServerApp.open_browser = False
c.ServerApp.allow_remote_access = True

# Set a password
jupyter notebook password

cat ~/.jupyter_server_config.json
vim ~/.jupyter_notebook_config.py

c.ServerApp.password = '___your password hash___'

# Create a startup script
#!/bin/bash
source __yourenvname__/bin/activate

CURRENT_IP=$(hostname -I | awk '{print $1}')
echo "IP Address: $CURRENT_IP"

jupyter notebook --no-browser --port 8888 --ip="$CURRENT_IP"