pixel

How to Install MATLAB on Rocky Linux 10

Share on Social Media

Learn how to install MATLAB on Rocky Linux 10 step by step! From dependencies to activation, this guide makes setup easy and error-free. Don’t miss out on unlocking MATLAB’s full power on Linux—get it running today before you fall behind! #centlinux #linux #matlab


Table of Contents


Introduction

MATLAB, short for Matrix Laboratory, is one of the most powerful programming environments and simulation tools widely used in engineering, data science, artificial intelligence, and research. While it is commonly installed on Windows and macOS, Linux users often prefer it because Linux offers better performance, stability, and control over system resources. For data-heavy tasks such as simulations, deep learning, and mathematical modeling, running MATLAB on Rocky Linux 10 can provide significant speed and stability advantages.

So why specifically Rocky Linux 10? After the end-of-life announcement of CentOS, Rocky Linux emerged as a community-driven alternative. Built to be enterprise-grade, it is binary-compatible with Red Hat Enterprise Linux (RHEL). This makes it a perfect operating system for research labs, academic environments, and enterprises that need long-term support and compatibility.

Installing MATLAB on Rocky Linux 10 may seem tricky at first glance, especially if you are transitioning from a Windows or Mac environment. Unlike those systems, Linux requires you to install dependencies manually, manage permissions, and run installer scripts via the terminal. However, once set up, MATLAB runs seamlessly and can integrate with other open-source tools like Python, Octave, and GNU libraries.

In this guide, we’ll walk through everything step by step: from preparing your system, downloading MATLAB, installing dependencies, running the installer, and finally activating your license. Whether you’re a student, researcher, or professional engineer, by the end of this tutorial, you’ll have MATLAB fully functional on your Rocky Linux 10 system.

How to install MATLAB on Rocky Linux 10
How to install MATLAB on Rocky Linux 10

Prerequisites Before Installation

Before diving into installation, it’s important to prepare your Rocky Linux 10 system. MATLAB is resource-intensive, so ensuring your system meets the minimum requirements is essential.

System Requirements for MATLAB (Typical 2025 Release)

  • Processor: Any x86_64-compatible processor (Intel/AMD, 4 cores recommended)
  • RAM: Minimum 4 GB, recommended 8–16 GB for large computations
  • Disk Space: At least 10 GB for MATLAB itself; 20+ GB recommended if installing toolboxes
  • Graphics: OpenGL support for visualization and Simulink
  • Operating System: Rocky Linux 10 (64-bit)

In addition to meeting the basic system requirements outlined by verifying your Linux distribution, kernel version, CPU details, available memory, and disk space, it’s important to have reliable hardware for a smooth MATLAB experience on Rocky Linux 10. For those experimenting or doing development work, a compact Mini PC or a lightweight Laptop can be an excellent choice.

These devices often provide the right balance of performance and portability, making it easier to run MATLAB efficiently while maintaining flexibility. Consider options like [Mini PCs on Amazon] or [Laptops on Amazon] that are compatible with Linux systems and offer sufficient CPU power and memory to handle MATLAB’s computational needs.

You can quickly check your system specifications using commands like:

cat /etc/os-release
uname -r
lscpu
free -h
df -h

These commands confirm your Linux distribution, kernel version, CPU details, available memory, and disk space.

For a more detailed about checking Linux System specification you can watch our video:

YouTube player

Checking Compatibility

Rocky Linux 10 is based on RHEL, which MATLAB supports under its Linux compatibility list. This means MATLAB will work as long as dependencies are properly installed.

Preparing Your Linux Environment

Update your system:

sudo dnf update -y 

This ensures all system packages are up to date.

Install essential tools:

sudo dnf groupinstall "Development Tools" -y 
sudo dnf install wget curl unzip tar -y 

These utilities are required for extracting files and building dependencies.

Create a dedicated installation directory:

mkdir -p ~/MATLAB 
cd ~/MATLAB 

Keeping MATLAB in a separate directory avoids conflicts with system files.

