install and configure matlab runtime
supported platforms: windows®, linux®, macos
matlab® runtime contains the libraries needed to run compiled matlab applications on a target system without a licensed copy of matlab.
download matlab runtime installer
download the matlab runtime installer using one of the following options:
download the matlab runtime installer at the latest update level for the selected release from the website at . this option is best for end users who want to run deployed applications.
use the matlab function to download the matlab runtime installer matching the version and update level of matlab from where the command is executed. if the installer has already been downloaded to the machine, it returns the path to the matlab runtime installer. if the machine is offline, it returns a url to the matlab runtime installer. this option is best for developers who want to create application installers that contain matlab runtime.
note
if you want to install matlab runtime to a shared network drive, see .
install matlab runtime interactively
to install matlab runtime:
extract the archive containing the matlab runtime installer. the release part of the installer file name (
_r2023a_
) changes from one release to the next.platform steps windows unzip the matlab runtime installer.
right-click the zip file
matlab_runtime_r2023a_win64.zip
and select extract all.linux unzip the matlab runtime installer at the terminal using the
unzip
command.for example, if you are unzipping the r2023a matlab runtime installer, at the terminal, type:
unzip matlab_runtime_r2023a_glnxa64.zip
macos
unzip the matlab runtime installer at the terminal using the
unzip
command.for example, if you are unzipping the r2023a matlab runtime installer, at the terminal, type:
unzip matlab_runtime_r2023a_maci64.zip
start the matlab runtime installer.
platform steps windows double-click the file
setup.exe
from the extracted files to start the installer.linux at the terminal, type:
sudo -h ./install
sudo
is only required if you install to a directory that you do not have write access to.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
macos
at the terminal, type:
./install
note
you may need to enter an administrator user name and password after you run
./install
.when the matlab runtime installer starts, it displays a dialog box. read the information and then click next to proceed with the installation.
in the folder selection dialog box, specify the folder where you want to install matlab runtime.
note
you can have multiple versions of matlab runtime on your computer, but only one installation for any particular version. if you have an existing installation of the same version, the matlab runtime installer does not display the folder selection dialog box because it overwrites the existing installation in the same folder.
confirm your choices and click next.
the matlab runtime installer starts copying files into the installation folder.
on linux and macos platforms, after copying files to your disk, the matlab runtime installer displays the product configuration notes dialog box. this dialog box contains information necessary for setting your path environment variables. copy the path information from this dialog box, save it to a text file, and then click next.
for instructions on setting the path environment variables, see .
click finish to exit the installer.
default install folder
the default matlab runtime installation folders for r2023a are specified in the following table:
operating system | matlab runtime installation folder |
---|---|
windows | c:\program files\matlab\matlab runtime\r2023a |
linux | /usr/local/matlab/matlab_runtime/r2023a |
macos | /applications/matlab/matlab_runtime/r2023a |
install matlab runtime noninteractively
if you have many installations to perform, you can specify installation arguments as command-line arguments or in an installer control file to save time and prevent errors. when you specify installation arguments, the matlab runtime installer runs as a background task and does not display any dialog boxes.
when running noninteractively, the installer overwrites the installation location.
caution
on linux and macos systems, the installer displays information necessary for setting your environment variables in the product configuration notes dialog box. if you use the installer noninteractively, you must locate your matlab runtime installation directory in order to set the library path after installation. for more information, see .
run installer in silent mode
to install matlab runtime in silent mode:
extract the contents of the matlab runtime installer archive to a temporary folder.
in your system command prompt, navigate to the folder where you extracted the installer.
run the matlab runtime installer, specifying the
-agreetolicense yes
option on the command line. if you do not include-agreetolicense yes
as the first option, the installer will not install matlab runtime.note
on most platforms, the installer is located at the root of the folder into which the archive was extracted. on 64-bit windows, the installer is located in the archive
bin
folder.platform command windows setup -agreetolicense yes
linux sudo ./install -agreetolicense yes
note
sudo
is only required if you install to a directory you do not have write access to.macos ./install -agreetolicense yes
note
to install matlab runtime r2022a and earlier, you must also specify
-mode silent
in the command.view a log of the installation.
on windows systems, the installer creates a log file named
mathworks_
, whereusername
.logusername
is your windows login name, in the location defined by yourtemp
environment variable.on linux and macos systems, the installer displays the log information at the command prompt. it also saves it to a file if you use the
-outputfile
option.
customize noninteractive installation
when run noninteractively, the installer uses the default values unless you specify otherwise. like the matlab installer, the matlab runtime installer accepts a number of options that modify the default installation properties.
to specify additional options on the command line, separate each option and its value with a space. for example, on linux:
./install -agreetolicense yes \
-outputfile myapp_log.txt -destinationfolder ~/mw/matlab_runtime
option | description |
---|---|
-agreetolicense | agree to the matlab runtime license. |
-destinationfolder | specifies where matlab runtime is installed. |
-outputfile | specifies where the installation log file is written. |
-inputfile | specifies an installer control file that contains your command-line options and values. omit the dash before each option, and put each option and value pair on a separate line. for example: agreetolicense=yes outputfile=myapp_log.txt |
note
the matlab installer archive includes an example installer control file
called installer_input.txt
. this file contains all of the
options available for a full matlab installation. the matlab runtime installer only accepts the options listed in this section.
install matlab runtime without administrator rights
on linux, to install matlab runtime without sudo
privileges, select a folder that you have
write access to during installation.
on windows, to install matlab runtime as a user without administrator rights:
install matlab runtime on a windows machine where you have administrator rights.
copy the folder where matlab runtime was installed to the machine without administrator rights. you can compress the folder into a zip file for distribution.
on the machine without administrator rights, add the
directory to the user’s
\runtime\arch
path
environment variable. for more information, see .
install multiple matlab runtime versions on single machine
mcrinstaller
supports the installation of multiple versions of
matlab runtime on a target machine. this capability allows applications compiled with
different versions of matlab runtime to execute side by side on the same machine.
if you do not want multiple matlab runtime versions on the target machine, you can remove the unwanted ones. on windows, run add or remove programs from the control panel to remove a specific version. on linux, manually delete the unwanted matlab runtime directories. you can remove unwanted versions before or after installation of a more recent version of matlab runtime because versions can be installed or removed in any order.
note
installing multiple versions of matlab runtime on the same machine is not supported on macos.
matlab and matlab runtime on same machine
to test your deployed component on your development machine, you do not need an installation of matlab runtime. the matlab installation that you use to compile the component can act as a matlab runtime replacement.
you can install matlab runtime for debugging purposes.
modify path
if you install matlab runtime on a machine that already has matlab on it, you must adjust the system library path according to your needs.
to run deployed matlab code against matlab runtime rather than matlab, ensure that your library path lists the matlab runtime directories before any matlab directories. for information on setting environment variables, see .
alternatively, you can specify the location of matlab runtime using the generated shell script for your compiled application.
uninstall matlab runtime
windows
start the uninstaller.
from the windows start menu, search for the add or remove programs control panel, and double-click matlab runtime in the list.
you can also start the matlab runtime uninstaller from the
\bin\
folder, where
is your matlab runtime installation folder and
is an architecture-specific folder, such aswin32
orwin64
.select matlab runtime from the list of products in the uninstall products dialog box and click next.
click finish.
linux
close all instances of matlab and matlab runtime.
enter this command at the linux terminal:
rm -rf
caution
be careful when using the
rm
command, as deleted files cannot be recovered.
macos
close all instances of matlab and matlab runtime.
navigate to your matlab runtime installation folder. for example, the installation folder might be named
matlab_compiler_runtime.app
in your applications folder.drag your matlab runtime installation folder to the trash, and then select empty trash from the finder menu.