# Download and install MATLAB runtime package | MATLAB

In this tutorial, we will learn how to download and install **MATLAB runtime** package. MATLAB runtime allows to run compiled MATLAB applications or components without having MATLAB installed on a target machine.

## Usage of MATLAB runtime

MATLAB runtime enables you to create and distribute applications, simulations, or software components created using MATLAB/Simulink. It allows to run compiled MATLAB/Simulink applications to run without having MATLAB installed on a target machine.

## Approach 1: Using command window in MATLAB

Run the following command inside the MATLAB command window to start the download. Once, the download completes the matlab will provide the relevant **(.zip**).

![MATLAB runtime download using MATLAB command window](https://cdn.hashnode.com/res/hashnode/image/upload/v1708543614904/3a1cb534-e592-4fd3-98ed-050adf9bada2.jpeg align="center")

**Note**  
Depending on the MATLAB runtime version the download size may vary from **1** – **5** GB and can take significant download time.

## Approach 2: Using MATLAB runtime webpage

The MATLAB runtime package can be download from the official MATLAB website using the following link:  
[MATLAB Runtime – MATLAB Compiler – MATLAB (mathworks.com)](https://nl.mathworks.com/products/compiler/matlab-runtime.html)

The web page offers multiple versions for MATLAB Runtime and the user can download the relevant package as per their requirements.

![MATLAB runtime download using webpage](https://cdn.hashnode.com/res/hashnode/image/upload/v1708543722006/f9faa7fb-4a88-4751-a3fc-c056dcef0b75.jpeg align="center")

Once the download completes you can **unzip** the MATLAB runtime package(.zip) and proceed to installation.

**Note**  
The MATLAB runtime is version specific.

## Installing MATLAB runtime

### Windows

\[1\] **Unzip** the MATLAB Runtime installer (.zip) package.

For example:

Right-click the zip file `MATLAB_Runtime_R2022a_win64.zip` and select **extract all**.

\[2\] Double-click the file `setup.exe` from the extracted files to start the installer.

\[3\] Default installation folder: C:\\Program Files\\MATLAB\\MATLAB Runtime\\R2022a

### Linux

\[1\] **Unzip** the MATLAB Runtime installer (.zip) at the terminal using the `unzip` command.

For example:

If you are unzipping the R2022a MATLAB Runtime installer then at the terminal type:

**unzip** MATLAB\_Runtime\_R2022a\_glnxa64.zip

\[2\] At the terminal type:

sudo -H ./install

**Note**  
You may need to allow the root user to access the running X server:

* xhost +SI:localuser:root
    
* sudo -H ./install
    
* xhost -SI:localuser:root
    

\[3\] Default installation folder: /usr/local/MATLAB/MATLAB\_Runtime/R2022a

### Mac

\[1\] **Unzip** the MATLAB Runtime installer (.zip) at the terminal using the `unzip` command.

For example:

If you are unzipping the R2022a MATLAB Runtime installer then at the terminal type:

**unzip** MATLAB\_Runtime\_R2022a\_maci64.zip

\[2\] At the terminal type:

sudo -H ./install

\[3\] Default installation folder: /Applications/MATLAB/MATLAB\_Runtime/R2022a

**Note**  
On **Linux** or **MAC** platform you have to setup the path environment variables MATLAB runtime to work properly. For instructions on setting the path environment variables, see official guide on how to [Set MATLAB Runtime Path for Deployment](https://nl.mathworks.com/help/compiler/mcr-path-settings-for-run-time-deployment.html).

## Checking MATLAB runtime version

Use **mcrversion** in command window to return the return MATLAB Runtime version number that matches MATLAB version.

Use **mcrinstaller** in command window to return version and location information for MATLAB Runtime installer corresponding to your current platform.

* **Note**  
    If MATLAB runtime is not already installed on your system it displays you the option to download it via MATLAB command window:
    
    ![mcrinstaller not finding MATLAB runtime package](https://cdn.hashnode.com/res/hashnode/image/upload/v1708543690662/da1780e3-2feb-4ea7-9839-653359ec79f2.jpeg align="center")