By the end of this step, your Rocky Linux 10 system should be ready for the next stage: downloading MATLAB.


Downloading MATLAB for Rocky Linux 10

To install MATLAB, you first need the official installer package, which can only be obtained from MathWorks.

1. Create a MathWorks Account

If you don’t already have one, go to MathWorks website and sign up. A MathWorks account is mandatory for downloading MATLAB and managing your license. If you’re a student, you can often use your university email to get a free or discounted academic license.

2. Accessing the MATLAB Installer

Once logged in:

  • Navigate to the Downloads section.
  • Select the version of MATLAB you want (preferably the latest release, as it includes bug fixes and new features).
  • Choose Linux (64-bit) as the operating system.

3. Choosing the Correct Version for Rocky Linux

Since Rocky Linux is RHEL-compatible, you should download the RHEL/CentOS version of MATLAB. MathWorks typically provides a .zip file containing the installer.

4. Download the Installer to Your Linux Machine

You can either download it directly through your browser or use wget in the terminal:

wget -O matlab_installer.zip "https://www.mathworks.com/downloads/matlab_installer_link"

(Replace the link with the actual one from your MathWorks account.)

5. Extract the Installer

unzip matlab_installer.zip -d matlab_installer
cd matlab_installer

At this point, you have the MATLAB installer ready. The next step is to make sure your system has the required dependencies before running it.


Installing Required Dependencies

MATLAB depends on certain libraries and tools to function properly on Linux. If these are missing, the installer may fail, or MATLAB might not run correctly after installation.

1. Install Common Dependencies

Run the following command to install essential libraries:

sudo dnf install -y epel-release
sudo dnf install -y libX11 libXext libXmu libXtst mesa-libGLU libXi libXrandr

These libraries are crucial for MATLAB’s graphical interface and Simulink.

2. Additional Libraries for Compatibility

Some MATLAB toolboxes require Java and GCC compilers:

sudo dnf install -y java-11-openjdk gcc gcc-c++ make

If you plan to use MATLAB with external compilers or parallel computing, installing these ensures smooth integration.

3. Verifying Dependencies

Check installed libraries using:

ldd /usr/lib64/libX11.so

If no “not found” errors appear, your system is ready.

4. Optional: NVIDIA GPU Drivers (for CUDA & Deep Learning)

If you want to accelerate MATLAB with your GPU, install CUDA and NVIDIA drivers:

sudo dnf install -y dkms kernel-devel

Then download NVIDIA’s official drivers.

With dependencies installed, you’re now ready to run the MATLAB installer itself.

Read Also: VLLM Docker: Fast LLM Containers Made Easy


Step-by-Step MATLAB Installation Process

Now comes the most important part—installing MATLAB.

1. Launch the Installer

Navigate to your extracted folder and run:

sudo ./install

This will start the graphical installer. If you prefer a silent (command-line) installation, you can use:

sudo ./install -inputFile installer_input.txt

(Where installer_input.txt contains predefined installation options.)

2. Sign in with Your MathWorks Account

The installer will prompt you to log in. Use the account linked to your license.

3. Choose Installation Method

  • Online installation (downloads files as it installs).
  • Offline installation (if you already downloaded all files).

4. Select License Activation Method

  • Individual License: Enter your MathWorks credentials.
  • Network/University License: Provide the license server address.
  • File Installation Key (FIK): If provided by your institution.

5. Select Toolboxes

You can choose which toolboxes to install, e.g., Simulink, Statistics, Deep Learning Toolbox. Each requires additional disk space.

6. Choose Installation Directory

By default:

/usr/local/MATLAB/R2025a

You may change it, but /usr/local/ is recommended.

7. Finish Installation & Verify

Once installed, start MATLAB using:

/usr/local/MATLAB/R2025a/bin/matlab

If everything is set up correctly, the MATLAB GUI should launch.


Configuring MATLAB After Installation

