Skip to content

Interactive Brokers: Headless IB Gateway Installation using IBController on Ubuntu Server

Notifications You must be signed in to change notification settings

ronnyli/headless-ib-gateway-installation-ubuntu-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interactive Brokers: Headless IB Gateway Installation using IBController on Ubuntu Server

This guide was written for anyone that would like to host an instance of the IB Gateway API on GCP. This will allow you to use libraries like node-ib and ib-sdk in a production environment.

Pre-requisite

You must already have an Interactive Brokers account with account permissions properly configured. If not, you can follow this tutorial

Set up GCP

Note: These instructions are for setting up a paper trading account. Ask Ronny for instructions on how to set up live trading. Also, if you have 2FA set up on your live account, you'll need the IBKR mobile app

  1. Create a GCP account
  2. Create a project called leverheads
    • GCP Console New Project
  3. Make sure you're allowed to create a GCP instance by going to the VM Instances page
    • You may see a message saying that you need to Enable Billing. Click the blue "Enable Billing" button to continue.
    • You may see a message saying that you need to Enable the Compute Engine API. Click the blue Enable API button to continue.
  4. Open the Cloud Shell (top-right corner of the screen)
    • Cloud Shell
  5. Download some necessary files by copy-pasting the below commands into the terminal
git clone https://github.com/ronnyli/headless-ib-gateway-installation-ubuntu-server.git
cd headless-ib-gateway-installation-ubuntu-server
  1. Run the gcloud_commands.sh script by copy-pasting the below command into the terminal
    • sh gcloud_commands.sh
  2. Provide your username and password when you're prompted:
    • User/Password Prompt
  3. You'll also be asked some questions about your GCP instance but you can simply press Enter to skip these steps
  4. When the script is done you'll see a link that looks like http://127.0.0.1:8888/?token=alphanum3r1cstr1ng. Copy and paste it into the URL address but replace 127.0.0.1 with the External IP address of your new GCP instance.
    1. You can find the External IP address on the VM Instances page External IP Address on GCP
  5. You can run any Python code that needs to interact with IB in this JupyterLab setup.
    • For example, after installing ib_insync and dataclasses: Jupyterlab
  6. For security purposes, it is recommended that you edit your Firewall Rules to only allow access from your IP address.
    • The two rules that you want to edit are: ingress-5900 and ingress-8888
    • Ask for help if necessary!

About

Interactive Brokers: Headless IB Gateway Installation using IBController on Ubuntu Server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 99.2%
  • Python 0.8%