Contenu principal

Configure Installation from Artifactory Repository

Artifactory®, published by JFrog®, is an artifact repository manager with support for version management, access control, and CI/CD integration. The command-line tool MATLAB® Package Manager (mpm) enables users to download and install MathWorks® products and support packages from your organization's Artifactory repository. This topic shows how to configure installation from your organization's Artifactory repository for MathWorks products and support packages.

Limitations

In offline environments, mpm is unable to install support packages containing third-party packages from Artifactory. During installation, mpm attempts to download the third-party packages from vendor sites instead of retrieving them from Artifactory. If the vendor sites are unreachable, mpm issues an error. To install support packages containing third-party packages outside of Artifactory, see Install Support Packages on Offline Computer.

Installation Configuration Workflow

To configure the installation of MathWorks products and support packages from your organization's Artifactory repository:

  1. Set up the repository folder structure in Artifactory (one-time step).

  2. Create the JSON configuration file required for installing products and support packages from the repository (one-time step).

  3. Download products and support packages from MathWorks using mpm download.

  4. Upload the products to your organization's Artifactory repository.

Steps for configuring installation from your organization's repository

Repeat steps 3 and 4 above for every new release, or update release, of MathWorks products and support packages.

Users can then install products from the repository by using mpm install and the configuration file.

A computer receives an installation of MATLAB from a repository using mpm install and the JSON configuration file.

Set Up Repository Folder Structure (One-Time Step)

An Artifactory repository with a folder hierarchy

Set up the Artifactory repository used to store MathWorks products and support packages.

  1. In Artifactory, either create a new repository or reuse an existing repository. In both cases, the repository type must be set to Generic. Sample repository URL:

    https://artifactory.example.com/artifactory/my-repo
  2. In the top-level folder of your Artifactory repository, create a subfolder named MathWorks for storing MathWorks releases.

    MathWorks/

    In later steps, when you download product and support package releases from MathWorks, you will upload these releases to the MathWorks subfolder. Each release and update will be stored in a separate subfolder under the MathWorks folder (for example, R20XXaU0, R20XXaU1, and so on). This folder structure shows a repository with multiple uploaded releases and updates:

      MathWorks/
        R20XXaU0/
        R20XXaU1/
        R20XXaU2/
        ...
        R20XXbU0/
        R20XXbU1/
        R20XXbU2/
        ...

Create Repository Configuration File (One-Time Step)

A JSON configuration file

Create the JSON configuration file that enables users to install the products and support packages. This file contains information about the repository that is required for installation.

  1. Create a JSON file. For example: my_repo_config.json.

  2. Copy the following contents into the JSON file:

    {
      "repository_configuration": [
        {
          "name": "my-repo",
          "url": "https://my-artifactory-instance/my-repo",
          "type": "artifactory",
          "repository_layout": {
            "mathworks_products": "MathWorks"
          },
          "auth": {
            "type": "token",
            "access_token": "${ARTIFACTORY_ACCESS_TOKEN}"
          }
        }
      ]
    }
  3. Modify the JSON file fields for your repository.

    • "name" — Name of your Artifactory repository.

    • "url" — URL of your Artifactory repository.

    • "type" — Type of repository. Currently, "artifactory" is the only supported repository type.

    • "repository_layout" — Folder layout of your Artifactory repository. Each subfield in repository_layout defines a subfolder that stores installable MathWorks software. Supported subfields:

      • "mathworks_products" — Name of subfolder containing MathWorks product and support package releases. For example, suppose your configuration file contains these field values:

        ...
        "url": "https://my-artifactory-instance/my-repo",
        ...
        "repository_layout": {
          "mathworks_products": "MathWorks"
        },
        ...
        If you install products and support packages for R2025bU0, then mpm retrieves the products and support packages from this URL:

        https://my-artifactory-instance/my-repo/MathWorks/R2025bU0

    • "auth" — Authentication details for accessing the repository. Supported subfields:

      • "type" — Authentication type. Currently, the only supported type is "token".

      • "access_token" — Token used to authenticate users accessing the repository. After you obtain an access token from your IT administrator, set the token in the ARTIFACTORY_ACCESS_TOKEN environment variable. Follow your organization's procedure for setting environment variables. Sample syntax:

        ARTIFACTORY_ACCESS_TOKEN=abc123xyz456

        Then in the JSON file, specify the environment variable name in the access_token field using this syntax:

        "access_token": "${ARTIFACTORY_ACCESS_TOKEN}"

        Alternatively, you can specify the access token directly in the JSON file. For example:

        "access_token": "abc123xyz456"

        Security Considerations: Specifying the access token directly in the JSON file exposes sensitive credentials in plain text. To reduce the risk of exposing credentials in configuration files, specify the access token as an environment variable.

  4. Save the JSON file in a location that users can access, such as a shared drive. If users can download files from your Artifactory repository, consider uploading the file to your Artifactory repository.

