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.
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).
Verify that you have installed the MATLAB Production Server product. For details, see Install MATLAB Production Server Product.
Verify that you have installed a network license manager. For details, see Install License Manager on License Server.
Verify that you have MATLAB Runtime installed. For details, see Install and Configure MATLAB Runtime. For supported versions, see Supported MATLAB Runtime Versions for MATLAB Production Server.
Set Up the Server
After installing the MATLAB Production Server product, navigate to the folder containing the MATLAB Production Server command-line scripts.
Operating System Default Location of Command-Line Scripts
C:\Program Files\MATLAB\MATLAB Production Server\R2023b\script
At the operating system command line, start the interactive setup interface by typing:For details, see
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
For example, to create a server instance with the name
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
license — Specify the host and port of the license server, typically
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 Server Configuration Properties.
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
For example, to start a server instance with the name
C:\tmp, run the following on your system command
C:\tmp>mps-start -C prod_server_1
For more information, see Start Server Instance Using Command Line.