Retrieving a Web License Service (WLS) client license
Web License Service (WLS) licenses allow you to run Gurobi from any Internet-connected Windows, Linux, or macOS device. They may be configured to work in containers, outside of containers (in a physical or virtual machine running Windows, Linux or macOS), or in both types of environments. To use a WLS license, your application will need to provide valid credentials, which can be done in a number of ways. When your application starts a Gurobi environment, it will communicate with the Gurobi WLS server over the Internet to retrieve a token that will allow it proceed.
The simplest way to use a WLS license is with an API key stored in a
gurobi.lic license file. To retrieve an API key for your
license, visit the
Web License Manager
site, log in to your account,
click on the
API Keys tab, and finally click
CREATE API KEY to create and download an API key for that
license. We recommend that you store the resulting
gurobi.lic file in a default location (either your home directory or c:\gurobi).
gurobi.lic file should contain three lines like this:
WLSACCESSID=203dec48-e3f8-46ac-0184-92d7d6ded944 WLSSECRET=a080cce8-4e01-4e36-955e-61592c5630db LICENSEID=12127
These provide the license ID, an access ID for that license, and the corresponding secret key. These credentials are private and should not be shared with anyone who is not entitled to use your license.
If you are writing an application that calls Gurobi from a
programming language API, you can provide your credentials through
that API. You do this by retrieving an API key, as above, and setting
parameters to the values associated with that key.
Using a non-default license file location
When you run the Windows version of the
Gurobi Optimizer, it will look for the
gurobi.lic key file in
three different default locations: c:\gurobi,
c:\gurobi1000 (for Gurobi
10.0.0), and your home directory. Note that these default paths
are absolute, so for example Gurobi will look for the license key file
in c:\gurobi, even if the software is
installed in d:\gurobi. Note that the token
server won't look for the license file in your home directory (it runs
under username LocalService, so it doesn't have access to your
If you would like to use a non-default license key file location, you
can do so by setting a system
GRB_LICENSE_FILE to point to the license
key file. See Setting environment
variables for details on how to do this.
Important note: the environment variable should point to the license key file itself, not to the directory that contains the file.
Once you have followed the steps above and obtained a license key file, your next step is to test your license.