Starting a token server

Starting a token server

Important note: most Gurobi licenses do not use the token server. You should only follow these instructions if you are setting up a floating license. If you are not sure whether you need to start a token server, you can examine the contents of your gurobi.lic file. If it contains the line TYPE=TOKEN, and does not contain the line MACHINELIMIT=0, then you need a token server.

To start the Mac token server daemon, run the program grb_ts (with no arguments) on your token server machine. You only need to do this once -- the token server will keep running until you stop it (or until the machine is shut down). Be sure that the license key file has been installed before running this program. Note that the token server runs as a user process, so you do not need root privileges to start it.

If you would like the token server to restart when the machine is rebooted, you should ask your system administrator to start it from /etc/rc.local. If your Gurobi installation and license key file are in their default locations (either your home directory or /Library/gurobi), add the following:


To stop a running token server, you can issue the grb_ts -s command. You can also use the ps command to find the relevant process ID, and the kill command to terminate that process.

Output from the token server goes to the system log (/var/log/system.log). You will need to modify /etc/syslog.conf to see these messages, since by default OS X only allows error message in the system log. Once you have modified syslog.conf, you should see a message similar to the following when you start the server:

Mar 5 12:37:21 mymachine grb[7917]: Gurobi Token Server started: Sat Mar 5 12:37:21 2021

By default, the token server only produces logging output when it starts. To obtain more detailed logging information, start the token server with the -v switch. This will produce a log message each time a token is checked in or out.

The token server forks off a separate process that runs in the background. Use the -n switch to run it in the foreground instead.


If you run into trouble accessing the token server, check to see if the server machine is running firewall software (like Bastille or ipfilter) that is blocking access to some ports. The Gurobi token server uses port number 41954 by default, so you'll need to open access to that port on the server. Please consult the documentation for your firewall software to determine how to do this. If there's a conflict on the default port, you can choose a different one by adding a PORT line to both the server and the client license key files:


You can choose any available port number.

Next steps

Clients of the token server also need simple license files. Your next step is to set up a client license.

Once your token server is running and you've set up a client license, you can move on to testing the license.

Once you've set up a client license, you can test the state of the token server at any time, as well as get a list of the clients that are currently using tokens, by typing gurobi_cl --tokens.