Why it does not install
As of November 2026, every MetaTrader5 wheel on PyPI is built for Windows x86-64 and there is no source package, so pip on Linux reports no matching distribution. The package also needs a logged-in MT5 terminal on the same machine.
Sources
Wine, mt5linux and Docker
- Plain Wine. Install MT5 and a Windows build of Python under Wine, then run your script with that Python.
- mt5linux. Runs the Windows package under Wine and exposes it over RPyC, so your Linux Python calls the same functions remotely.
- Docker. Images such as gmag11/MetaTrader5-Docker bundle Wine, MT5 and a VNC desktop for the first login. Plan for at least 4 GB of RAM per container.
What that setup costs to run
- MT5 updates itself. A new terminal build can break under your Wine version until you change one or the other.
- Someone has to log the terminal in, watch it, and restart it after broker maintenance or a crash.
- Each terminal is logged in to one account at a time, so more accounts mean more terminals and more memory.
- If anything outside the machine calls your bridge, you add HTTPS and authentication yourself.
- Your broker password sits in the container or on disk, so you secure it.
For one account on a machine you already run, this can be worth it. It also gives you ticks and Expert Advisors, which FiveSocket does not.
Linux with FiveSocket
FiveSocket runs the terminal under Wine on its own servers. Your Linux code, container or serverless function sends HTTPS requests.
import os
import time
import requests
base = "https://api.fivesocket.com/v1"
headers = {"Authorization": f"Bearer {os.environ['FIVESOCKET_KEY']}"}
accounts = requests.get(f"{base}/accounts", headers=headers, timeout=30)
accounts.raise_for_status()
account_id = accounts.json()["data"][0]["id"]
while True:
response = requests.get(f"{base}/accounts/{account_id}/balance", headers=headers, timeout=60)
if response.status_code != 202:
break
time.sleep(int(response.headers.get("Retry-After", "5")))
response.raise_for_status()
account = response.json()
print(account["balance"], account["equity"], account["currency"])Trading leveraged FX and CFDs carries a high risk of losing money quickly. Try any new setup on a demo account first. FiveSocket connects software to your account, and neither FiveSocket nor an AI assistant's output is investment advice.
Frequently asked questions
- Can I run the MT5 terminal in Docker?
- Yes, under Wine. Community images do this, but you keep the image, Wine and the terminal working yourself.
- Does FiveSocket have a Python SDK?
- No. Use requests, httpx or any HTTP client. The OpenAPI document describes every request if you want to generate a client.
- How much does FiveSocket cost?
- Plans start at $9.99 a month for one MT5 account. Link your MT5 account and try it free, no card: 24 hours or 100 calls, whichever comes first. Then a 7-day free trial, card required. Cancel anytime. The trial includes one connected MT5 account.