IB Gateway Daily Restart and the Sunday Login
With Auto restart set, IB Gateway and TWS restart daily without a login, Monday to Saturday. On Sunday, after the weekly reset, you log in again, per IBKR's API FAQ.
Checked Not affiliated with Interactive Brokers.
| Setting | Where | Does |
|---|---|---|
| Set Auto Restart Time | WhereGlobal Configuration > Lock and Exit | DoesRestarts, no login |
| Set Auto Log Off Time | WhereThe same page | DoesLogs off; you log in again |
| Never lock Trader Workstation | WhereThe same page, in TWS | DoesNo lock that drops the API |
| Socket Port | WhereGlobal Configuration > API > Settings | Does4001 for Gateway, 4002 for paper |
Restart outside IBKR's daily reset, 00:15 to 01:45 ET in North America. Logins can fail during it.
What still needs you
- Sunday: IBKR invalidates tokens at 1:00 am ET; the next start asks for a login.
- Another login with the same username, on Client Portal, TWS or IBKR Mobile.
- The machine asleep, off or updating at restart time.
- A failed update. IBKR says the offline versions restart best.
Running it unattended4 rows
| Option | State on 5 November 2026 | What to know |
|---|---|---|
| Log in by hand on Sunday | State on 5 November 2026Supported by IBKR | What to knowApprove it with IB Key on IBKR Mobile |
| A second username for the bot | State on 5 November 2026Free, in Account Management | What to knowMarket data is billed per username |
| IBC | State on 5 November 2026Archived on GitHub; last release 3.24.2, 21 August 2026 | What to knowTypes the login into Gateway or TWS; third party |
| ib-gateway-docker | State on 5 November 2026Maintained; IB Gateway 10.51.1e image, 27 October 2026 | What to knowGateway with IBC in Docker; third party |
IBKR does not support headless operation and does not recommend third-party tools. Read the code of anything that types your password.
What your code sees5 rows
| Code | TWS message | Do |
|---|---|---|
| 1100 | TWS messageConnectivity between IB and the TWS has been lost. | DoWait; the daily reset or a competing session can cause it |
| 1101 | TWS messageConnectivity between IB and TWS has been restored- data lost. | DoSend your market data requests again |
| 1102 | TWS messageConnectivity between IB and TWS has been restored- data maintained. | DoNothing |
| 502 | TWS messageCouldn't connect to TWS. | DoGateway is not up yet, or the port is wrong |
| 326 | TWS messageUnable to connect as the client id is already in use. | DoUse another client ID |
When the program itself restarts, connectionClosed fires. Reconnect on a timer until it is back.
Other things that end a run4 items
- Saturday's reset, 00:00 to 02:00 ET.
- A token IBKR revokes for security, rarely; the restart then asks for a login.
- This message, which means the weekly login is due:
Login failed = Soft token=0 received instead of expected permanent for zdc1.ibllc.com:4001 (SSL). - In TWS for IBHK accounts, no Never lock Trader Workstation or Auto restart. IBKR suggests IB Gateway, which does not lock and has Auto restart.
Second factors the API accepts2 items
- IB Key, Handy Key, SMS and Digital Security Card+.
- Not the Security Code Card, Temporary Security Code Card or Online Code Card.
Where Gloom fits
Gloom's IBKR Gateway plugin connects to the Gateway you keep running: Gateway / TWS in Brokers (BR).

Gloom covers
- Finding it on 4001, 4002, 7496 or 7497.
- Retrying every 2 seconds through a restart.
- The IBKR Console (
IBKR) and a Trade tab.
Gloom does not cover
- Logging in to Gateway, Sunday included.
- The browser version, which cannot reach a local Gateway.
Sources5 sources
- IBKR's third-party FAQ and system status, read 5 November 2026: Monday to Saturday without a login, the Saturday night reset, other logins with the same username, free extra usernames, no headless operation, no recommendations, and the reset times.
- IBKR's Trader Workstation guides, updated 8 October 2025: Lock and Exit (the menus and both timers) and Auto Restart Considerations (Sunday 1:00 am ET, sleep, updates, offline versions, revoked tokens).
- IBKR's TWS API docs, read 5 November 2026: Daily and Weekly Reauthentication (the recommended settings, the login message, a weekly cycle that "starts on every Monday"), TWS Configuration for API Use, default ports, error codes, broken socket and supported 2FA.
- GitHub, read 5 November 2026: IbcAlpha/IBC and gnzsnz/ib-gateway-docker.
- Gloom's IBKR Gateway plugin source and readme, v1.3.0: the ports it tries, the 2-second retry, the Console and the Trade tab.
Not verified3 claims
- Which day the weekly login bites. IBKR's guide says Sunday 1:00 am ET; its API docs say the cycle starts Monday. Neither was tested here.
- The menu path in IB Gateway. IBKR names Global Configuration > Lock and Exit for both programs; Gateway was not opened here.
- A second daily drop at another fixed time, after the reset, reported in September 2026 (r/interactivebrokers). No cause was given.