Running an EA
How to Set Up a VPS for MT5 Expert Advisors: Step by Step, From Choosing One to Daily Checks
By Benjamin Lee · Updated · 6 min read
An Expert Advisor only trades while its terminal is running and connected. Your home computer sleeps, updates, loses its connection and gets switched off. A virtual private server, or VPS, is a remote Windows computer that stays on all day, so the EA keeps managing trades whatever your laptop does. Setting one up is not hard, but a few choices decide whether it runs reliably: where the server is, how you connect, how you keep it secure, and how you check it. This guide takes you from choosing a VPS to a routine that catches problems early.
Key takeaways
- Choose a server location close to your broker's trading server, not close to you.
- A Windows VPS with enough memory for the terminals you plan to run is all most EAs need.
- Keep the VPS secure: strong passwords, updates on a schedule, and no browsing or downloads on it.
- Set MT5 to start automatically and check the Experts tab after any restart.
- Check the VPS daily at first: connection, EA status and open trades.
Why run an EA on a VPS
An EA reads prices and sends orders from inside your terminal. If the terminal closes, the EA stops. Positions it already opened stay open with their stops at the broker, but nothing manages them, and new entries are missed. Home setups fail for ordinary reasons: a Windows update restarts the machine, the internet drops for a minute, a laptop sleeps, a power cut happens. A VPS removes those causes and usually has a faster, steadier connection to the broker. MetaQuotes describes its own hosting service in its help page on virtual hosting, and our VPS guide compares the options.
Choose a VPS: what matters
| Factor | What to look for | Why it matters |
|---|---|---|
| Location | A data centre near your broker's server, often London, Frankfurt, Amsterdam or New York | Shorter round-trip means faster order execution |
| Operating system | Windows Server or Windows with remote desktop | MT5 runs on Windows |
| Memory and CPU | Enough for each terminal you run; 2 GB of memory and 1 to 2 cores is a common start for one or two terminals | A starved server stalls the terminal |
| Storage | Fast SSD with room for history and logs | Tester and data files grow |
| Uptime and support | A stated uptime and a way to reach support | You need a human when it hangs |
| Backups and snapshots | Optional, but useful | Lets you roll back after a bad update |
| Price | Compare the monthly cost with the size of your account | A cost that is large against a small account eats the edge |
Ask your broker where its trading server is, and check the latency in the terminal after you connect. MT5 shows the connection speed at the bottom right of the window. A VPS in the right region typically shows far lower ping than a home connection. The MetaQuotes hosting service is also an option, because it migrates the EA and its settings from the terminal in a few clicks, but it has its own limits on what it supports, such as DLLs, so read them.
Connect and prepare the server
Step 1: Receive the login details
The provider sends an IP address or host name, a user name and a password. Change the password after the first login to a long unique one.
Step 2: Connect with Remote Desktop
On Windows open Remote Desktop Connection (mstsc), enter the address and sign in. On a Mac use Microsoft's Remote Desktop app.
Step 3: Run Windows Update, then set a maintenance window
Install updates first. Afterwards set active hours so the server does not restart in the middle of your trading hours.
Step 4: Set the time zone and power plan
Set the time zone you prefer and choose a high-performance power plan. Disable sleep.
Step 5: Remove what you do not need
Do not install browsers, chat tools or downloads on a trading VPS. Fewer programs means fewer risks and less memory use.
Install MT5 and your EA
Step 1: Install MT5 from your broker
Download the terminal from the broker's own site, so the server list and symbols match. A fresh install avoids settings from another machine.
Step 2: Log in to the account
Use the account number, password and server name. For an EA, the trading password is needed. Never share it.
Step 3: Copy the EA and setfile
Use File, Open Data Folder, then MQL5 and Experts. Follow the steps in our install guide. Transfer files through a trusted route.
Step 4: Attach the EA and load the setfile
Open the chart for the symbol and timeframe in the manual, attach the EA, tick Allow Algo Trading and load the settings.
Step 5: Allow WebRequest only if the EA needs it
Under Tools, Options, Expert Advisors, add only the addresses the manual names.
Step 6: Check the Experts tab
You should see an initialisation message, not an error. See what to do when an EA is not trading.
Keep it running after a restart
Windows will restart sooner or later. Make sure MT5 comes back by itself. Put a shortcut to the terminal in the Windows Startup folder, and set Windows to log in automatically if your provider allows it, or keep the remote session disconnected rather than logged off, which keeps programs running. After a restart, the terminal must reconnect and the EA must reattach to its chart. If you keep your charts in a saved profile, MT5 reopens them with the EA attached.
Do not close the terminal by clicking the red cross when you finish a remote session. Use the Disconnect option in the remote desktop window or close the remote window itself, so the session and the terminal keep running.
Basic security for a trading VPS
- Use a long, unique password for the VPS and for the trading account. Change the default ones.
- Keep Windows and MT5 updated on a schedule you control.
- Restrict who can connect if your provider offers a firewall. Allow remote desktop only from your own IP address if possible.
- Do not log in to email, banking or other accounts from the VPS.
- Only run EA files from sellers you trust, and keep DLL imports off unless the manual requires them. See free EAs and safety.
- Use the investor password, not the trading password, for any monitoring service.
A daily check that takes two minutes
After a few weeks of stable running you can check less often, but keep a weekly review of the journal and the account. If something looks wrong, our guide on common MT5 EA errors helps with the most frequent causes, and when to turn an EA off covers the decision.
Sources and further reading
- MetaTrader 5 Help: Virtual Hosting for 24/7 OperationMetaQuotes' own hosting service for running a trading robot around the clock.
- MetaTrader 5 Help: Expert Advisors and Custom IndicatorsHow Expert Advisors and custom indicators work in the terminal.
- MetaTrader 5 Help: Basic Principles of Trading OperationsOrders, deals and positions, and how netting and hedging accounts differ.
Frequently asked questions
Do I need a VPS to run an EA?
Not strictly, but the terminal must stay online for the EA to manage trades. A VPS gives you a stable, always-on connection and is recommended for any live account.
Where should my VPS be located?
Close to your broker's trading server, not to you. Ask the broker where the server is and compare the ping in the terminal. For many European brokers that means London, Frankfurt or Amsterdam.
How much memory does a VPS need for MT5?
A common starting point is about 2 GB of memory for one or two terminals. More terminals, more charts and heavy EAs need more. Watch the memory use in Task Manager.
Can I use the MetaQuotes virtual hosting instead?
Yes, it migrates the EA and its settings from the terminal. It has limits on what it supports, for example DLLs and some external connections, so check that your EA is compatible.
Is a VPS safe for my trading account?
It is as safe as you keep it. Use strong unique passwords, keep it updated, avoid browsing on it and allow remote access only from trusted addresses.
Expert Advisors in these styles
Apply the checks above to any of these before you buy: read the manual, run your own backtest, and start on demo.
Keep reading
- EA basicsHow to Install and Run an EA on MT5Install an Expert Advisor on MetaTrader 5, load a setfile, set safe risk limits, and run it on a VPS. A practical walkthrough with a pre-live checklist.
- Pillar guideMT5 Expert Advisors: The Complete Guide for BeginnersEverything about MetaTrader 5 Expert Advisors in one place: how they work, strategy types, risk, backtesting, buying safely, gold, EURUSD, prop firms and Europe.
- EuropeEA Trading in Europe: ESMA Leverage Limits and RulesWhat ESMA's CFD rules mean for Expert Advisor traders in the EU: 30:1 leverage, 50% close-out, negative balance protection, and how to choose a broker.
- SafetyFree MT5 Expert Advisors: Are They Safe? What to CheckAre free MT5 EAs safe? Where legitimate free Expert Advisors come from, the risks of cracked files and DLLs, and a safe way to inspect and test one first.


