How to install MATLAB on Linux

Are you also being forced by someone to use Matlab, even though your OS is Linux? Have you also had a right old struggle getting it to work?
I might have managed to find a way to make it work (more or less) by piecing together a few answers from various online forums.

I can’t promise it will work on every distribution, but it certainly does on Ubuntu 25.10 with Wayland.

Installation steps

  1. Download the version of MATLAB you want from the site
  2. Run sudo unzip -X -K matlab_version_Linux.zip
  3. Open terminal in that folder
  4. Run this to install: xhost +SI:localuser:root
    sudo -H ./install
    xhost -SI:localuser:root
  5. Add a link to the application: /usr/local/MATLAB/version/bin/glnxa64/MATLAB with option -desktop
The icon for MATLAB application is in /usr/local/MATLAB/version/bin/glnxa64/cef_resources.
The icon for `.m` files is /usr/local/MATLAB/version/toolbox/matlab/icons/appcontainer.ico.

Important note

If MATLAB does not work or crashes during initialization run the following code to reinstall the service-host: wget https://www.mathworks.com/MathWorksServiceHost/glnxa64/ReinstallMathWorksServiceHost
chmod +x ReinstallMathWorksServiceHost
./ReinstallMathWorksServiceHost
chmod -x ReinstallMathWorksServiceHost