MetaTrader in your browser. Run the MetaTrader 5 terminal and MetaEditor in a lightweight Linux desktop container accessible from any browser: charts, Expert Advisors (EAs), MetaEditor, and Strategy Tester. One container runs one trading account.
Runs under WineHQ staging on linuxserver.io's Selkies desktop (Debian 13).
📖 Full guide at metatrader-docker.blunan.com: reverse proxies, VPNs, settings, updates, and troubleshooting.
- 🌐 Any browser — Charts, EAs, MetaEditor, and Strategy Tester with shared clipboard and audio support.
- 🔐 HTTPS & password — Required password authentication; served strictly over HTTPS.
- 🏠 Private by default — Binds to loopback (
127.0.0.1) by default. Access via SSH tunnel, VPN, or reverse proxy. - 🛡️ Hardened desktop — No terminal or
sudo; origin checks prevent stream hijacking and framing. - ✅ Verified installers — Downloads MetaQuotes, Microsoft Edge WebView2, and optional Python installers at first boot only after verifying Authenticode signatures. Base image contains no proprietary binaries.
- 📂 Custom EA directory — Mount host directories into MetaTrader under
MQL5/<section>/Mounted. - 🐍 Optional Python — Set
MT_PYTHON=trueto install Windows Python and MetaQuotes'MetaTrader5package for Python scripting. - 💾 Graceful shutdown — Saves charts and settings across stops; automatically relaunches on unexpected exit.
⚠️ Not affiliated with or endorsed by MetaQuotes or Microsoft.
🧰 You need a Linux server with Docker Engine and Compose v2, on amd64 (x86-64), with about 4 GB of memory and 10 GB of disk, and SSH access to it.
1. Create the folders and the desktop password on the server:
mkdir -p metatrader-docker && cd metatrader-docker
mkdir -p -m 700 data secrets
mkdir -p ea
openssl rand -base64 24 | tr -d '\n' > secrets/password
cat secrets/password; echo
sudo chown root:root secrets/password
sudo chmod 0400 secrets/passwordKeep the password in your password manager (sudo cat secrets/password to view). data stores broker credentials (mode 700), and ea holds custom MQL5 files. If your host user/group differs from 1000, set PUID and PGID in compose.yaml.
2. Save this as compose.yaml in the same folder:
# metatrader-docker: MetaTrader in your browser, one container for one trading account.
services:
metatrader-docker:
image: ghcr.io/blunan/metatrader-docker:latest # or pinned date tag e.g. :20261019.1
container_name: metatrader-docker
restart: unless-stopped
stop_grace_period: 30s # allow MetaTrader to persist state cleanly
# Never add init: true: image s6 supervisor must be process 1.
security_opt: [no-new-privileges:true]
cap_drop: [ALL]
cap_add: [CHOWN, DAC_OVERRIDE, FOWNER, SETUID, SETGID, KILL] # required for desktop startup
shm_size: 1gb
mem_limit: 4g # 6g for heavy HTML pane usage (Help, Market)
environment:
FILE__PASSWORD: /run/secrets/password
secrets: [password]
volumes:
- ./data:/config # persistent account data
- ./ea:/mql5 # optional: custom EAs, indicators and scripts
ports:
- "127.0.0.1:3001:3001" # localhost only: reach via SSH tunnel or reverse proxy
secrets:
password:
file: ./secrets/passwordWithout Compose, see the quick start for equivalent docker run syntax.
3. Start it and follow its log:
docker compose up -d
docker compose logs -fInitial setup downloads and installs WebView2 and MetaTrader (~2–3 minutes), completing when the log reports starting MetaTrader.
4. Open the desktop. On your computer, open an SSH tunnel to the server:
ssh -N -L 3001:127.0.0.1:3001 you@your-serverBrowse to https://localhost:3001 and accept the self-signed certificate (see guide to trust it locally). Sign in as trader with your password.
5. Configure MetaTrader. Log in with Save password enabled. Configure algorithmic trading protections in Tools → Options → Experts as shown in step 6.
| Page | What's in it |
|---|---|
| 🚀 Quick start | Complete setup guide, docker run flags, and local certificate trust |
| 🌍 Access and reverse proxy | SSH tunnel, VPN, Tailscale, Caddy, nginx, Traefik, cloudflared, custom certificates, and host networking |
| ⚙️ Folders and settings | Volume mounts, backups, environment variables, validation rules, and warnings |
| 🖱️ Using MetaTrader | Clipboard, audio, shortcuts, MetaEditor, HTML panes, memory sizing, and Python scripting |
| 🔄 Operations and updates | Graceful shutdown, restarts, health check, image tags, updates, and LiveUpdate |
| 🩺 Troubleshooting | Log locations, common installation failures, and benign startup warnings |
| 🔏 Security and verification | Image digest pinning, Cosign verification, outbound traffic, and AI-agent servers |
| 🛠️ Build it yourself | Local Docker builds, test suite, CI workflows, and documentation preview |
Copyright (C) 2026 Brayan Luna
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE for the full text.
Built on linuxserver.io's Selkies base image (GPL-3.0). During initial setup, the container downloads MetaTrader 5 and Edge WebView2 Runtime from their respective publishers (and Python / packages if MT_PYTHON=true). These components are subject to their own license terms. Not affiliated with or endorsed by MetaQuotes or Microsoft.