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
- Download the version of MATLAB you want from the site
- Run sudo unzip -X -K matlab_version_Linux.zip
- Open terminal in that folder
- Run this to install:
xhost +SI:localuser:root
sudo -H ./install
xhost -SI:localuser:root - Add a link to the application: /usr/local/MATLAB/version/bin/glnxa64/MATLAB with option -desktop
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