Guides

Run MetaTrader 4 or 5 on a Windows VPS 24/7: setup, sizing and latency

Install MT4 or MT5 on a Windows Server VPS, keep Expert Advisors running after you disconnect, check the ping to your broker and size the plan honestly.

Published ~9 min read

Short answer: a forex VPS is a Windows server in a data centre that keeps MetaTrader and your Expert Advisors (EAs) running while your own computer is off. Install your broker’s MT4 or MT5 terminal on Windows Server 2022 or 2019, log in to your trading account, switch on AutoTrading (MT4) or Algo Trading (MT5), and then close the Remote Desktop window. Close it, do not sign out: closing leaves the terminal running, signing out shuts it down.

Below are the setup steps, how to keep the terminal running across disconnects and reboots, how to measure the latency to your broker, and what size of server you need.

How do I set up MT4 or MT5 on a Windows VPS?

  1. 1Order a server with Windows Server 2022

    Pick Windows Server 2022 (or 2019) as the operating system when you order. Windows takes a few minutes longer than a Linux image to finish its first start, because it sets itself up on that boot.

  2. 2Connect over Remote Desktop as Administrator

    On Windows, open mstsc (Remote Desktop Connection). On macOS, use the Windows App from the App Store. Enter the server’s IP, log in as Administrator with the password you set at checkout. If the connection fails, work through Remote Desktop can’t connect.

  3. 3Get a browser that works

    Windows Server 2022 comes with Microsoft Edge. Windows Server 2019 only has Internet Explorer behind Enhanced Security Configuration, which blocks most download pages. Either use it once to fetch another browser, or follow installing Chrome on Windows Server.

  4. 4Download your broker's terminal

    Use the installer from your broker’s website, which comes preconfigured with the broker’s trade servers. MT4 in particular is only distributed through brokers now. Run it and, if you plan several terminals, click Settings in the installer to give each one its own folder.

  5. 5Log in to your trading account

    File → Login to Trade Account, then pick the live or demo server your broker gave you. The connection indicator in the bottom-right corner should show traffic, not No connection.

  6. 6Allow algorithmic trading and attach the EA

    Tools → Options → Expert Advisors: tick Allow automated trading (MT4) or Allow algorithmic trading (MT5). Tick DLL imports only if your EA needs them and comes from a source you trust. Drag the EA from the Navigator onto its chart, tick Allow live trading (MT4) or Allow Algo Trading (MT5) on its Common tab, and make sure the AutoTrading / Algo Trading button in the toolbar is on. The Experts and Journal tabs at the bottom show whether it loaded and what it is doing.

  7. 7Close the Remote Desktop window

    Click the X on the Remote Desktop window, or its Disconnect button. The terminal keeps running on the server. The next section explains why this matters.

Disconnect or sign out: what keeps MT4 running?

A Remote Desktop connection is a window into a Windows session on the server. Closing the window disconnects you: the session, and every program in it, keeps running, and you get it back exactly as you left it on the next connect. Sign out ends the session and closes every program in it, MetaTrader included. Shut down or Restart in the Start menu affects the whole server.

PowerShell · is the session still there?
quser
# USERNAME        SESSIONNAME   ID  STATE   IDLE TIME  LOGON TIME
# administrator                  2  Disc        1:12  10/14/2026 9:03 AM
# "Disc" (disconnected) is what you want after you closed the window.

Windows Server does not end disconnected sessions by default, but a template or a policy can. If the terminal disappears a while after you disconnect, open gpedit.msc and check Computer Configuration → Administrative Templates → Windows Components → Remote Desktop Services → Remote Desktop Session Host → Session Time Limits. Set time limit for disconnected sessions should be Not configured or Never.

How do I start the terminal again after a reboot?

After a restart, nobody is signed in, so nothing in your session runs, including MetaTrader. Two pieces fix that.

  • Start the terminal at sign-in. Press Win+R, type shell:startup and put a shortcut to terminal.exe (MT4) or terminal64.exe (MT5) into the folder that opens. MetaTrader reopens its last profile with the charts and attached EAs, and remembers whether AutoTrading was on. Task Scheduler with an At log on trigger does the same and lets you add a short delay so the network is up first.
  • Sign in automatically after boot. Microsoft’s free Sysinternals Autologon tool signs the Administrator account in at startup, so the Startup folder fires without you connecting. When you connect over Remote Desktop later, Windows Server normally hands you that same session, since it allows one session per user by default. Autologon stores the password encrypted on the server, and the console shows an unlocked desktop, which is acceptable on a single-purpose server only you administer.

Then deal with the most common cause of an unplanned restart: Windows Update. Set active hours in Settings → Update & Security → Windows Update so updates do not restart the server during your trading hours. Or run sconfig, set Windows Update to Download only, and install updates yourself at the weekend while the markets are closed. Skipping updates altogether is not the answer on a server that is reachable from the internet.

What latency matters, and how do I measure it?

