ForexCopilotEA

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

What to compare when choosing a VPS
FactorWhat to look forWhy it matters
LocationA data centre near your broker's server, often London, Frankfurt, Amsterdam or New YorkShorter round-trip means faster order execution
Operating systemWindows Server or Windows with remote desktopMT5 runs on Windows
Memory and CPUEnough for each terminal you run; 2 GB of memory and 1 to 2 cores is a common start for one or two terminalsA starved server stalls the terminal
StorageFast SSD with room for history and logsTester and data files grow
Uptime and supportA stated uptime and a way to reach supportYou need a human when it hangs
Backups and snapshotsOptional, but usefulLets you roll back after a bad update
PriceCompare the monthly cost with the size of your accountA 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

  1. 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.

  2. 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.

  3. 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.

  4. Step 4: Set the time zone and power plan

    Set the time zone you prefer and choose a high-performance power plan. Disable sleep.

  5. 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

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. Step 5: Allow WebRequest only if the EA needs it

    Under Tools, Options, Expert Advisors, add only the addresses the manual names.

  6. 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

Daily VPS and EA check
0/7

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

  1. MetaTrader 5 Help: Virtual Hosting for 24/7 OperationMetaQuotes' own hosting service for running a trading robot around the clock.
  2. MetaTrader 5 Help: Expert Advisors and Custom IndicatorsHow Expert Advisors and custom indicators work in the terminal.
  3. 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.

Browse Expert Advisors