Once MATLAB is installed on Rocky Linux 10, you need to configure it properly to ensure smooth performance. Simply installing the software doesn’t guarantee that it will run without issues, especially if you plan to integrate it with other tools, compilers, or GPUs. Configuration ensures that MATLAB recognizes all necessary paths, libraries, and environment variables.

1. Adding MATLAB to PATH

If you want to run MATLAB from the terminal without navigating to its installation directory each time, add it to your system PATH:

echo 'export PATH=/usr/local/MATLAB/R2025a/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Now, typing matlab in the terminal should launch the program.

2. Configuring Java Environment (Optional)

MATLAB uses Java for many of its functionalities. Sometimes mismatched Java versions cause issues. To fix this, point MATLAB to the correct Java installation:

export MATLAB_JAVA=/usr/lib/jvm/java-11-openjdk-11

Add this line to your .bashrc for permanent effect.

3. Setting Default Startup Directory

By default, MATLAB opens in your home directory. To change it, edit:

vi ~/.matlab/R2025a/matlab.prf

Look for the General/StartInLastWorkingDir setting and modify accordingly.

4. GPU Configuration for MATLAB

If you have an NVIDIA GPU and installed CUDA, verify GPU recognition inside MATLAB by running:

gpuDevice

If it detects your GPU, you’re ready for accelerated computing.

5. Compiler Setup for MEX Files

To compile external C/C++ or Fortran code, configure MATLAB’s mex function:

mex -setup

This allows MATLAB to use GCC or other compilers for building custom functions.

With these adjustments, MATLAB will be fully integrated into your Rocky Linux environment and optimized for daily use.


Running MATLAB from the Terminal

While you can always run MATLAB through its GUI, Linux users often prefer the terminal mode for efficiency.

1. Launching MATLAB GUI

If you want the graphical interface:

matlab

This opens the full MATLAB environment.

2. Running MATLAB in No-Desktop Mode

For users who prefer minimal resource usage (or working remotely via SSH):

matlab -nodesktop

This launches MATLAB without its desktop environment, giving you a command-line interface.

3. Running MATLAB in Batch Mode

For executing scripts without user interaction:

matlab -batch "myscript"

This runs myscript.m and exits automatically after completion. It’s perfect for automated tasks and server environments.

4. Running MATLAB in Background (Detached Mode)

You can run MATLAB jobs in the background using:

nohup matlab -batch "myscript" &

This ensures MATLAB continues running even if you log out of your session.

5. Creating a Desktop Shortcut (Optional)

If you use a graphical desktop environment (like GNOME), create a .desktop entry:

sudo nano /usr/share/applications/matlab.desktop

Paste the following:

[Desktop Entry]
Type=Application
Name=MATLAB R2025a
Exec=/usr/local/MATLAB/R2025a/bin/matlab -desktop
Icon=/usr/local/MATLAB/R2025a/bin/matlab_icon.png
Categories=Development;Science;

Now MATLAB appears in your applications menu.


Activating and Managing MATLAB License

MATLAB requires a valid license to run. Without activation, you can’t use it beyond the trial period.

1. Types of Licenses

  • Individual License – tied to your MathWorks account
  • Network License – managed by your institution
  • Trial License – free but limited time
  • File Installation Key (FIK) – used for offline setups

2. Activating Online

The easiest method is to log in during installation. MATLAB automatically activates your license.

3. Activating Offline

If your system doesn’t have internet access:

  • Obtain the license file (license.lic) from MathWorks.
  • Place it inside: /usr/local/MATLAB/R2025a/licenses/
  • Run MATLAB with:
    • matlab -licfile /usr/local/MATLAB/R2025a/licenses/license.lic

4. Checking License Status

Run inside MATLAB:

license

It will show whether your license is active and what toolboxes are available.

5. Renewing or Updating Licenses

When your license expires, renew it through MathWorks, download the updated license file, and replace the old one.


Troubleshooting Common Installation Issues

Even with careful setup, you may face some issues. Here are common problems and fixes:

