Jupyter MATLAB Proxy¶
Overview¶
Jupyter MATLAB Proxy (jupyter-matlab-proxy) lets you run MATLAB inside JupyterLab, either as a notebook kernel or as a full graphical MATLAB Desktop streamed into a browser tab.
Setting Up the Environment¶
Create a conda environment
A dedicated environment is recommended, but not required — you can use any existing environment or base.
Verify the MATLAB kernelspec
The package installs a kernelspec utility that points the MATLAB kernel at the correct Python executable for this environment.
The utility also allows you to preview changes without applying them (--preview), or to reset the kernelspec back to its default configuration (--reset). For more information about the utility, use --help:
Running on a Compute Node¶
Start an interactive session and load both MATLAB and your conda environment before launching Jupyter.
Interactive session
Port may already be in use
8888 is just an example. Since --ip=0.0.0.0 listens on all interfaces, another user's job on the same node may already be using that port. If so, pick a different one.
Running Jupyter on PERUN
See https://wiki.perun.tuke.sk/perun/env/jupyter for more details on running Jupyter notebooks on PERUN.
Accessing JupyterLab from Your Local Machine¶
Since Jupyter is running on a compute node, not directly reachable from outside the cluster, tunnel through the login node.
SSH port forward
Then open the URL Jupyter printed at startup (with the token), replacing the hostname with localhost:
Find your compute node
TheNODELIST column shows which node your job landed on.
Using the MATLAB Kernel¶
Once JupyterLab is open, create a new notebook and select MATLAB Kernel. Cells execute MATLAB code directly.
Simple sanity check
Using the Full MATLAB Desktop¶
Click Open MATLAB from the JupyterLab launcher to open a full graphical MATLAB Desktop in a new browser tab, streamed via matlab-proxy.
Enabling Debug Logging¶
If something isn't starting correctly, enable verbose logging before launching Jupyter.
Debug logging
Log levels available: NOTSET, DEBUG, INFO, WARN, ERROR, CRITICAL (default is INFO).
Troubleshooting¶
Unable to find Xvfb on the system PATH
This is a system-level dependency issue. Contact the cluster admins.
MATLAB cannot be run on login nodes
If you see this error when loading the MATLAB module, you're on a login node. Start an interactive session with srun first, or submit via sbatch.
Run the official diagnostic script
MathWorks ships a troubleshooting script that checks your MATLAB, Python, Xvfb, and Jupyter setup in one pass. Run it on a compute node with the MATLAB module loaded:
More Information¶
Documentation
Official jupyter-matlab-proxy repository and documentation: