Retrieving a Floating license
If you are using a floating license, you will need to choose a machine to act as your Gurobi token server. This token server doles out tokens to client machines. A client will request a token from the token server when it creates a Gurobi environment, and it will return the token when it destroys that environment. The client machine can be any machine that can reach the token server over your network (including the token server itself). The client can run any supported operating system. Thus, for example, a Linux client can request tokens from a Windows token server.
Once you've chosen a machine to act as your token server, you'll need to run the grbgetkey command on your machine to retrieve your Gurobi license key. Note that the machine must be connected to the Internet in order to run this command. An Internet connection is not required after you have obtained your license key.
If your computer isn't connected to the Internet or if your network security system does not allow the command below to function, we also offer a manual license key process. You'll find manual instructions at the bottom of the License Details page for your license (which can be found by visiting Current Gurobi Licenses and clicking on the appropriate License ID).
command to run for a specific license is indicated at the bottom
of the License Details page (e.g.,
grbgetkey 253e22f3-...). We
recommend that you use copy-paste to copy the entire
command from our website and paste it
directly into the Windows
Search box (and then hit Enter):
grbgetkey program passes identifying information about
your machine back to our website, and the website responds with your
license key. Once this exchange has occurred,
ask for the name of the directory in which to store your license
key file (
gurobi.lic). You should see a prompt that looks
Gurobi license key client (version 9.5.1)
Copyright (c) 2022, Gurobi Optimization, LLC
Contacting Gurobi key server...
Key for license ID 146542 was successfully retrieved.
Saving license key...
In which folder would you like to store the Gurobi license key file?
[hit Enter to store it in c:\gurobi]:
–> License key saved to file 'c:\gurobi\gurobi.lic'.
You can store the license key file anywhere, but we strongly recommend that you accept the default location (either your home directory or c:\gurobi) by hitting Enter. Setting up a non-default location is error-prone and a frequent source of trouble.
Setting a password for your token server
If you want to require clients of your token server to specify a
password in order to check out a token, you'll need to add one line to
PASSWORD=abcd1234You should of course choose your own password. Clients will need to place this same line in their client license files.
When adding this line to your
gurobi.lic file, please be
careful not to modify anything else in the file.
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:\gurobi951 (for Gurobi
9.5.1), 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 have obtained a license key file, your next step is to start the token server.