Deploy with Docker¶
The repo ships a docker-compose.yml at the root that runs qkt + mt5-gateway together. This is the recommended production deployment for live MT5 trading.
Prerequisites¶
- Docker + Docker Compose v2
- An
mt5-gateway:latestimage — build from github.com/elitekaycy/mt5-gateway or pull from your private registry .envpopulated with broker credentials (copy from.env.example)qkt.config.yamlwith at least one broker profile (copy fromqkt.config.yaml.example)
Stack layout¶
docker compose up -d
│
├─ mt5-gateway (Wine + MT5 + Flask)
│ • port 3000 → VNC, log in to MT5 GUI on first start
│ • port 5001 → HTTP API for qkt to talk to
│
└─ qkt (daemon)
• depends_on: mt5-gateway healthy
• mounts: ./strategies:/strategies, ./qkt.config.yaml:/etc/qkt/qkt.config.yaml
• port 47000-47100 → per-strategy observability
First run¶
-
Bring up the stack:
-
Log in to MT5 once: connect to
localhost:3000with a VNC client, useVNC_PASSWORDfrom.env, log in to your broker through the MT5 GUI. The healthcheck will go green within a minute. -
Verify:
-
Deploy a strategy: drop a
.qktfile into./strategies/— the daemon's--load-dir /strategiesauto-deploys it on next restart. For hot-deploy:
Persistence¶
The compose file declares a named volume qkt-state mounted at /var/lib/qkt. Logs land at qkt-state:/logs/<name>.log; the control port + state files live there too.
To inspect logs from outside the container:
Healthchecks + restart¶
qkt declares restart: unless-stopped and depends_on: mt5-gateway: condition: service_healthy. If the gateway dies, qkt waits for its healthcheck to recover before restarting.
Tearing down¶
docker compose down # keeps qkt-state volume
docker compose down -v # also wipes the volume (state + logs lost)
Common issues¶
qkt brokers listshows the profile butgateway: down. MT5 isn't logged in. VNC at:3000and log in.- Compose can't pull
mt5-gateway:latest. The image isn't on Docker Hub. Build it locally or use a private registry. - Symbol not found errors. Verify the broker's actual symbol via the MT5 market watch. The default
exnessprofile assumes themsuffix; other brokers vary. - Container loses ports on restart. Add
restart: unless-stoppedto both services (already in the shipped compose file).
See also¶
- Get started: deploy MT5 — first-time walkthrough
- Reference: config schema —
qkt.config.yamlfields - Existing example — variant deployments