Jupyter Notebook is an interactive computing environment that allows you to create documents containing live Python code, equations, visualisations, and explanatory text in a single file. Notebooks (.ipynb files) are the standard format for data exploration, machine learning experiments, scientific computing, and educational tutorials because they let you execute code in small cells, inspect results immediately, and document your reasoning alongside the code. JupyterLab is the modern successor to the classic Jupyter Notebook interface, providing a full IDE-like experience with a file browser, multiple notebooks, and terminal. This guide covers installing JupyterLab on RHEL 9, configuring it with a hashed password for remote access, and setting it up as a systemd service.
Prerequisites
- Python 3.12 installed on RHEL 9
Step 1 — Install JupyterLab
python3.12 -m venv /opt/jupyter-venv
source /opt/jupyter-venv/bin/activate
pip install jupyterlab notebook pandas numpy matplotlib scikit-learn
jupyter --version
Step 2 — Generate a Secure Configuration
# Generate the default config file
jupyter lab --generate-config
# Config is written to ~/.jupyter/jupyter_lab_config.py
# Generate a hashed password (interactive)
jupyter lab password
# Enter and confirm a password — it writes the hash to ~/.jupyter/jupyter_server_config.json
Step 3 — Configure JupyterLab for Remote Access
# ~/.jupyter/jupyter_lab_config.py — key settings
c.ServerApp.ip = '0.0.0.0' # Listen on all interfaces
c.ServerApp.port = 8888
c.ServerApp.open_browser = False # No browser on server
c.ServerApp.notebook_dir = '/var/jupyter/notebooks'
c.ServerApp.allow_remote_access = True
c.ServerApp.token = '' # Disable token auth (using password instead)
# Optional: SSL/TLS (recommended for production)
# c.ServerApp.certfile = '/etc/ssl/jupyter.crt'
# c.ServerApp.keyfile = '/etc/ssl/jupyter.key'
mkdir -p /var/jupyter/notebooks
Step 4 — Create systemd Service
# /etc/systemd/system/jupyterlab.service
[Unit]
Description=JupyterLab Server
After=network.target
[Service]
Type=simple
User=jupyter
Group=jupyter
ExecStart=/opt/jupyter-venv/bin/jupyter lab
--config=/home/jupyter/.jupyter/jupyter_lab_config.py
WorkingDirectory=/var/jupyter/notebooks
Restart=on-failure
[Install]
WantedBy=multi-user.target
useradd -r -d /var/jupyter jupyter
chown -R jupyter:jupyter /var/jupyter /opt/jupyter-venv
systemctl daemon-reload
systemctl enable --now jupyterlab
Step 5 — Open Firewall Port
# Restrict JupyterLab to specific IPs (never open to 0.0.0.0 without password!)
firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address=10.0.0.0/8 port port=8888 protocol=tcp accept'
firewall-cmd --reload
# Access JupyterLab at: http://server-ip:8888
Conclusion
JupyterLab on RHEL 9 provides a browser-based interactive Python environment suitable for data science, machine learning, and exploratory analysis. The most important security step is configuring password authentication and restricting port 8888 to trusted IP ranges in the firewall — Jupyter executes arbitrary Python code on the server, so unauthenticated access is equivalent to root shell access. For production data science environments, consider running JupyterHub (multi-user server) or deploying JupyterLab behind Nginx with additional access controls.
Next steps: How to Install Python 3 on RHEL 9, How to Deploy a Django Application on RHEL 9, and How to Install TensorFlow on RHEL 9.