Deploy app for a web site

14 visualizaciones (últimos 30 días)
Kostis Panagiotou
Kostis Panagiotou el 16 de Nov. de 2024 a las 8:07
Respondida: Umar el 16 de Nov. de 2024 a las 8:55
Hi there. I want to deploy an interactive Matlab app that i made in my web site. Can i do that?

Respuestas (1)

Umar
Umar el 16 de Nov. de 2024 a las 8:55

Hi @Kostis Panagiotou ,

Yes, you can deploy your interactive MATLAB app on your website by using the MATLAB Web App Server. For more guidance or information, please refer to the following documentation provided at the link below.

https://www.mathworks.com/help/compiler/web-apps.html

This allows your app to be accessed through a web browser, making it interactive and user-friendly. Below are the detailed steps to successfully deploy your MATLAB app:

Step 1: Prepare Your Application

Create Your App: Ensure that your interactive app is developed using App Designer.

Package Your App: Use the Web App Compiler to package your app into a web app archive (.ctf file). You can do this by running the following command in MATLAB:

   webAppCompiler
   - Add your `.mlapp` file.
   - Fill out necessary details like app name, author, and description.
   - Click "Package" to create the .ctf file.

Step 2: Install MATLAB Web App Server

Choose Installation Method: Depending on your internet access, follow either the Online Installation or Limited Internet Connectivity Installation procedures as outlined in your documentation.

   - For Online Installation, run the installer located in:
     - Windows: `C:\Program Files\MATLAB\R2024b\toolbox\compiler\deploy\win64\MATLABWebAppServerSetup`
     - Linux: `/usr/local/MATLAB/R2024b/toolbox/compiler/deploy/glnxa64/MATLABWebAppServerSetup`
     - macOS: `/Applications/MATLAB_R2024b.app/toolbox/compiler/deploy/maci64/MATLABWebAppServerSetup`

For Limited Internet Connectivity, first download the MATLAB Runtime installer and transfer it to the offline machine. Then copy the server application zip file and extract it.

Run Installer: Execute the installer with administrative privileges (as per your operating system) and follow prompts to install both the MATLAB Web App Server and MATLAB Runtime.

Step 3: Configure the Web App Server

After installation, configure the server by following the instructions in your documentation. Ensure that you set up a trusted intranet environment as per security recommendations.

Step 4: Deploy Your Web App

Copy the packaged `.ctf` file (e.g., `yourapp .ctf`) to the designated apps folder configured by the server: - Windows: `%ProgramData%\MathWorks\webapps\R2024b\apps` - Linux: `/local/MathWorks/webapps/R2024b/apps` - macOS: `/Library/Application Support/MathWorks/webapps/R2024b/apps`

Start the MATLAB Web App Server application: Launch it from your installed location and click "Open Home Page." This will allow you to see all deployed web apps.

Step 5: Access Your Web App

Once deployed, you can access your app through a unique URL generated by the server or via its home page. Share this URL with users who need to interact with your app.

It’s crucial to keep in mind that deploying on an open internet poses security risks. Always host such applications in a controlled intranet environment. Now, if you plan on scaling up or need user authentication features, consider upgrading to the full MATLAB Web App Server product for advanced functionalities. Ensure that users are accessing your web app using supported browsers as specified in documentation provided in the link mentioned in these comments.

By following these steps, you will successfully deploy your interactive MATLAB app on your website, allowing users easy access through their web browsers while maintaining security protocols.

Hope this helps.

Categorías

Más información sobre Web Apps en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by