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
Download the MATLAB Runtime installer from the MathWorks® website or the MATLAB desktop.
Option Steps 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)Install the MATLAB Runtime using the installer. For installation instructions, see Download and Install MATLAB Runtime (MATLAB Compiler).
Set Up the Server
After installing the MATLAB Web App Server product, navigate to the folder containing the MATLAB Web App Server command-line scripts.
Operating System Default 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
At the operating system command line, start the interactive setup interface by typing:
Operating System Command 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.
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.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.
Specify the MATLAB Runtime versions you want to use by typing
y
orn
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 System | Server Service Information | Apps Service Information |
---|---|---|
Windows | Account Name:
Service
Name:
| Account Name:
Service
Name:
|
Linux | Account Name:
Service
Name:
Service
File:
| Account Name:
Service
Name:
Service
File:
|
macOS (Intel processor) | Account Name:
Service
Name:
Service
File:
| Account Name:
Service
Name:
Service
File:
|
Groups
Operating System | Group Name | Description |
---|---|---|
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 System | Folders |
---|---|
Windows | Apps Folder:
Logs
Folder:
Config
Folder:
|
Linux | Apps Folder:
Logs
Folder:
Config
Folder:
|
macOS (Intel processor) | Apps Folder:
Logs
Folder:
Config
Folder:
|
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.