- Fully containerized IBKR TWS instance + IBC Alpha in Docker, no external dependencies
- TWS API access (automatically configured), proxied to localhost internally via
nginx
- Supports noVNC (a browser-based VNC client, proxied via Websockify)
- Autorestarts TWS automatically (for example, due to daily logoff)
- Install Docker
- Clone this repo:
git clone https://github.com/extrange/ibkr-docker.git
cd ibkr-docker
- Enter your credentials:
- Create 2 files named
username.txt
andpassword.txt
and input your IBKR username/password accordingly
- Create 2 files named
- Build the image:
docker-compose build
- Start the container:
docker-compose up -d
- TWS API is available on port
8888
by default - You can view the noVNC client at localhost:6080/vnc.html
- To stop:
docker-compose down
This container is setup to connect to a paper account. To switch to a live account:
- Modify nginx.conf's
proxy_pass
accordingly:- Live Account:
7496
- Paper Account:
7497
- Live Account:
- Modify
app/config.ini
:TradingMode=live
You will have to restart the container after making these changes.
TWS is updated frequently. Whenever the major version is incremented, you need to reconfigure the script.
Modify the value of TWS_MAJOR_VRSN
in docker-compose.yml
to the latest version number without periods/alphabets (i.e. 10.11e -> 1011)
AcceptBidAskLastSizeDisplayUpdateNotification=accept
AcceptIncomingConnectionAction=accept
AcceptNonBrokerageAccountWarning=yes
TradingMode=paper
- If either of
username.txt
orpassword.txt
are missing, Docker creates empty folders with the same name