The purpose of a token server client license is quite simple: it tells
the client where to find the Gurobi token server. You
can create this file yourself (using a text editor
like vim, for example).
gurobi.lic file typically contains a single line of text:
TOKENSERVER=192.168.1.100You should of course substitute the name or IP address of your token server in the example above.
If your token server was configured to use a non-default port, you'll also need a line that provides the port number:
The client license file may also include four optional lines.
QUEUETIMEOUT line allows you to set a limit (in seconds) on how long a
new Compute Server job will wait in queue before it gives up (and
Any negative value will allow a job to sit in the Compute Server queue
IDLETIMEOUT line allows you to set a limit on how long a Compute Server
job can sit idle before the server kills the job (in seconds). A job is considered
idle if the server is not currently performing an optimization and the
client has not issued any additional commands.
The default value will allow a job to sit idle indefinitely in all but
a few circumstances. The first exception is the Gurobi Instant Cloud,
where the default setting will automatically impose a 30 minute idle
time limit (1800 seconds). If you are using an Instant Cloud pool,
the actual value will be the maximum between this parameter value and the
idle timeout defined by the pool.
The second exception is any program that uses the Gurobi
Python interface (including the Gurobi Interactive Shell). Such
programs will also get a 30 minute idle time limit by default.
SERVERTIMEOUT line allows you to specify the timeout (in seconds)
in case the token server is unavailable. The default value is 30 seconds.
If the client program is unable to contact the server for more
than the specified amount of time, the client will quit with a network
PASSWORD line allows you to connect to a
password-protected token server (you'll need to get the password
from the owner of the token server).
A more complex client token file might look like this:
TOKENSERVER=192.168.1.100 IDLETIMEOUT=60 QUEUETIMEOUT=120 SERVERTIMEOUT=10 PASSWORD=abcd1234
We strongly recommend that you place your client
file in a default location for your platform (either your home directory or /opt/gurobi). Setting up
a non-default location is error-prone and a frequent source of
(If you still want to use a non-default location, please
refer to the instructions that appeared earlier in this
If your client and the token server are both running on the same
machine, they can share a single
gurobi.lic file. You just
need to add the following line to the
gurobi.lic file you
obtained from our website:
TOKENSERVER=localhostThe token server will ignore this line, and the client will ignore everything but this line. Your other option when both client and server are running on the same machine is to create a separate
gurobi.licfile for the client, and to set the
GRB_LICENSE_FILEenvironment variable to point to this file (following the earlier instructions for using a non-default license location).
Once your client license is in place, you can test the license. If you are unable to connect to the server, you'll need to make sure the server is installed and running. Please consult the instructions for starting a token server for more information.