Why do I receive License Manager Error -4?

3,458 views (last 30 days)
When I try to start MATLAB or use a toolbox, I receive the following error:
ERROR: License Manager Error -4
Maximum number of users for MATLAB reached. Try again later
What does this error mean and how can I resolve it?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 16 Sep 2022
Edited: MathWorks Support Team on 16 Sep 2022
This error indicates that all licenses are currently in use. This means that all of the keys for a particular product have been checked out from your license server. You will not be able to access a license for the product until another user has returned the license back to the pool. For information about the current licenses in use you can check with your License Administrator. Your License Administrator can check the usage of licenses by following the instructions in the License Administrator Section below.
This error can also occur if there is a misunderstanding as to what products are owned. For example, if the Network License Manager has a 2 licenses for MATLAB R2022b and 3 seats for MATLAB R2021a, then 5 seats could check out R2021a and older, but only 2 seats could check out R2022b. Trying to checkout a third seat would result in an error -4.
License Administrator Section
1) Launch LMTOOLS, located within the $MATLAB\etc\win64. If lmtools.exe is not in that folder, see the related solution "Why are necessary license manager scripts missing from my license manager directory?" below.
2) Click the "Perform Status Enquiry" button on the SERVER STATUS tab to get a full report of the current license usage.
For Linux/Mac:
1) Open a terminal Window. For Mac OS X, use the Terminal application located in the Applications/Utilities directory.
2) In the terminal, change directories to the $MATLAB/etc directory. For example:
cd /usr/local/MATLAB_R2022a/etc
Mac OS X
cd /Applications/MATLAB_R2022a.app/etc
3) Run the following command to get the usage information
./lmstat -a -c license.dat
An example output from LMTOOLS or lmstat is located below:
Flexible License Manager status on Mon 9/26/2022 15:35
[Detecting lmgrd processes...]
License server status: 27000@license1
License file(s) on license1: C:\Program Files\MATLAB\R2022b\flexlm\license.dat:
license1: license server UP (MASTER) v11.18.1.0
Vendor daemon status (on license1):
MLM: UP v11.18.1.0
Feature usage info:
Users of MATLAB: (Total of 2 licenses issued; Total of 2 licenses in use)
"MATLAB" v22, vendor: MLM
nodelocked license, locked to "ID=123456"
joesmith joe-pc joe-pc (v22) (joe-pc/27000 102), start Mon 9/28 15:37
janedoe jane-pc jane-pc (v22) (jane-pc/27000 101) start Tues 9/29 08:26
In this example, a license would not be available until either Joe or Jane closes MATLAB to return the license.
Deepak Rathore
Deepak Rathore on 30 Jan 2019
Hi I am Facing same problem when I follow the solution given above, I got the following:
Error getting status: Cannot find license file.
The license files (or license server system network addresses) attempted are
listed below. Use LM_LICENSE_FILE to use a different license file,
or contact your software provider for a license file.

Sign in to comment.

More Answers (7)

Loic Houde
Loic Houde on 10 Feb 2017
Hello, who can ne explain me that only 2/5 licenses are used and no more instance of matlab can be launch.
#./lmstat -a -c license.dat
Users of MATLAB: (Total of 5 licenses issued; Total of 2 licenses in use)
"MATLAB" v34, vendor: MLM, expiry: 01-jan-0000
floating license
----------------------------------- # matlab MATLAB is selecting SOFTWARE OPENGL rendering. License checkout failed. License Manager Error -4 Maximum number of users for MATLAB reached. Try again later.

Nelson Nwaogu
Nelson Nwaogu on 9 Sep 2015
why am i getting this message while i purchased a licence?
  1 Comment
Scott on 2 May 2016
Edited: MathWorks Support Team on 7 Jan 2021
Hi Nelson,
Typically you'd see this error on a license shared by a company or school, not on a license you purchased individually. Please contact MathWorks support if you're seeing this error in relation to a license you've purchased.
MathWorks Installation & Licensing Support

Sign in to comment.

Seyedmajid azimi
Seyedmajid azimi on 16 Jan 2016
Edited: MathWorks Support Team on 2 Dec 2020
in my machine in the path below there is not lmstat! cd /usr/local/MATLAB_R2010b/etc
/usr/lib/matlab-8.6/etc$ ls glnxa64 LicenseAdministration.pdf
/usr/lib/matlab-8.6/etc/glnxa64$ ls lmgrd lmutil MLM
what is the problem? I'm faced with a following error which it reffered to this link.
fast_rcnn startup done License checkout failed. License Manager Error -4 Maximum number of users for Distrib_Computing_Toolbox reached. Try again later. To see a list of current users use the lmstat utility or contact your License Administrator.
Diagnostic Information: Feature: Distrib_Computing_Toolbox License path: /home/azimi/.matlab/R2015b_licenses:/usr/lib/matlab-8.6/licenses/license.dat:/usr/lib/matlab-8.6/licenses/*.lic Licensing error: -4,132. Error using gpuDevice (line 26) The GPU functionality requires a Parallel Computing Toolbox license.
Error in auto_select_gpu (line 15) g = gpuDevice(i);
Error in script_faster_rcnn_demo (line 9) opts.gpu_id = auto_select_gpu;
Kyle Perry
Kyle Perry on 12 Dec 2018
Edited: MathWorks Support Team on 24 Nov 2020
If you are still receiving an issue running then please contact our support team so we can help find out the cuase of the issue. I have attached a link below that contains all the information for the license manager commands and another that contains the link to our support team.

Sign in to comment.

Jennifer Dhont
Jennifer Dhont on 10 Aug 2017
Edited: MathWorks Support Team on 2 Dec 2020
I get the same error:
License checkout failed. License Manager Error -4 Maximum number of users for MATLAB reached. Try again later.
Diagnostic Information: Feature: MATLAB License path: Licensing error: -4,0.
But I am using a Free Matlab Trial, got the license id when asking for a trial and I am the only user. The trial worked perfectly for a week, installed last week so 30 days are not over yet.
Can anyone help?? Thanks!
  1 Comment
Kyle Perry
Kyle Perry on 28 Aug 2017
Hi Jennifer,
This usually means that you most likely have a network license file on your computer that MATLAB is detecting. Please contact us and we can help resolve the issue.

Sign in to comment.

Paz dosa
Paz dosa on 22 Mar 2018
I get the same error. In my case lmstat -a shows: ... Users of MATLAB: (Total of 31 licenses issued; Total of 13 licenses in use) ...
Which seems to indicate that there are plenty of available licenses. The license servers used are correct. Any idea what to do next?
  1 Comment
Sebastian on 1 Nov 2022
Were you able to find a solution to the difference on the total number of licenses issued vs licenses in use?

Sign in to comment.

Stefano Tirelli
Stefano Tirelli on 1 Jul 2021
Hello, same problem: Matlab not running - licenses available. Why?
Sebastian on 1 Nov 2022
Seeing the same issue with licenses issued vs licenses in use. Were you able to get a resolution?

Sign in to comment.

Freeman Tang
Freeman Tang on 13 Oct 2021
Hello, I need license setup please.


Find more on Manage Products in Help Center and File Exchange


No tags entered yet.


Community Treasure Hunt

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

Start Hunting!