Interactive Brokers: Gateway Install & Setup

A brief tutorial on setting up the Interactive Brokers Gateway on Linux.

I’m working on a project that uses data acquired from the Interactive Brokers API. The API is not accessible directly but rather via a local client which is installed on your machine. You have two options for this client:

  • Interactive Brokers Trader Workstation (TWS) and
  • Interactive Brokers Gateway.

The former provides a fully featured trading interface, while the latter simply provides and interface to the API. I’m going with the latter.


Download the Gateway installer. There are two versions: stable and latest.

# Stable version
curl -o $IBDOWNLOAD/stable-standalone/
# Latest version
curl -o $IBDOWNLOAD/latest-standalone/


Next you need to run the installer.

chmod u+x

You can safely accept all of the defaults in the installation process.

The Interactive Brokers Gateway installation wizard.


During the installation a Jts directory will be created. Beneath that you’ll find a sub-directory named with the version of the gateway (for example, 1015) and within that you’ll find the executable, ibgateway. Run the executable.

Choose the IB API option for API type. Fill in your username and password. Press the Log In button.

Interactive Brokers Gateway login dialog.

From time to time you’ll find that you are unable to login because the servers are down for maintenance. Just be patient and the service will be restored. Maintenance seems to typically occur around midnight UTC on a Friday night, but this seems to vary.

Interactive Brokers Gateway login dialog with notice about scheduled maintenance.

Once connected you should see an interface showing the connection status.

The Interactive Brokers API Gateway.


Once the Gateway is running and you’re connected you’ll immediately be able to interact with the API. You can do this from a variety of languages. Unless timing is hyper-critical for what you’re doing then I’d suggest exploring either the Python or R interface to the API.