Skip to main content
The bot communicates with MetaTrader 5 via a custom REST API. MT5 runs inside a Windows 11 VM (QEMU/KVM) inside a Docker container on a Linux VPS. Linux only. macOS cannot run this component — no /dev/kvm.

Prerequisites

RequirementDetails
OSLinux with KVM enabled (/dev/kvm must exist)
RAM8 GB total, 5 GB available for the VM
Disk25 GB free (Windows ISO 4 GB + VM disk 11 GB + MT5)
DockerDocker + Docker Compose plugin installed
MT5 installermt5setup-<broker>.exe from your broker’s website
Verify KVM is available:
ls /dev/kvm && echo "KVM OK"

Setup

1

Configure accounts

cp config/accounts.json.example config/accounts.json
cp config/terminals.json.example config/terminals.json
Edit config/accounts.json with your MT5 credentials:
{
  "vtmarkets": {
    "main": {
      "login": 12345678,
      "password": "your_password",
      "server": "VTMarkets-Demo"
    }
  }
}
Edit config/terminals.json:
[
  { "broker": "vtmarkets", "account": "main", "port": 6542 }
]
2

Add the MT5 installer

Download the MT5 installer from your broker’s website. The filename must match the broker key in accounts.json.
cp ~/Downloads/mt5setup.exe mt5installers/mt5setup-vtmarkets.exe
3

Generate an API token

openssl rand -hex 32 > config/api_token.txt
Copy this value into your .env as API_TOKEN.
4

Launch

make up
First boot: downloads tiny11 (~4 GB debloated Windows 11), installs the OS (~10 min), installs MT5 and Python. Subsequent boots take ~1 minute.

Manage the server

make status      # VM health + API availability
make logs        # stream live logs
make down        # stop gracefully
make clean       # wipe VM disk (keeps ISO — faster than first boot on next run)
make distclean   # full reset including ISO download

Verify the API is up

curl -H "Authorization: Bearer $(cat config/api_token.txt)" \
     http://localhost:6542/ping
Expected response:
{"time": 1745000000, "status": "ok"}

Memory and resources

The container uses 512 MB RAM + 5 GB swap. Windows + MT5 run comfortably on swap. Four simultaneous terminal instances use ~15% CPU at idle.

Multiple broker instances

To run a second instance (e.g. a standard account alongside a cent account), add a second entry to config/terminals.json with a different port:
[
  { "broker": "vtmarkets", "account": "cent",     "port": 6542 },
  { "broker": "vtmarkets", "account": "standard", "port": 6543 }
]
Each instance runs its own bot process with API_URL pointing to its port.