The number that matters is the round trip from the terminal to your broker’s trade server, not a ping to some website. It depends on where your broker hosts that server, and only a measurement tells you. MT5 shows it in the status bar next to the connection indicator. In MT4, click the connection indicator in the bottom-right corner to see the ping to each of the broker’s access points.

  • Ask your broker where its live trade servers are. Server names in the login dialog sometimes hint at the region.
  • Measure from the VPS and from home in the terminal itself and compare. If you are choosing between two cities, order the smallest plan for a month in one, measure, and compare with the other. Frankfurt vs Amsterdam walks through how to measure properly.
  • Weigh it against your strategy. A scalping EA that reacts to every tick is sensitive to latency. An EA that trades on hourly candles mostly needs the terminal to be running, not a few milliseconds less.

How big a plan do I need for MetaTrader?

Windows Server runs even on the smallest plans, but updates and a few terminals fill a 20 GB disk quickly, so take 40 GB or more. At VMHeaven, Standard KVM 2 has 4 cores, 8 GB of RAM and 40 GB of disk for 9.99 EUR a month in Amsterdam, which comfortably runs Windows and a handful of terminals. Hi-CPU KVM 2 costs the same with 2 cores, 4 GB and 40 GB on AMD EPYC 7443, for one or two terminals whose EAs lean on a single core.

  • RAM is usually the limit. A terminal with a handful of charts typically uses a few hundred megabytes, more with many charts and long history. Lower Max bars in history and Max bars in chart under Tools → Options → Charts to save memory, and watch Task Manager → Performance for a few days.
  • Several terminals or accounts want more cores and memory: the Standard line has the most vCores per euro.
  • The MT5 strategy tester runs one test agent per core and will use every core you give it. Heavy optimisation runs belong on a bigger plan or on your own PC, not next to live trading.

Can I run a forex VPS in Amsterdam or Frankfurt?

Both, with one limitation. Standard KVM and Hi-CPU KVM are orderable in Amsterdam. In Frankfurt they are currently sold out, so the lines you can order there right now are DMCA Ignored KVM and Pentesting KVM, priced as their own lines. Both run Windows Server like any other KVM line, and the takedown or scanning policy changes nothing for a terminal. Their pages, DMCA Ignored KVM and Pentesting KVM, list the Frankfurt prices, and VPS in Germany shows what Frankfurt has in stock today.

Do I need a VPS, or is MetaTrader’s built-in hosting enough?

MetaTrader offers its own virtual hosting, rented from MetaQuotes inside the terminal. It takes over the charts, EAs and signal subscriptions you migrate from one terminal, and it is simple. But you cannot log in to it, install other software or run a second broker’s terminal on it, and programs that call DLLs, for example, are not allowed there. A Windows VPS runs the whole terminal, or several, plus any other Windows software you need, such as a trade copier, a news tool or a browser. Both keep EAs running. Choose the one that fits how much control you need.

Is a Windows licence included?

Not in the price of these plans. Windows Server comes from the template on Microsoft’s time-limited evaluation licence, and you can activate your own key at any time without reinstalling. Check the days left with slmgr /xpr, and see the evaluation licence explained before it runs out.

How do I keep a trading VPS secure?

The server holds your trading credentials, so treat RDP access like the account itself. Use a long, unique Administrator password, allow RDP only from your own IP address in Windows Firewall, and keep Network Level Authentication on. The full checklist is in securing a Windows RDP server.

One last point: a VPS improves the uptime of your terminal, not your strategy. It keeps an EA running through power cuts and home internet outages. It does nothing for an EA that loses money, and trading carries a real risk of loss. If you want the plans side by side, the forex VPS page compares them for trading and the Windows VPS page covers Windows Server on every line; the lines themselves are Standard KVM, Hi-CPU KVM and Windows RDP paid in crypto.

Frequently asked

Does MT4 stop when I close Remote Desktop?

No. Closing the Remote Desktop window only disconnects you; the Windows session and MetaTrader keep running on the server. Signing out ends the session and closes the terminal, so close the window instead. 'quser' in PowerShell shows the session as 'Disc' when it is disconnected but still running.

How many MetaTrader terminals can run on one VPS?

It depends on charts, history and EAs more than on the terminal itself. A terminal with a handful of charts typically uses a few hundred megabytes of RAM, so memory is usually the limit. Install each terminal in its own folder, start with a plan that has 8 GB of RAM if you run several, and watch Task Manager for a few days before adding more.

Is Amsterdam or Frankfurt better for a forex VPS?

It depends on where your broker hosts its trade server, so ask the broker and measure the ping in the terminal from each city. Both are close to brokers hosted in continental Europe. If the trade server is in London or New York, a server in that city will be closer than either.

Is a Windows licence included with a forex VPS?

Not at VMHeaven. Windows Server 2022 or 2019 is installed from the template on Microsoft's time-limited evaluation licence, and no licence is included in the price. You can activate your own key at any time without reinstalling; 'slmgr /xpr' shows when the evaluation ends.

Related articles

All guides