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
Navigate to the project folder generated by Web App Compiler (in MATLAB Compiler) during the packing process.
Copy the file
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 (webAppArchiveName
.ctf.ctf
file) will 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 System Apps Folder Location Windows
%ProgramData%\MathWorks\webapps\R2024b\apps
Linux
/local/MathWorks/webapps/R2024b/apps
macOS
/Library/Application Support/MathWorks/webapps/R2024b/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:
Create an app in App Designer.
Click the Share button located in the App Designer toolstrip.
Select Web App from the drop-down menu. The app will then be packaged into a web app.
Wait for the Packaging Progress dialog box to appear, signaling the completion of packaging.
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
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
Verify that you have the MATLAB Web App Server product installed. For more information, see Install or Uninstall MATLAB Web App Server Product.
Verify that Authentication and Role-Based Access are enabled on the server.
Verify that you are designated as an author while configuring Role-Based Access.
Procedure
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.htmlHere,
is your web app server hostname, andwebAppServer
is the port specified when configuring the server.PortNumber
Click Manage Apps on the web apps home page to open the Manage Apps page.
Click Upload App and navigate to the project folder generated by Web App Compiler (in MATLAB Compiler) during the packaging process.
Select the file
and click Open to upload the web app. You get a confirmation that thewebAppArchiveName
.ctf
was successfully uploaded to the server.webAppArchiveName
.ctf