Download Products from MathWorks

A folder being downloaded from a MathWorks web server

Use mpm to download the products and support packages for a specific release that you want to upload to Artifactory. You cannot upload MathWorks software downloaded from other sources, such as an ISO or DMG image.

  1. Get the latest version of mpm by following the instructions in Get MATLAB Package Manager.

  2. Download the products using mpm download. For example, download the initial (update 0) R2025b release of Simulink® and Deep Learning Toolbox™ Model for ResNet-50 Network for use on Linux® (glnxa64), Windows® (win64), and Mac (maca64) platforms. Replace <USER> with your computer username. mpm also downloads the required products: MATLAB and Deep Learning Toolbox.

    Linux or Mac:

    ./mpm download --release=R2025bU0 --destination=/home/<USER>/Downloads/R2025bU0 --platforms=glnxa64 win64 maca64 --products=Simulink Deep_Learning_Toolbox_Model_for_ResNet-50_Network

    Windows:

    .\mpm.exe download --release=R2025bU0 --destination=C:\Users\<USER>\Downloads\R2025bU0 --platforms=glnxa64 win64 maca64 --products=Simulink Deep_Learning_Toolbox_Model_for_ResNet-50_Network

    To download a large number of products and support packages, use the --inputfile option to specify the products in an input file. For details, see the example Download Products Using Input File on the mpm download reference page.

The R2025bU0 folder has this structure:

R2025bU0/
  archives/
  mpm/
  ProductFilesInfo.xml

The R2025bU0 folder contains the following files and subfolders:

  • archives — Subfolder containing the downloaded products and support packages.

  • mpm — Subfolder containing downloaded versions of mpm, one for each platform you specified in the --platforms option of mpm. Your users can install products and support packages using these versions of mpm, as shown in this sample structure:

    mpm/
      glnxa64/
        mpm
      maca64/
        mpm
      win64/
        mpm.exe

  • ProductFilesInfo.xml — Metadata file containing information about the products and support packages.

Upload Products to Artifactory

A folder being uploaded to an Artifactory repo

