This topic describes how to use the Azure® Marketplace to quickly deploy and run MATLAB® on Azure. The elasticity of the cloud infrastructure combined with MATLAB enables you to leverage greater computing resources and keep your calculations close to your data.
Anyone with a valid MATLAB license and an Azure account can run MATLAB on the cloud. This is called MATLAB (BYOL) because you "Bring Your Own License."
To complete these instructions, you need:
By default, the MATLAB (BYOL) offering on Azure Marketplace uses online licensing. This table summarizes which licenses support running MATLAB on the cloud.
|License Type||Cloud Availability|
Individual (a license that only you use that is in your name; not a Home or Student license)
Your license is already configured for MATLAB on the cloud.
Campus-Wide License (a license that you use that belongs to your academic institution)
Your license is already configured for MATLAB on the cloud.
Home and Student (that only you use and is in your name)
These license types are not eligible to use MATLAB on the cloud. However, you can use MATLAB Online™.
All other license types, including Concurrent and Network Named User
Contact your license administrator.*
The license administrator might need to make some changes to the license to enable running MATLAB on the cloud.
Administrators: For more information on this process, see MATLAB Licensing in the Cloud.
*Not sure who the license administrator is? Sign in to your MathWorks Account, click the license you are using, then click the tab marked “Contact Administrators”.
To configure and deploy MATLAB (BYOL) resources in a resource group:
Navigate to https://portal.azure.com and login to your Azure account.
From the Portal, click Create a Resource.
Search for “matlab” in the marketplace and click on the MATLAB (BYOL) offering.
Click Create on the offering page to begin setup.
The setup process uses a Resource Manager template to help you configure the virtual machine and networking settings. To make setup easy, many of the fields come prepopulated with acceptable values. This table describes how to set the various options in each menu of the template. Click Next at the end of each step to proceed to the next menu.
Select an Azure subscription to use.
You can select an existing resource group from the drop-down menu, or click Create New to create a new resource group. If you select an existing resource group, then it must not have any currently deployed resources.
Select a location from the drop-down list.
Virtual Machine Settings
Virtual Machine name
Select a name for the VM resource. The default name is
Virtual Machine size
Select the VM size. The default size (D3 v2) is sufficient for most purposes and safely satisfies the minimum requirements for MATLAB, but you can select a different size if necessary. Note that the size of the VM you choose affects your costs.
Select a username for the VM. You will use this username to login to the VM with Remote Desktop later.
|Select a password for the VM. Note that the password must have at least 8 characters and can only include letters and numbers.|
|Retype your chosen password.|
Select the range of IP addresses that are authorized to connect to the VM. This is the public IP address for your computer which can be found by searching for "What is my IP address" on the web. This field uses CIDR notation of the form: 100.100.100.100/20. The mask determines the number of IP addresses to include.
Network License Manager port@server
If you are using a Network Licensing Manager, enter the port and hostname or IP address. For more information, see MATLAB Licensing in the Cloud.
The Virtual network field is
prepopulated with a new virtual network resource named
The Subnet field is prepopulated
with a new subnet named
Public IP Address for the VM
The Public IP Address for the VM
field is prepopulated with a new Public IP resource named
DNS Prefix for the Public IP Address
The DNS Prefix for the Public IP Address field is prepopulated with an acceptable DNS prefix, but you can edit it if necessary. The selected DNS name is used to connect to the VM with Remote Desktop.
Review and Create
When you advance to the Review and Create menu, Azure automatically runs some final validation checks on the information entered on previous screens. If Azure finds any errors, then you need to fix them before proceeding.
Once you are satisfied with the values you have entered, click Create to finalize setup and begin deploying the selected resources, or Download a template for automation to get a copy of the completed template.
Once you have successfully configured and deployed the MATLAB (BYOL) resources, use these steps to connect to the virtual machine you set up. You can either create a prepopulated Remote Desktop file, or run Remote Desktop and manually fill out the DNS name.
From the Azure Portal, navigate to the resource group with the resources you deployed.
matlab-desktop virtual machine resource to view its
details. (If you renamed the virtual machine resource, then select the resource
corresponding to that name.)
Click the Connect button to see a list of connection options, and then select RDP from the drop-down menu.
On the Connect with RDP screen, the IP address and Port number fields are prepopulated. Click Download RDP file to download a Remote Desktop file that automatically connects to the virtual machine.
Run the RDP file you downloaded to connect to the virtual machine, accepting any intermediate dialogs.
Once Remote Desktop Connection connects to the VM, sign in to the virtual machine using the username and password that you previously configured in Virtual Machine Settings. (See Configure and Deploy Template from Marketplace for more information.)
You are now at the desktop of the Linux® VM. Double click the MATLAB icon to launch MATLAB.
Launching MATLAB for the first time in this setting can take several minutes.
After you launch MATLAB, you are prompted to login to your MathWorks Account and select a MATLAB license to use.
To manually connect to the virtual machine with Remote Desktop, you need the
full DNS name of the machine. The
matlab-desktop-ip resources both list the full DNS name. Open
one of those resources and copy the DNS name.
Open the Remote Desktop Connection software.
To populate the Computer field, paste the DNS name that you copied.
Click Connect to proceed.
Follow steps 6–8 in Connect to VM and Run MATLAB to sign in to the VM and launch MATLAB.
You can remove the resource group and all associated resources when you are done with them to help save on costs.
Login to the Azure Portal.
Select the resource group containing the MATLAB (BYOL) resources you deployed.
Select the Delete resource group icon to delete all resources deployed in the group.
You will be prompted to confirm the deletion.
The deletion is final, and files do not persist between deployments. (See File Persistence on Azure for more information.) You need to create the resources to make them available again.
As you use MATLAB on Azure, all your files and changes are stored locally on the virtual machine. The files persist until you terminate the virtual machine or delete the resource group. However, stopping or shutting down the instance does not destroy the data on the virtual machine, so it is safe to shutdown the instance when you are not using it.
If you use MATLAB Drive™ to store your files on the cloud, you can install the MATLAB Drive Connector on the virtual machine to gain access to your files. See Install MATLAB Drive Connector (MATLAB Drive) for instructions to install the Connector on Linux.
Deploying MATLAB on Azure creates several resources in your resource group. The deployment sets up a single Azure virtual machine (VM) running Linux and MATLAB, a network interface with a public IP address to connect to the VM, a network security group that controls network traffic, and a virtual network for communication between resources. This table summarizes the resources that are created.
|Resource Name||Default Resource Name in Azure||Description|
|Virtual machine||The VM instance with pre-installed desktop MATLAB. The name you choose for this virtual machine resource acts as the root of the names for the Public IP address and Disk resources.|
|Public IP address||Public IP address to connect to the VM running MATLAB. If you select an existing Public IP resource, then the template does not create this resource.|
|Disk||The disk attached to the VM.|
|Network interface||Enables the VM to communicate with the internet, Azure, and on-premises resources.|
|Network security group||Allows or denies traffic to and from sources and destinations.|
|Virtual network||Enables resources to communicate with each other. If you select an existing virtual network resource, then the template does not create this resource.|
The architecture of these resources is summarized in this diagram.
A preconfigured Ubuntu® VM is provided to make deployment easy. The VM contains this software:
MATLAB, Simulink®, toolboxes, and support for GPUs.
The license used to run MATLAB determines which products and toolboxes are available for you to use.
However, all products are installed on the VM, so the
returns a list of all products. To add new products to your license, see Products and
Add-Ons: Deep Learning Toolbox™ Model for AlexNet Network, Deep Learning Toolbox Model for GoogLeNet Network, and Deep Learning Toolbox Model for ResNet-50 Network.
The Azure Marketplace offering only runs the latest release of MATLAB. If you need to run older releases of MATLAB, or customize the templates and automation scripts more extensively, then you can use the Reference Architecture for Microsoft Azure instead.
If you encounter an unexpected problem, search MATLAB Answers for solutions first. Most likely, other people have run into the same problem and resolved it already.
If the problem persists, or there are not any relevant posts on MATLAB Answers for the issue, contact Technical Support.