Main Content

Set Up MATLAB Production Server Using the Command Line

You can run MATLAB® Production Server™ on-premises and in the cloud. To set up an on-premises server, you can use the system command line or the dashboard, which is a web-based interface. The following procedure use the command line. For information on interacting with the server using the dashboard, see Server Management Using Dashboard. For using MATLAB Production Server on the cloud, see Cloud Deployment.

Note

MATLAB functions deployed to the server are created using MATLAB Compiler SDK™. For details on how to create deployable archives for deployment to the server, see Enterprise Deployment with MATLAB Production Server (MATLAB Compiler SDK).

Prerequisites

Set Up the Server

  1. After installing the MATLAB Production Server product, navigate to the folder containing the MATLAB Production Server command-line scripts.

    Operating SystemDefault Location of Command-Line Scripts

    Windows® (Administrator)

    C:\Program Files\MATLAB\MATLAB Production Server\R2022a\script

    Linux® (sudo)

    /usr/local/MATLAB/MATLAB_Production_Server/R2022a/script

    macOS (sudo)

    /Applications/MATLAB/MATLAB_Production_Server/R2022a/script

  2. At the operating system command line, start the interactive setup interface by typing:

    mps-setup
    For details, see mps-setup.

    During the setup process set the default MATLAB Runtime version you want the server to use. For details, see Specify Default MATLAB Runtime for New Server Instances.

Create Server Instance

To create a server configuration or instance, enter the mps-new command from the system prompt. Specify the name of the server that you want to create as an argument to the mps-new command.

For example, to create a server instance with the name prod_server_1 located in C:\tmp and to use the verbose mode, run the following on your system command prompt.

C:\tmp>mps-new prod_server_1 -v

For more information, see Create Server Instance Using Command Line.

Configure Server Instance

After you create a new server instance, you must configure it. At a minimum, ensure that the following properties in the main_config server configuration file are set.

  • license — Specify the host and port of the license server, typically 27000@license-server-host.

  • mcr-root — Specify the path to the versions of MATLAB Runtime to use. You can set this property to use multiple versions of MATLAB Runtime. For more information, see Support Multiple MATLAB Runtime Versions.

For more information on editing main_config, see Configure Server Using Configuration File.

Start Server Instance

To start the server instance that you created, enter the mps-start command from the system prompt. Specify the name of the server that you want to start as an argument to the mps-start command.

For example, to start a server instance with the name prod_server_1 located in C:\tmp, run the following on your system command prompt.

C:\tmp>mps-start -C prod_server_1

For more information, see Start Server Instance Using Command Line.

See Also

| | |

Related Topics