Main Content

Deploy Web App

Note

You can deploy web app archives (.ctf files), created on one platform via MATLAB® Compiler™, to MATLAB Web App Server™ on a different platform, provided the web app doesn't contain platform-specific code or Simulink® simulations. For instance, a web app archive packaged on Windows® can be deployed to a server on Linux® or macOS.

Deploy Web App by Copying

  1. Navigate to the project folder generated by Web App Compiler (in MATLAB Compiler) during the packing process.

  2. Copy the file webAppArchiveName.ctf to the app folder configured by the MATLAB Web App Server. If you selected the Copy web app to server app folder check box in the Web App Compiler while creating the web app, your web app archive (.ctf file) is automatically be copied to the app folder configured by the server.

    You can access the app folder by clicking the Open App Folder button in the MATLAB Web App Server utility.

    Operating SystemApps Folder Location

    Windows

    %ProgramData%\MathWorks\webapps\R2023b\apps

    Linux

    /local/MathWorks/webapps/R2023b/apps

    macOS

    /Library/Application Support/MathWorks/webapps/R2023b/apps

    Note

    You must have write permissions to the app folder to copy a web app archive (.ctf file) to folder.

    Your web app is now deployed and can be accessed from the web apps home page. For more information, see Run Web App.

Deploy Web App from Within App Designer (Available Only with MATLAB Web App Server Product)

Follow these steps to deploy a web app from within App Designer:

  1. Create an app in App Designer.

  2. Click the Share button located in the App Designer toolstrip.

  3. Select Web App from the drop-down menu. The app will then be packaged into a web app.

  4. Wait for the Packaging Progress dialog to appear, signaling the completion of packaging.

  5. In the dialog box, enter the URL of the MATLAB Web App Server, along with the port number in the following format: https://webAppServer:PortNumber.

  6. Click the Deploy to Server button.

Direct web app upload to a server is a feature exclusively available in the MATLAB Web App Server product. This functionality requires the activation of authentication and role-based access controls. Specifically, users must hold the Author role to successfully upload web apps. For further information, see Authentication and Role-Based Access. Furthermore, to utilize this deployment approach, MATLAB Web App Server must have a trusted, non-self-signed SSL certificate.

Note

At present, direct deployment of your web app to MATLAB Web App Server running on AWS is not supported.

Deploy Web App by Uploading (Available Only with MATLAB Web App Server Product)

Prerequisites

Procedure

  1. Navigate to the web apps home page configured by the server. You can obtain the URL to the home page by executing webapps-status at the system command-line or by getting the URL from an individual who is administering the server. The format of the home page URL is:

    http://webAppServer:PortNumber/webapps/home/index.html

    Here, webAppServer is your web app server hostname, and PortNumber is the port specified when configuring the server.

  2. Click Manage Apps on the web apps home page to open the Manage Apps page.

  3. Click Upload App and navigate to the project folder generated by Web App Compiler (in MATLAB Compiler) during the packaging process.

  4. Select the file webAppArchiveName.ctf and click Open to upload the web app. You get a confirmation that the webAppArchiveName.ctf was successfully uploaded to the server.

Related Topics