Upload the products and support packages you downloaded in the previous section to Artifactory. Because Artifactory does not support folder uploads, you must first compress the downloaded folder into a ZIP file. Do not modify the structure or contents of this folder before compressing and uploading it.

  1. Using your preferred tool, compress the release folder you downloaded into a ZIP file. For example, navigate to the downloaded folder and use zip (Linux or Mac) or tar (Windows) to compress the contents into a ZIP file in the parent folder, Downloads.

    Linux or Mac:

    cd /home/<USER>/Downloads/R2025bU0
    zip -r ../R2025bU0.zip ./*
    cd ..

    Windows (command prompt):

    cd C:\Users\<USER>\Downloads\R2025bU0
    tar -a -c -f ..\R2025bU0.zip *
    cd ..

    Depending on the number of products and support packages downloaded, this process can take several minutes. The compressed ZIP file should contain the subfolders and file shown in this example:

    R2025bU0.zip
      archives/
      mpm/
      ProductFilesInfo.xml
  2. In the MathWorks folder of your Artifactory repository, create a subfolder in which to upload the ZIP file. To create this subfolder, use JFrog CLI or your preferred tool. The example below shows how to create the folder using the command-line tool curl to make HTTPS web requests.

    Linux or Mac:

    curl --user <USER>:<PASSWORD> \
         --request PUT \
         "https://my-artifactory-instance/my-repo/MathWorks/R2025bU0/"

    Windows (command prompt):

    curl --user <USER>:<PASSWORD> ^
         --request PUT ^
         "https://my-artifactory-instance/my-repo/MathWorks/R2025bU0/"

    The curl command includes these options:

    • --user <USER>:<PASSWORD> — Specify your username and Artifactory password. Alternatively, if you are using an access token, replace --user <USER>:<PASSWORD> with the following additional header: --header "Authorization: Bearer <TOKEN>"

    • --request PUT — Use a PUT request because the upload modifies the repository.

    • https://my-artifactory-instance/my-repo/MathWorks/R2025bU0/ — Specify the URL endpoint of the folder as it will appear in Artifactory. Include a trailing slash in the URL. Use the following URL format:

      https://my-artifactory-instance/my-repo/MathWorks/R20XXyUn/
      • https://my-artifactory-instance/my-repo/ is the URL of your Artifactory repository, as determined by the "url" field of your repository configuration file.

      • MathWorks/ is the subfolder that stores MathWorks product and support package releases, as determined by the "mathworks_products" subfield within the "repository_layout" field of your repository configuration file.

      • R20XXyUn/ is a release folder, where R20XXy is the release name (for example, R2025b) and Un is the update release number (for example, U0, U1, and so on).

  3. Upload the ZIP file to the release folder you just created in your Artifactory repository. Use JFrog CLI or your preferred tool. The example below shows how to upload the ZIP file using curl.

    Linux or Mac:

    curl --user <USER>:<PASSWORD> \
         --header "X-Explode-Archive:true" \
         --request PUT \
         --upload-file /home/<USER>/Downloads/R2025bU0.zip \
         "https://my-artifactory-instance/my-repo/MathWorks/R2025bU0/"

    Windows (command prompt):

    curl --user <USER>:<PASSWORD> ^
         --header "X-Explode-Archive:true" ^
         --request PUT ^
         --upload-file "C:\Users\<USER>\Downloads\R2025bU0.zip" ^
         "https://my-artifactory-instance/my-repo/MathWorks/R2025bU0/"

    The curl command includes these options:

    • --user <USER>:<PASSWORD> — Specify your username and Artifactory password. Alternatively, if you are using an access token, replace --user <USER>:<PASSWORD> with the following additional header: --header "Authorization: Bearer <TOKEN>"

    • --header "X-Explode-Archive:true" — Specify X-Explode-Archive:true in the request header to unzip the folder after you upload it.

    • --request PUT — Use a PUT request because the upload modifies the repository.

    • --upload-file ... — Specify the path to the ZIP file.

    • https://my-artifactory-instance/my-repo/MathWorks/R2025bU0/ — Specify the URL endpoint of the folder you created in the previous step.

Install Products and Support Packages from Artifactory

A computer receives an installation of MATLAB from a repository using mpm install and the JSON configuration file.

To enable your users to install products and support packages from your Artifactory repository, provide them with the following:

  • A copy of the repository configuration file (for example, my_repo_config.json).

  • A version of mpm that is compatible with their platform. Users can either download the copy of mpm that was uploaded to the repository, or download mpm from MathWorks web servers by following the instructions in Get MATLAB Package Manager.

This sample mpm install command installs the products from the Artifactory repository by using a configuration file stored in a shared location.

Linux or Mac:

./mpm install --repo-config=/usr/share/my_repo_config.json --release=R2025bU0 --destination=/home/<USER>/matlab --products=Simulink Deep_Learning_Toolbox_Model_for_ResNet-50_Network

Windows (run as administrator):

.\mpm.exe install --repo-config="Z:\share\my_repo_config.json" --release=R2025bU0 --destination="C:\Users\<USER>\matlab" --products=Simulink Deep_Learning_Toolbox_Model_for_ResNet-50_Network

To install a large number of products and support packages, use the --inputfile option to specify them in an input file. For details, see the example Install Products and Support Packages from Artifactory Repository Using Input File on the mpm install reference page.

Users can also use mpm in a Dockerfile to integrate MATLAB into CI/CD pipelines. For an example, see Create MATLAB Container Image on GitHub®.

See Also

|

Topics