Install MATLAB on Linux with MPM
Goal
Install a chosen MATLAB release and set of products on a Linux machine
non-interactively, after first installing the OS-level library dependencies that
release requires. Uses MPM (the MATLAB Package Manager), the same mechanism the
official MathWorks devcontainer feature and container images use.
How it works (two stages)
- OS dependencies. MATLAB needs ~50 shared libraries (libGL, GTK,
GStreamer, fontconfig, …). The exact list depends on the release AND the
distro. The authoritative lists live in the MathWorks container-images repo:
matlab-deps/<release>/<os>/base-dependencies.txt. The script detects the
distro, maps it to the right list, downloads it, and installs it with the
native package manager (apt-get or dnf/microdnf/yum).
- MPM install. Downloads
mpm from mathworks.com and runs
mpm install --release=<R> --destination=<dir> --products <list> [flags],
then symlinks the launcher to /usr/local/bin/matlab.
Does it need root?
- Yes for a normal install. Installing system packages (step 1) and writing
to
/opt/matlab + /usr/local/bin requires root. Run with sudo.
- MPM itself does not require root. If the OS dependencies are already
present (e.g. inside a
mathworks/matlab-deps base image) and you point
--destination at a user-writable directory, MATLAB can be installed without
root. In that case skip this script's root guard and run mpm install
directly, or run this script's dependency stage once as root with
--deps-only and do the MPM step separately.
Usage
The bundled script is scripts/install-matlab.sh.
# Latest supported release (R2025b), MATLAB only, to /opt/matlab/R2025b:
sudo bash scripts/install-matlab.sh
# A specific release + products:
sudo bash scripts/install-matlab.sh \
--release R2024b \
--products "MATLAB Simulink Signal_Processing_Toolbox" \
--destination /opt/matlab/R2024b
# See exactly what would run without changing anything:
bash scripts/install-matlab.sh --dry-run --release R2024b
# Only install the OS dependencies (e.g. to bake into an image layer):
sudo bash scripts/install-matlab.sh --deps-only --release R2024b
Flags
--release <Rxxxx> — MATLAB release (default R2025b). Supported R2019a–R2026a.
To confirm the newest installable release, check that
matlab-deps/<release-lowercase>/<os>/base-dependencies.txt exists upstream
and that mpm --version is recent enough to know the release.
--products "<list>" — space-separated product names for MPM (default MATLAB).
Product names use underscores for spaces, e.g. Signal_Processing_Toolbox.
See the MPM product list docs.
--destination <dir> — install location (default /opt/matlab/<release>).
--doc — also install documentation/examples (R2022b and earlier).
--no-gpu (default) / --gpu — skip/include GPU libraries with Parallel
Computing Toolbox. --no-gpu is only honored on R2023a and later; on older
releases the script warns and installs GPU libs anyway.
--deps-only — install OS dependencies, then stop (no MPM).
--dry-run — print every command instead of executing (still fetches the
dependency list so you can see the real package set).
Environment overrides
RELEASE, PRODUCTS, DESTINATION, DOC, INSTALLGPU are read as defaults;
command-line flags win.
Workflow for Claude
- Confirm the target. Ask/derive: which release, which products, where to
install, and whether this is a bare host, a container, or a Dockerfile.
- Check the platform. This skill is Linux-only. If Windows/macOS, stop and
point at the interactive installer or matlab docs. Confirm the distro is a
Debian/Ubuntu or RHEL/Fedora family (the script exits on others).
- Preview first. Run with
--dry-run and show the user the resolved
dependency list and the exact MPM command before making changes.
- Install. Run with
sudo. For a Dockerfile, translate the two stages into
RUN lines (deps then MPM) rather than calling the script, or COPY the
script in and run it — either is fine; keep the dependency fetch in the build.
- Verify. After install, check
matlab -batch "disp(version)" or
ls <destination>/bin/matlab. Note that licensing is separate: MATLAB still
needs a license (e.g. a network license manager via MLM_LICENSE_FILE, or
online licensing at first launch) — installation does not license it.
Notes & gotchas
- Licensing is not part of installation. MPM installs bits; the user must
license MATLAB separately (network license manager, or sign-in at launch).
- Product names: spaces become underscores (
Deep_Learning_Toolbox). A
wrong name makes MPM fail — check the MPM product list if unsure.
- Unsupported OS/release combos: if the dependency list URL 404s, that
distro isn't supported for that release; the script errors out clearly.
- Debian 13 (trixie):
dpdk-named packages are filtered out (unavailable
there), matching the upstream feature's behavior. The Ubuntu 24.04 list also
pins libboost-*1.74.0, which trixie does not ship — the script rewrites those
to the 1.83.0 series. Without that rewrite the whole apt-get install aborts.
- MPM behind a TLS-inspecting proxy: MPM's bundled libcurl uses its own CA
store and ignores
CURL_CA_BUNDLE/SSL_CERT_FILE, so a MITM proxy makes it
fail with a bare Error: Download failed. Check the network connection and retry. The real cause is only in /tmp/mathworks_<user>.log
(CURLcode=60, self-signed certificate in certificate chain). If direct
egress to mathworks.com is allowed, run MPM with the proxy vars unset:
env -u HTTPS_PROXY -u HTTP_PROXY -u https_proxy -u http_proxy mpm install ...
- Always check
/tmp/mathworks_<user>.log when MPM fails; its stdout errors
are generic.
- A handful of deps (
libmosquitto*, libucx0, libpsm2-2,
libhidapi-libusb0, libboost-log*) are only needed for optional features
(MQTT, RDMA fabrics, hardware I/O); MATLAB starts without them.
- The script prefers
wget but falls back to curl for downloads.
1---2name: install-matlab3description: Install a specific release of MATLAB (and optional toolboxes) on Linux using MPM, the MATLAB Package Manager. Use when someone wants to install MATLAB non-interactively on a Linux machine or in a container/Dockerfile, needs the right OS dependency packages for a MATLAB release on Debian/Ubuntu or RHEL/Fedora, wants to pick products (Simulink, toolboxes) or a specific release like R2024b, or is scripting a headless/CI MATLAB install. Not for Windows or macOS.4---56# Install MATLAB on Linux with MPM78## Goal9Install a chosen MATLAB release and set of products on a Linux machine10non-interactively, after first installing the OS-level library dependencies that11release requires. Uses MPM (the MATLAB Package Manager), the same mechanism the12official MathWorks devcontainer feature and container images use.1314## How it works (two stages)151. **OS dependencies.** MATLAB needs ~50 shared libraries (libGL, GTK,16 GStreamer, fontconfig, …). The exact list depends on the release AND the17 distro. The authoritative lists live in the MathWorks container-images repo:18 `matlab-deps/<release>/<os>/base-dependencies.txt`. The script detects the19 distro, maps it to the right list, downloads it, and installs it with the20 native package manager (`apt-get` or `dnf`/`microdnf`/`yum`).212. **MPM install.** Downloads `mpm` from mathworks.com and runs22 `mpm install --release=<R> --destination=<dir> --products <list> [flags]`,23 then symlinks the launcher to `/usr/local/bin/matlab`.2425## Does it need root?26- **Yes for a normal install.** Installing system packages (step 1) and writing27 to `/opt/matlab` + `/usr/local/bin` requires root. Run with `sudo`.28- **MPM itself does not require root.** If the OS dependencies are already29 present (e.g. inside a `mathworks/matlab-deps` base image) and you point30 `--destination` at a user-writable directory, MATLAB can be installed without31 root. In that case skip this script's root guard and run `mpm install`32 directly, or run this script's dependency stage once as root with33 `--deps-only` and do the MPM step separately.3435## Usage36The bundled script is `scripts/install-matlab.sh`.3738```bash39# Latest supported release (R2025b), MATLAB only, to /opt/matlab/R2025b:40sudo bash scripts/install-matlab.sh4142# A specific release + products:43sudo bash scripts/install-matlab.sh \44 --release R2024b \45 --products "MATLAB Simulink Signal_Processing_Toolbox" \46 --destination /opt/matlab/R2024b4748# See exactly what would run without changing anything:49bash scripts/install-matlab.sh --dry-run --release R2024b5051# Only install the OS dependencies (e.g. to bake into an image layer):52sudo bash scripts/install-matlab.sh --deps-only --release R2024b53```5455### Flags56- `--release <Rxxxx>` — MATLAB release (default `R2025b`). Supported R2019a–R2026a.57 To confirm the newest installable release, check that58 `matlab-deps/<release-lowercase>/<os>/base-dependencies.txt` exists upstream59 and that `mpm --version` is recent enough to know the release.60- `--products "<list>"` — space-separated product names for MPM (default `MATLAB`).61 Product names use underscores for spaces, e.g. `Signal_Processing_Toolbox`.62 See the MPM product list docs.63- `--destination <dir>` — install location (default `/opt/matlab/<release>`).64- `--doc` — also install documentation/examples (R2022b and earlier).65- `--no-gpu` (default) / `--gpu` — skip/include GPU libraries with Parallel66 Computing Toolbox. `--no-gpu` is only honored on R2023a and later; on older67 releases the script warns and installs GPU libs anyway.68- `--deps-only` — install OS dependencies, then stop (no MPM).69- `--dry-run` — print every command instead of executing (still fetches the70 dependency list so you can see the real package set).7172### Environment overrides73`RELEASE`, `PRODUCTS`, `DESTINATION`, `DOC`, `INSTALLGPU` are read as defaults;74command-line flags win.7576## Workflow for Claude771. **Confirm the target.** Ask/derive: which release, which products, where to78 install, and whether this is a bare host, a container, or a Dockerfile.792. **Check the platform.** This skill is Linux-only. If Windows/macOS, stop and80 point at the interactive installer or matlab docs. Confirm the distro is a81 Debian/Ubuntu or RHEL/Fedora family (the script exits on others).823. **Preview first.** Run with `--dry-run` and show the user the resolved83 dependency list and the exact MPM command before making changes.844. **Install.** Run with `sudo`. For a Dockerfile, translate the two stages into85 `RUN` lines (deps then MPM) rather than calling the script, or `COPY` the86 script in and run it — either is fine; keep the dependency fetch in the build.875. **Verify.** After install, check `matlab -batch "disp(version)"` or88 `ls <destination>/bin/matlab`. Note that licensing is separate: MATLAB still89 needs a license (e.g. a network license manager via `MLM_LICENSE_FILE`, or90 online licensing at first launch) — installation does not license it.9192## Notes & gotchas93- **Licensing is not part of installation.** MPM installs bits; the user must94 license MATLAB separately (network license manager, or sign-in at launch).95- **Product names**: spaces become underscores (`Deep_Learning_Toolbox`). A96 wrong name makes MPM fail — check the MPM product list if unsure.97- **Unsupported OS/release combos**: if the dependency list URL 404s, that98 distro isn't supported for that release; the script errors out clearly.99- **Debian 13 (trixie)**: `dpdk`-named packages are filtered out (unavailable100 there), matching the upstream feature's behavior. The Ubuntu 24.04 list also101 pins `libboost-*1.74.0`, which trixie does not ship — the script rewrites those102 to the `1.83.0` series. Without that rewrite the whole `apt-get install` aborts.103- **MPM behind a TLS-inspecting proxy**: MPM's bundled libcurl uses its own CA104 store and ignores `CURL_CA_BUNDLE`/`SSL_CERT_FILE`, so a MITM proxy makes it105 fail with a bare `Error: Download failed. Check the network connection and106 retry.` The real cause is only in `/tmp/mathworks_<user>.log`107 (`CURLcode=60`, `self-signed certificate in certificate chain`). If direct108 egress to `mathworks.com` is allowed, run MPM with the proxy vars unset:109 `env -u HTTPS_PROXY -u HTTP_PROXY -u https_proxy -u http_proxy mpm install ...`110- **Always check `/tmp/mathworks_<user>.log`** when MPM fails; its stdout errors111 are generic.112- A handful of deps (`libmosquitto*`, `libucx0`, `libpsm2-2`,113 `libhidapi-libusb0`, `libboost-log*`) are only needed for optional features114 (MQTT, RDMA fabrics, hardware I/O); MATLAB starts without them.115- The script prefers `wget` but falls back to `curl` for downloads.