When using a floating token server license, a program that calls Gurobi Optimizer must obtain a token from a Gurobi token server before it can solve an optimization model.
Note: If you are setting up a machine as a client of an existing token server, you just need to create a token server client license.
You will first need to choose a machine to act as your Gurobi token server. This token server issues 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.
Retrieving your token server license key file
Once you've chosen a machine to act as your token server, you'll need to run the grbgetkey command on that machine to retrieve your Gurobi license key from the Gurobi User Portal. 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.
The exact grbgetkey command to run for a specific license is indicated in the popup window after you select the license from the table of licenses (e.g., grbgetkey 253e22f3-...). We recommend that you use copy-paste to copy the entire grbgetkey command from our website and paste it into a shell window.
The 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, grbgetkey will ask for the name of the directory in which to store your license key file (gurobi.lic). You should see a prompt that looks like this:
info : grbgetkey version 11.0.0, build v11.0.0rc2
info : Contacting Gurobi license server...
info : License file for license ID 146542 was successfully retrieved
info : License expires at the end of the day on 2024-02-15
info : Saving license file...
In which directory would you like to store the Gurobi license key file?
[hit Enter to store it in /opt/gurobi]:
info : License 146542 written to file /opt/gurobi/gurobi.lic
You can store the license key file anywhere, but we strongly recommend that you accept the default location for your system by hitting Enter. Setting up a non-default location is error-prone and a frequent source of trouble. If you do need to store the license file somewhere other than the default location, please see Where do I place the Gurobi license file (gurobi.lic)? for important details.
Instructions for computers without an internet connection
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. Please refer to How do I use grbgetkey on a machine different to the one where Gurobi will be used?
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 your gurobi.lic file:
You 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.
- Once you have your license key file set up, you will need to start the Gurobi token server. The token server is a process that runs in the background, handing out available tokens to programs as they request them.
- Each client for the token server will need to create a token server client license to allow client programs to find the token server.
- Finally, once your client license is in place, you can test your license. If you are unable to connect to the server, you'll need to make sure the server is installed and running.