1. MATLAB Installer Doesn’t Launch

  • Check if required libraries are installed (libXtst, libXrandr).
  • Run installer with for debug output.
    • sudo ./install -console

2. Blank Screen When Launching MATLAB

  • Ensure OpenGL is installed (mesa-libGLU).
  • Try launching with:
    • matlab -softwareopengl

3. License Error

  • Confirm that your license file is in the correct directory.
  • If using a network license, check if the server is running:
    • telnet license-server 27000

4. Java Version Conflict

  • MATLAB sometimes has issues with newer Java versions. Set MATLAB_JAVA to the version bundled with MATLAB.

Read Also: How to install Java on Rocky Linux 9

5. Performance Issues

  • Add more RAM swap space if MATLAB crashes on large datasets:
sudo dd if=/dev/zero of=/swapfile bs=1G count=8 
sudo chmod 600 /swapfile 
sudo mkswap /swapfile 
sudo swapon /swapfile

Watch following tutorial to learn more about increasing Swap Memory.

YouTube player

Uninstalling MATLAB on Rocky Linux 10

If you no longer need MATLAB or want to reinstall, follow these steps:

1. Remove MATLAB Files

Navigate to the installation directory and run the uninstall script:

cd /usr/local/MATLAB/R2025a/uninstall
sudo ./uninstall

2. Remove Configuration Files

Delete MATLAB preferences and cache from your home directory:

rm -rf ~/.matlab

3. Remove Desktop Shortcuts (Optional)

sudo rm /usr/share/applications/matlab.desktop

4. Remove Leftover Dependencies (Optional)

If you installed extra libraries only for MATLAB, you can remove them:

sudo dnf remove java-11-openjdk libXtst mesa-libGLU -y

5. Verify Uninstallation

Try running matlab from the terminal. If it says command not found, MATLAB has been fully removed.


Integrating MATLAB with Other Tools

MATLAB rarely works in isolation. Many users rely on integrating it with other tools like Python, C/C++, Fortran, or even cloud computing platforms. Setting up these integrations properly can supercharge your workflow.

1. MATLAB + Python Integration

MATLAB supports calling Python functions directly. First, ensure Python is installed:

sudo dnf install python3 python3-pip -y

Inside MATLAB, you can check your Python environment:

pyenv

To call a Python function in MATLAB:

py.list({'apple', 'banana', 'cherry'})

This is extremely useful if you want to leverage Python libraries like NumPy, Pandas, or TensorFlow alongside MATLAB’s capabilities.

Read Also: How to install Python on Rocky Linux 8

2. MATLAB + C/C++/Fortran

For performance-critical applications, you may need to compile external C or Fortran code. MATLAB supports this via the MEX interface. Example:

mex myfunction.c

After compiling, you can call myfunction just like any MATLAB function.

3. MATLAB + Cloud Platforms

Rocky Linux 10 works great in cloud environments like AWS, Azure, or Google Cloud. Installing MATLAB on a virtual machine allows you to run large simulations without burdening your local system.

4. MATLAB + Databases

If you work with databases, MATLAB provides toolboxes for connecting to MySQL, PostgreSQL, and SQL Server. You just need to install the appropriate drivers and configure database access.

Read Also: How to install PostgreSQL on Rocky Linux 10

Integrating MATLAB with other tools opens up endless possibilities for research, machine learning, data science, and simulation projects.


Optimizing MATLAB Performance

Out-of-the-box, MATLAB runs fine. But with a few tweaks, you can dramatically improve performance on Rocky Linux 10.

1. Memory Optimization

MATLAB can consume huge amounts of RAM. To avoid crashes:

  • Use clear to remove unused variables.
  • Store large datasets in .mat files and load them only when needed.
  • Increase Linux swap space for stability.

2. Parallel Computing

MATLAB supports multicore CPUs. Use the Parallel Computing Toolbox:

parpool('local',4)

This starts 4 workers for parallel tasks.

3. GPU Acceleration

If you have an NVIDIA GPU, install CUDA. Then inside MATLAB, check:

