Main Content

Set Up MATLAB Web App Server

You can set up the server once you complete installing the MATLAB® Web App Server™ product. For information on installing the product, see Install or Uninstall MATLAB Web App Server Product.

License Manager

You can set up the MATLAB Web App Server without a license manager. However, you will need a license manager running on your network prior to using the MATLAB Web App Server. For more information, see Install License Manager on License Server.

Install MATLAB Runtime

  1. Download the MATLAB Runtime installer from the MathWorks® website or the MATLAB desktop.

    OptionSteps
    MathWorks Website

    Select the appropriate platform and release-specific installer from:

    https://www.mathworks.com/products/compiler/matlab-runtime.html

    MATLAB Desktop

    At the MATLAB command prompt, type:

    compiler.runtime.download (MATLAB Compiler)

  2. Install the MATLAB Runtime using the installer. For installation instructions, see Download and Install MATLAB Runtime (MATLAB Compiler).

Set Up the Server

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

    Operating SystemDefault Location of Command-Line Scripts

    Windows® (Administrator)

    C:\Program Files\MATLAB\MATLAB Web App Server\R2024b\script

    Linux® (sudo)

    /usr/local/MATLAB/MATLAB_Web_App_Server/R2024b/script

    macOS (Intel® processor) (sudo)

    /Applications/MATLAB/MATLAB_Web_App_Server/R2024b/script

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

    Operating SystemCommand

    Windows (Administrator)

    webapps-setup

    Linux (sudo)

    webapps-setup

    macOS (Intel processor) (sudo)

    webapps-setup

    MATLAB Web App Server registers two services:

    • A service to run the server.

    • A service to run the apps.

    For platform-specific service names, see Service Information, Groups, and Folder Locations.

  3. Enter information about the license server at the prompt. You can specify this information in one of two ways:

    • Port Number@License Server Name. For example: 27000@myLicenseServer.

    • Path to the license file. For example: C:\myLicenses\license.lic.

    If you do not have a license manager set up, you can just press Enter to continue with the rest of the setup process. After setting up your license manager, use webapps-config to connect with the license manager.

  4. Specify a user account to run the server service and the apps service. To use the default accounts press Enter. For default account names, see Service Information, Groups, and Folder Locations.

    MwWebAppServerR2024b, the default account for running the server service, has permissions to process HTTP and HTTPS traffic and manage authentication. The account has permissions to write to the apps folder that contains web apps. It can read an SSL private key and authentication configuration associated with the server.

    MwWebAppWorkerR2024b, the default account for running the apps service, has the permissions of a standard user on the machine. The account can read and execute web apps as well as generate logs.

    Warning

    Do not use the same account for the server service and the app service. Using the same account makes your server vulnerable to malicious app exploits.

    Use Existing Accounts

    You can use existing accounts instead of the default accounts for the server and app services. These accounts can be local accounts or be part of a domain and should have low-privileges.

    On Windows systems, indicate domain accounts as DOMAIN_NAME\accountName. (since R2023a)

    Warning

    Avoid running workers or server services using an administrator account. It heightens security risks and may create problems managing MATLAB Web App Server for administrators.

  5. Specify the MATLAB Runtime versions you want to use by typing y or n at the prompt. The setup utility automatically finds all MATLAB Runtime versions installed on your machine as long as they are installed in the default installation location.

    If you do not have MATLAB Runtime installed, follow the instructions in Install MATLAB Runtime, and configure it using webapps-runtime.

With the setup complete, you can start the server using webapps-start.

Setup Container Environment

Starting in R2022b, you can run MATLAB web apps in Docker® containers. For details, see webapps-containers.

To run MATLAB web apps in Docker containers, you must use MATLAB Runtime R2022b or higher. Earlier versions of MATLAB Runtime are not supported. However, you can continue to use versions of MATLAB Runtime going back to R2019b if you are not planning on running web apps in containers.

Service Information, Groups, and Folder Locations

Setting up the MATLAB Web App Server creates two services and folders for uploading apps, capturing logs, and managing the server configuration.

Service Information

Operating SystemServer Service InformationApps Service Information

Windows

Account Name: MwWebAppServerR2024b

Service Name: mw-webapps-R2024b

Account Name: MwWebAppWorkerR2024b

Service Name: mw-webapps-launcher-R2024b

Linux

Account Name: MwWebAppsServerR2024b

Service Name: mw-webapps-R2024b

Service File: /etc/systemd/system/mw-webapps-R2024b.service

Account Name: MwWebAppsWorkerR2024b

Service Name: mw-webapps-launcher-R2024b

Service File: /etc/systemd/system/mw-webapps-launcher-R2024b.service

macOS (Intel processor)

Account Name: MwWebAppsServerR2024b

Service Name: com.mathworks.mw-webapps-R2024b

Service File: /Library/LaunchDaemons/com.mathworks.mw-webapps-R2024b.plist

Account Name: MwWebAppsWorkerR2024b

Service Name: com.mathworks.mw-webapps-launcher-R2024b

Service File: /Library/LaunchDaemons/com.mathworks.mw-webapps-launcher-R2024b.plist

Groups

Operating SystemGroup NameDescription

Windows

MwWebAppAuthorsR2024b

Members of this group can upload applications to the server.

Linux

MwWebAppsAuthorsR2024b

Members of this group can upload applications to the server.

macOS (Intel processor)

MwWebAppsAuthorsR2024b

Members of this group can upload applications to the server.

Folder Locations

Operating SystemFolders

Windows

Apps Folder: %ProgramData%\MathWorks\webapps\R2024b\apps

Logs Folder: %ProgramData%\MathWorks\webapps\R2024b\logs

Config Folder: %ProgramData%\MathWorks\webapps\R2024b\config

Linux

Apps Folder: /local/MathWorks/webapps/R2024b/apps

Logs Folder: /local/MathWorks/webapps/R2024b/logs

Config Folder: /local/MathWorks/webapps/R2024b/config

macOS (Intel processor)

Apps Folder: /Library/Application Support/MathWorks/webapps/R2024b/apps

Logs Folder: /Library/Application Support/MathWorks/webapps/R2024b/logs

Config Folder: /Library/Application Support/MathWorks/webapps/R2024b/config

Create Folders to Organize Web Apps

You can create folders within the apps root folder to organize your web apps. Only folders created at the root level are displayed on the web apps home page. Subfolders are not supported and are not displayed on the home page, even if they exist. You must use the webapps-appdir command line interface to create folders. Otherwise, any folders you create will not have the required permissions. While creating folders within the apps root folder is optional, doing so lets you organize your web apps and apply policy-based access to web apps contained within the folders. For more information, see Policy-Based Access.

Sample apps folder hierarchy.

See Also

Related Topics