How to run an MT5 trading bot on a VPS
Why trading bots need a VPS, what to choose, and how to set up MetaTrader 5 and your Expert Advisor on it step by step.
6 min read. Updated 2026-12-03.
A bot only trades while MetaTrader 5 is open and connected. If your computer sleeps, restarts or loses internet, the bot stops, sometimes with trades still open. A VPS (virtual private server) is a computer in a data centre that stays on all the time, so your bot keeps running.
Two ways to get one
- A Windows VPS from a hosting company. You connect to it with Remote Desktop and use it like a normal computer. It can run several MetaTrader terminals.
- The virtual hosting built into MetaTrader 5. In the Navigator, right-click your account and choose to register a virtual server. It copies your charts and bots to a server near your broker. It is simple, but you can't log in to it like a normal computer.
What to look for
- Windows, so MetaTrader 5 runs normally.
- 1 to 2 GB of memory is usually enough for one or two terminals.
- A location close to your broker's trade server. Lower delay means fills closer to the prices the bot asked for.
- Good uptime and support. Some brokers offer a free VPS above a certain balance.
Setting it up
- Connect to the VPS with Remote Desktop (on Windows: Remote Desktop Connection; on a phone or Mac: the Microsoft Remote Desktop app), using the address, user name and password from your provider.
- Download and install MetaTrader 5 from your broker's website on the VPS.
- Log in to your trading account.
- Install the bot as you would on your own computer: copy the .ex5 file into MQL5, Experts, allow algorithmic trading, add any WebRequest address, and attach it to the right chart.
- Check the Experts tab for the bot's start message.
- Close the Remote Desktop window with the X. Do not log out or shut down: that would close MetaTrader.
Keep an eye on it
- Check the account from the MetaTrader app on your phone every day or two.
- Watch for Windows updates restarting the VPS. If it restarts, reopen MetaTrader and check the bot is running.
- Never run the same bot on the same account from two places at once, or it may open duplicate trades.
Prefer not to do this yourself? Our done-for-you VPS setup installs MetaTrader 5 and your bot and matches the risk settings to your balance.