Skip to content

Add IB Gateway support for ARM64 architecture#9410

Open
dfjmax wants to merge 1 commit intoQuantConnect:masterfrom
dfjmax:feature-9409-add-ibgateway-arm-support
Open

Add IB Gateway support for ARM64 architecture#9410
dfjmax wants to merge 1 commit intoQuantConnect:masterfrom
dfjmax:feature-9409-add-ibgateway-arm-support

Conversation

@dfjmax
Copy link
Copy Markdown

@dfjmax dfjmax commented Apr 17, 2026

Description

This PR adds Interactive Brokers Gateway installation to the ARM foundation image (DockerfileLeanFoundationARM), enabling local live trading with IBKR on Apple Silicon Macs (M-series) and other ARM64 platforms.

Previously, the ARM image lacked IB Gateway support, forcing users to either:

  • Use QuantConnect Cloud for IB live trading
  • Run LEAN + IB Gateway on a separate x86-64 machine/VPS

This change brings the ARM foundation image to feature parity with AMD64 for Interactive Brokers support.

Changes:

  • Install IB Gateway using stable-standalone ARM installer from Interactive Brokers
  • Add required dependencies: libasound2, libnss3, libnspr4
  • Follow the same installation pattern as AMD64 DockerfileLeanFoundation

Note on lean-cli:
This PR adds IB Gateway to the ARM foundation image. Full IB live trading on ARM will also require removing the guard in lean-cli that currently prevents Interactive Brokers from being used on ARM hosts.

# Guard in lean-cli that needs to be removed
if container.platform_manager.is_host_arm():
    if "InteractiveBrokersBrokerage" in lean_config["environments"][environment_name]["live-mode-brokerage"]:
        raise RuntimeError(f"InteractiveBrokers is currently not supported for ARM hosts")

Related Issue

#9409

Motivation and Context

This PR enables researchers and traders with Apple Silicon hardware to run local LEAN bots with Interactive Brokers without needing additional x86 hardware.

Without this change, users on Apple Silicon must either use QC Cloud for IB live trading or maintain a separate x86 machine, which adds cost and complexity.

Requires Documentation Change

The LEAN documentation may need a note about ARM64 support for Interactive Brokers.

How Has This Been Tested?

Testing Environment:

  • Hardware: Apple Silicon (ARM64)
  • OS: macOS (Docker Desktop)
  • Image: lean-cli/foundation:latest (built from DockerfileLeanFoundationARM)
Screenshot 2026-04-17 at 14 42 21

Test Cases:

  1. lean build completes successfully on ARM64
  2. IB Gateway installs without errors during Docker build
  3. IB Gateway starts and initializes correctly
  4. API connection to Interactive Brokers succeeds (port 4002)
  5. Authentication with IBKR Mobile works
  6. Historical data download via lean data download works (tested with SPY Daily data from 2000-2025)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

Fixes QuantConnect#9409

Install Interactive Brokers Gateway in the ARM foundation image to enable
Interactive Brokers data downloads and trading on Apple Silicon and other
ARM64 platforms.

Changes:
- Add IB Gateway installation using stable-standalone ARM installer
- Install required dependencies (libasound2, libnss3, libnspr4)
- Mirror the AMD64 installation pattern for ARM64 compatibility

Tested:
- Build succeeds on ARM64 (Apple Silicon)
- IB Gateway starts and connects successfully
- Historical data downloads work via IB API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable local live trading with Interactive Brokers on Apple Silicon

1 participant