Before starting, you need the following:
- A MATLAB® Production Server™ license that meets these conditions:
- Linked to a MathWorks Account.
- Concurrent license type. To check your license type, see MathWorks License Center.
- Configured to use a network license manager on the virtual network. By default, the deployment of MATLAB Production Server includes a network license manager, but you can also use an existing license manager. In either case, activate or move the license after deployment. For details, see Configure MATLAB Production Server License for Use on the Cloud.
- An Amazon Web Services™ (AWS) account. If you do not have an account, create one at https://aws.amazon.com by following the on-screen instructions.
If you do not have a license, please contact your MathWorks representative here or request a trial license.
You are responsible for the cost of the AWS services used when you create cloud resources using this guide. Resource settings, such as instance type, affect the cost of deployment. For cost estimates, see the pricing pages for each AWS service you will be using. Prices are subject to change.
Use this guide to automate running MATLAB Production Server
on the Amazon Web Services (AWS) Cloud using an AWS CloudFormation template.
The template is a JSON file that defines the resources required to deploy and manage MATLAB Production
Server on AWS. Once deployed, you can manage the server using the
MATLAB Production Server dashboard—a web-based interface to
configure and manage server instances on the cloud. For more information, see Manage MATLAB Production Server Using the Dashboard.
For information about the architecture of this solution, see Architecture and Resources. For information about AWS templates, see Working with AWS CloudFormation Templates.
The default MATLAB Production Server deployment template uses the Network License Manager for MATLAB reference architecture to manage MATLAB Production Server licenses. The template for using an exisitng VPC for the deployment provides an option to either deploy the Network License Manager or use your own license server. For more information about the Network License Manager for MATLAB reference architecture, see Network License Manager for MATLAB on Amazon Web Services.
- In the top navigation of your AWS account, select the region where you want to deploy MATLAB Production Server. You must select one of these supported regions:
- US-East (N. Virginia)
- US-West (Oregon) — R2022b or later only
- Europe (Ireland)
- Asia Pacific (Tokyo)
- Create a key pair in that region. The key pair is necessary because it is the only way to connect to the instance as an administrator.
- If necessary, request a service limit increase for the Amazon EC2 instance type or VPCs. You might need to do this if you already have existing deployments that use that instance type or you think you might exceed the default limit with this deployment.
To deploy the reference architecture, select your MATLAB Production Server release from the table and follow the instructions to deploy the server using the provided template. A deployment of MATLAB Production Server supports MATLAB Runtime versions up to six releases back.
Release | Supported MATLAB Runtime Versions |
---|---|
R2024b | R2024b, R2024a, R2023b, R2023a, R2022b, R2022a |
R2024a | R2024a, R2023b, R2023a, R2022b, R2022a, R2021b |
R2023b | R2023b, R2023a, R2022b, R2022a, R2021b, R2021a |
R2023a | R2023a, R2022b, R2022a, R2021b, R2021a, R2020b |
R2022b | R2022b, R2022a, R2021b, R2021a, R2020b, R2020a |
R2022a | R2022a, R2021b, R2021a, R2020b, R2020a, R2019b |
Note: MathWorks provides templates for only the six most recent releases of MATLAB Production Server. Earlier templates are removed and are no longer supported.
Deploying this reference architecture creates several resources in your resource group.
Architecture on AWS
Resource Type | Number of Resources | Description |
---|---|---|
AWS EC2 Instance | 2 | This resource consists of two virtual machines (VMs):
|
Auto Scaling Group | 1 | Manages the number of identical VMs to be deployed. Each VM runs an instance of MATLAB Production Server which in turn runs multiple MATLAB workers. |
Load Balancer | 2 | Provides routing and load balancing services to MATLAB Production Server instances. The MATLAB Production Server Dashboard retrieves the HTTPS endpoint for making requests to the server from the load balancer resource. |
S3 Bucket | 1 | S3 storage bucket created during the creation of the stack. This resource stores the applications deployed to the reference architecture. |
Virtual Private Cloud (VPC) | 1 | Enables resources to communicate with each other. |
Redis ElastiCache | 1 | Enables caching of data between calls to MATLAB code running on a server instance. |
CloudWatch | 1 | Enables viewing of logs. |
Why do requests to the server fail with errors such as “untrusted certificate” or “security exception”?
These errors occur either when CORS is not enabled on the server or when the server endpoint uses a self-signed certificate.
If you are making an AJAX request to the server, make sure that CORS is enabled in the server configuration. You can enable CORS by editing the property CORS Allowed Origins
property in the Settings tab of the dashboard.
Also, some HTTP libraries and JavaScript AJAX calls will reject a request originating from a server that uses a self-signed certificate. You may need to manually override the default security behavior of the client application. Alternatively, you can add a new HTTPS endpoint to the application gateway. For more information, see Change SSL Certificate.
The deployment template allows you to enter only one range of IP addresses that can access the dashboard. After the deployment is complete, you can allow additional IP ranges access to the dashboard. For details, see Update security group rules in the AWS documentation.
The name of the security group to update is matlab-production-server-cloud-stack-elb-1-sg
. Edit inbound rules to add additional IP address ranges in CIDR format for the HTTPS
type.
Use the instructions at this link to upgrade an existing deployment to a newer MATLAB version: Upgrading an Existing Deployment.
Provide suggestions for additional features or capabilities using this link: https://www.mathworks.com/solutions/cloud.html.
If you require assistance or have a request for additional features or capabilities, please contact MathWorks Technical Support.