# Install Matlab

> 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.

- Skill: `prabhakk-mw/install-matlab` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add prabhakk-mw/install-matlab`
- Raw SKILL.md: https://api.skillmd.com/api/skills/prabhakk-mw/install-matlab/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: prabhakk-mw (https://skillmd.com/u/prabhakk-mw)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/prabhakk-mw/install-matlab

---


# 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)
1. **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`).
2. **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`.

```bash
# 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
1. **Confirm the target.** Ask/derive: which release, which products, where to
   install, and whether this is a bare host, a container, or a Dockerfile.
2. **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).
3. **Preview first.** Run with `--dry-run` and show the user the resolved
   dependency list and the exact MPM command before making changes.
4. **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.
5. **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.

