Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
Trading and crypto

Move MetaTrader from your PC to a VPS without double trades

Move MetaTrader 4 or 5 from your PC to a VPS: what to copy from the data folder, EA settings and licenses, time zones, and how to avoid running an EA twice.

CloudSat teamNovember 18, 20266 min read
Abstract illustration of a glowing folder lifting off a desk screen and travelling along a dotted arc into a tall server tower in the distance
On this pageTake an inventory on the PC

Moving a working MetaTrader setup to a VPS is mostly a file copy. The part that goes wrong is not the copy: it is the hour when two terminals, one at home and one on the server, run the same Expert Advisor on the same account and both place the trade. This guide covers what to take from your PC, how to install it on the server, and the order of switching that avoids duplicate trades. The steps use MT4 folder names; for MT5, read MQL5 wherever it says MQL4.

Take an inventory on the PC

Before touching the server, list what your setup depends on. Most of it lives in the data folder, which File > Open Data Folder opens.

Item Where it is How to carry it
Account logins and server names Navigator, Accounts Write them down; passwords are not copied
Expert Advisors, indicators, scripts MQL4\Experts, MQL4\Indicators, MQL4\Scripts Copy the folders
Libraries and shared code MQL4\Libraries, MQL4\Include Copy the folders
Files your programs read or write MQL4\Files Copy the folder
EA input settings The EA's Inputs tab, Save button, stored in MQL4\Presets Save a .set file per EA, then copy the folder
Chart layouts templates, profiles Copy the folders
State kept in terminal variables Tools > Global Variables Note the values if an EA depends on them
Licenses for paid EAs The seller's terms Check before moving

Licenses deserve a call to the seller. Some commercial EAs are locked to an account number, some to a computer, and products from the MQL5 Market are activated per machine with a limited number of activations. Use one of them up on the server only when you are sure the setup will stay there.

If an EA loads DLLs from MQL4\Libraries, note it: the server will need Allow DLL imports switched on for that EA, and possibly the same Visual C++ runtime the DLL was built with.

Prepare the server

Pick a Windows server in a region close to your broker's trade server and connect over Remote Desktop; CloudSat's guide to connecting with Remote Desktop covers the client side, and a firewall rule that admits only your own address on port 3389 should come first.

Install the same platform from the same broker as on your PC, so the server list and build match. Log in to the account and leave the terminal open for a few minutes so it can download its update and symbol data. Then switch AutoTrading off (in MT5, Algo Trading) before you copy anything. This matters, as the next sections explain.

Copy the files

Close the terminal on the PC so no file is in use, then pack the folders you need. In PowerShell, with the data folder's ID in place of the placeholder:

PS> $data = "$env:APPDATA\MetaQuotes\Terminal\<ID>"
PS> Compress-Archive -Path "$data\MQL4", "$data\templates", "$data\profiles" `
      -DestinationPath "$env:USERPROFILE\Desktop\mt4-move.zip"

Leave out history and logs: the terminal downloads price history again from the broker, and old logs only add size.

Remote Desktop can carry the file itself. Copy the archive on the PC and paste it into the server's desktop, which works when clipboard redirection is on, or share a local drive under Local Resources > More > Drives in the Remote Desktop client.

On the server, open the new terminal's data folder from the File menu, close the terminal, and extract the archive over it:

PS> Expand-Archive -Path "$env:USERPROFILE\Desktop\mt4-move.zip" `
      -DestinationPath "$env:APPDATA\MetaQuotes\Terminal\<ID>" -Force

Start the terminal again and check the Navigator: your Expert Advisors and indicators should be listed. If a program exists only as source code, open it in MetaEditor (F4) and compile it on the server.

Restore charts and settings

Load your layout from File > Profiles. A profile reopens every chart with its template, and with any Expert Advisor that was attached when the profile was saved, inputs included. That is convenient and a little dangerous: with AutoTrading on, those EAs would start trading the moment they load, which is why it stays off until the switch.

Then repeat the settings your programs rely on under Tools > Options > Expert Advisors: DLL imports only for the EAs that need them, and the list of URLs for Allow WebRequest for listed URL if an EA talks to a web service. Enter your MetaQuotes ID under Notifications if your EAs send push messages.

Switch over in the right order

Your broker almost certainly allows the same account to be logged in from both terminals at once. That is the trap: two copies of an EA will each see the same signal and each send the order, or one will modify what the other opened.

  1. Server ready, AutoTrading off. Charts are loaded, EAs attached, inputs checked against your .set files.
  2. Stop the PC. On the home terminal, switch AutoTrading off, remove the EAs from their charts and close the terminal.
  3. Start the server. Switch AutoTrading on, then confirm on the Experts tab that each EA initialized on its chart without errors.
  4. Watch the first signal. Make sure exactly one order appears where you expect one.

Afterwards, if you still want to watch the account from home, log in there with the investor password, which can see everything and trade nothing.

An EA usually recognizes the positions it opened earlier by their magic number and symbol, so it can keep managing trades that were opened from the PC. Whether yours does is in its documentation; test the handover on a demo account first if it matters.

Time zones and clocks

MetaTrader offers programs two clocks: server time, from the broker, and local time, from the computer. An EA that schedules its trading by local time behaves differently on a server set to another time zone. Check which one your EA uses, then either adjust its inputs or set the server's time zone to match your PC:

PS> Get-TimeZone
PS> Set-TimeZone -Id "Eastern Standard Time"

After the move

Once the terminal has run cleanly through a full trading day, take a snapshot of the server (CloudSat's snapshot guide shows how), so a broken update or a bad change becomes a restore rather than a rebuild. Keep the archive from the PC as well. For the first week, read the Journal tab now and then for disconnects, and compare the EA's trades with what you expected from it.

FAQ

Can I run the same EA on my PC and on the VPS?

On the same account, avoid it: both copies trade, and you get duplicate or conflicting orders. On different accounts, it works like any two separate setups.

Will the EA pick up trades opened from my PC?

Usually, if it identifies its positions by magic number and symbol rather than by memory. Check the EA's documentation, and test the handover on a demo account when you can.

Do I need to buy my EA again for the server?

That depends on the license. Account-locked EAs move freely, machine-locked ones may need a new activation, and Market products use one of their limited activations on the new machine.

Should I copy the history folder?

Not normally. The terminal downloads history from the broker's server. Copy it only if you use custom or imported data that the broker does not provide.

Trading involves risk of loss. Nothing in this article is financial advice.

Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.