MATLAB Container on Docker Hub - MATLAB & Simulink (original) (raw)

Access MATLAB® in the cloud or in server environments by using the prebuilt MATLAB container image available on Docker Hub. Use the MATLAB container to run MATLAB in cloud environments such as AWS® or Microsoft® Azure®. If you instead want to create and customize a MATLAB container image from a Dockerfile, see Create a Custom MATLAB Container. For more information about containers, see What is a Container?.

Contents of the Container

The MATLAB container image includes:

Requirements

To use the MATLAB container image, you need:

Quick Start Guide for MATLAB Container

This section shows how to run the MATLAB container and launch an interactive MATLAB session either in browser mode or using a VNC client. For a complete list of commands to start the MATLAB container, including how to use MATLAB in batch mode, see MATLAB Container Image on Docker Hub.

Pull Container Image

To download the MATLAB container image onto the host machine, run this command in the command line. You must replace the tag r20XYz with the specific MATLAB release name, for example, r2022a. Downloading and extracting the container image can take some time.

docker pull mathworks/matlab:r20XYz

Run Container in Browser Mode

Run the MATLAB container using this command:

docker run -it --rm -p 8888:8888 --shm-size=512M mathworks/matlab:r20XYz -browser

Running the command prints a URL to your terminal. To access MATLAB, enter the URL into a web browser. If prompted to do so, enter credentials for a MathWorks account associated with a MATLAB license.

Note

Run Container in VNC Mode

You can also run the MATLAB container in VNC mode. Doing so allows you to install toolboxes or update MATLAB. For more details, see Install Updates, Toolboxes, Support Packages, and Add-Ons in Containers.

Run the MATLAB container in VNC mode by entering this command:

docker run --init -it --rm -p 5901:5901 -p 6080:6080 --shm-size=512M mathworks/matlab:r20XYz -vnc

To connect to the desktop where you can open MATLAB:

If your container is not running on your local machine, replacelocalhost with the fully qualified domain name (FQDN) of the computer on which the container is running.

The default VNC password is matlab.

For a full list of options and environment variables that you can use to start the container, run the container with the -help flag:

docker run -it --rm mathworks/matlab:r20XYz -help

For more information about configuring a MathWorks container image using environment variables, see Configure Containers.

See Also

Topics

External Websites