gpuDevice

Functions like matrix multiplication can run 10x faster with GPU acceleration.

4. Preallocating Arrays

Instead of dynamically growing arrays, preallocate memory:

A = zeros(1000,1000);

This small tweak can significantly reduce runtime.

5. Running in Headless Mode

For server environments, run MATLAB without GUI:

matlab -nodisplay -nosplash -nodesktop

Optimizing performance ensures MATLAB runs smoothly, even on large-scale projects.


Using MATLAB for Academic and Research Purposes

One of MATLAB’s biggest user bases is the academic and research community. Rocky Linux 10, being a stable, enterprise-grade OS, is perfect for research labs.

1. Student Usage

Students can use MATLAB for assignments, simulations, and research projects. Many universities provide free licenses. Installing MATLAB on Rocky Linux ensures a low-cost, high-performance environment for learning.

2. Faculty & Researchers

Researchers can leverage MATLAB for:

  • Signal processing
  • Machine learning
  • Control systems
  • Data visualization

Running MATLAB on Rocky Linux also makes it easier to integrate with HPC clusters, which are common in universities.

3. Collaboration & Sharing

MATLAB supports version control integration with Git, enabling easier collaboration among students and faculty. By running MATLAB on Rocky Linux, projects can be shared seamlessly in research teams.

4. Access to Toolboxes

MATLAB offers hundreds of specialized toolboxes for AI, robotics, deep learning, bioinformatics, finance, etc. These make it a must-have tool for academic purposes.


MATLAB Alternatives

While MATLAB is powerful, it’s also expensive. If you can’t afford it or want an open-source alternative, Rocky Linux 10 offers plenty of options.

1. GNU Octave

  • Free and open-source.
  • Very similar syntax to MATLAB.
  • Ideal for students who cannot afford MATLAB.
    Install with:
sudo dnf install octave -y

2. Scilab

  • Numerical computation platform.
  • Similar to MATLAB but with fewer toolboxes.

3. Python with NumPy/SciPy/Matplotlib

  • Free and extremely popular in data science.
  • Huge community and open-source libraries.

4. R Language

  • Specialized for statistics and data analysis.
  • Strong visualization capabilities.

While MATLAB remains the industry standard, these alternatives can be great for those who want free solutions on Rocky Linux.


Conclusion

Installing MATLAB on Rocky Linux 10 might seem challenging at first, but once you go through the steps—preparing the system, downloading MATLAB, installing dependencies, running the installer, and activating your license—it becomes straightforward. Rocky Linux’s stability and compatibility make it an excellent choice for MATLAB users, whether you’re a student, researcher, or engineer.

By configuring your environment, optimizing performance, and even integrating MATLAB with Python, GPUs, and cloud services, you can unlock its full potential. And if MATLAB isn’t an option, open-source alternatives like Octave or Python can serve as great substitutes.

At the end of the day, MATLAB on Rocky Linux 10 provides a powerful, flexible, and efficient environment for computation, research, and real-world applications.


FAQs – Install MATLAB on Rocky Linux 10

1. Can I install MATLAB on Rocky Linux 10 without internet access?
Yes, you can perform an offline installation using the File Installation Key (FIK) and license file provided by MathWorks.

2. Is MATLAB free for students on Rocky Linux?
Many universities provide free academic licenses. Otherwise, MathWorks offers student versions at a discounted price.

3. Does MATLAB run faster on Rocky Linux compared to Windows?
Yes, in many cases MATLAB runs faster and more efficiently on Linux because of better memory management and lower overhead.

4. Can I run MATLAB scripts on a server without GUI?
Yes, you can run scripts in batch mode or no-desktop mode, making it ideal for remote servers and clusters.

5. What is the best free alternative to MATLAB on Rocky Linux?
GNU Octave is the closest free alternative, with syntax very similar to MATLAB. Python with SciPy/NumPy is another great choice.


Looking for something?

Leave a Reply

Available for Amazon Prime