8 Client setup

This section describes setting up client machines.

8.1 With a local license file

Default setup

The preferred option is to place the license file mosek.lic in the directory mosek in the user’s home directory. That means


on UNIX systems and Windows, respectively. If no other configuration options are set (see below) this is the default location where MOSEK looks for a license. This works for all types of licenses. If the license file contains a floating license, the client will use the information in that file to find and contact a token server.

Environment variable

Alternatively, the path to the license file may be set by the environment variable MOSEKLM_LICENSE_FILE, for example:


Command line options

From the MOSEK command line the path to the license file can be set with the option -l.

From an API

In the Optimizer API and Fusion API the path to the license file can be set with the method putlicensepath of the environment or Model, respectively, before first optimization.

8.2 Without a local license file

Another method to check out a license from a floating license token server is to set the environment variable MOSEKLM_LICENSE_FILE in one of the following formats


where hostname is the name of the token server machine and port is the port on which MOSEKLM is listening. Then the client MOSEK application will contact the server directly and the possible overhead for opening and reading the license file is eliminated. Observe a potential firewall may block access to the token server.

The same format can be used in conjunction with the command line -l option and in the putlicensepath method as mentioned in the previous section.

8.3 Testing and debugging

In either case the client configuration can be tested by running the program msktestlic.

If any errors related to licensing appear, then go through the error messages and look for a line containing the path to the license file, for example:

License path: /home/someplace/mosek/mosek.lic


License cannot be located. The default search path is ':/home/someplace/mosek/mosek.lic:'

This is the actual location where this instance of MOSEK was trying to locate the license. If it does not correspond to your expectations then go through the setup again or check that this location contains the correct file.