JupyterLab AI Server Deployment Guide

(Ubuntu 22.04 / 24.04)

1. Overview

This server is automatically deployed using a production-grade installation script with the following features:

  • Ubuntu 22.04 / 24.04 support
  • Python virtual environment isolation
  • JupyterLab (Jupyter Server 2.x)
  • Password authentication via IdentityProvider
  • Systemd service management
  • Nginx reverse proxy
  • GPU-aware auto PyTorch installation
  • Automatic apt lock handling & retry logic

JupyterLab is accessible at:

http://<SERVER-IP>/

2. Deployment Architecture

Directory Structure

Component Path
Python virtual environment /opt/jupyterlab/venv
Jupyter configuration /home/administrator/.jupyter/
Jupyter config file /home/administrator/.jupyter/jupyter_server_config.json
Systemd service /etc/systemd/system/jupyter-lab.service
Nginx config /etc/nginx/sites-available/jupyterlab
Installation log /var/log/install-jupyterlab.log

Runtime Flow

Browser
   ↓
Nginx (Port 80)
   ↓
JupyterLab (127.0.0.1:8888)
  • Jupyter listens locally only
  • Public access is handled by Nginx
  • Token authentication is disabled
  • Password authentication is enabled

3. GPU Auto-Detection & PyTorch Installation

During installation, the script automatically:

  1. Detects NVIDIA GPU using nvidia-smi
  2. Reads Compute Capability
  3. If Compute Capability ≥ 7.0
  4. Automatically installs:
torch
torchvision
torchaudio

If:

  • No GPU detected → skipped
  • Compute Capability < 7.0 → skipped

This ensures:

  • Modern GPUs (V100, A100, RTX 30/40 series, A6000, etc.) get PyTorch automatically
  • Older GPUs or CPU-only servers remain lightweight

4. Accessing JupyterLab

Open browser:

http://<SERVER-IP>/

Login using the configured password.


5. Service Management

Restart Jupyter

sudo systemctl restart jupyter-lab

Stop Jupyter

sudo systemctl stop jupyter-lab

Start Jupyter

sudo systemctl start jupyter-lab

Check Status

sudo systemctl status jupyter-lab

6. Nginx Management

Restart:

sudo systemctl restart nginx

Check status:

sudo systemctl status nginx

7. Changing the Password

There are two supported methods.


Step 1 — Switch to administrator

sudo -i -u administrator

Step 2 — Activate virtual environment

source /opt/jupyterlab/venv/bin/activate

Step 3 — Change password

jupyter lab password

Follow the prompts.

Step 4 — Restart Jupyter

exit
sudo systemctl restart jupyter-lab

Done.


Method 2 — Manual (Advanced Users)

Activate environment

source /opt/jupyterlab/venv/bin/activate

Generate password hash

python -c "from jupyter_server.auth import passwd; print(passwd())"

Edit configuration

sudo nano /home/administrator/.jupyter/jupyter_server_config.json

Replace:

"hashed_password": "OLD_HASH"

Restart:

sudo systemctl restart jupyter-lab

8. Installing Additional Python Packages

Activate:

source /opt/jupyterlab/venv/bin/activate

Install:

pip install <package-name>

Example:

pip install transformers
pip install pandas

Restart if needed:

sudo systemctl restart jupyter-lab

9. Logs

Installation log

sudo cat /var/log/install-jupyterlab.log

Jupyter runtime logs

sudo journalctl -u jupyter-lab -f

Nginx logs

sudo tail -f /var/log/nginx/access.log
sudo tail -f /var/log/nginx/error.log

10. Default Ports

Service Port
Public Access (Nginx) 80
Internal Jupyter 8888

Port 8888 is not exposed externally.


Final Summary

This AI-ready Jupyter deployment provides:

  • Secure authentication
  • GPU-aware optimization
  • Automatic PyTorch installation
  • Production-grade service management
  • Clean virtual environment isolation
  • Ubuntu compatibility
  • Cloud-init readiness

It is designed for scalable AI infrastructure and GPU server environments.

Last Updated:   07/08/2026
Outline