tocOn this page 7 sections
To run MT4 on a Windows VPS, connect over RDP, download your broker's MT4 installer, install it into its own folder, log in to your trading account, and turn on AutoTrading for your Expert Advisors. To keep the EAs running, always disconnect your RDP session instead of signing out, and make sure Windows never ends disconnected sessions. The rest of this guide covers each step and the settings that most often stop EAs on a server.
Before You Install
MT4 is a lightweight 32-bit application, so a single terminal with a few EAs runs on a small plan. If you plan to run several terminals or many charts, read our guide to sizing a VPS for multiple MT4 and MT5 terminals first. Pick a data center close to your broker's trade server; our Windows VPS for forex trading page lists the locations.
Get the installer from your broker's client area, not a third-party download site. Brokers ship MT4 builds preconfigured with their server list, which saves you from typing server addresses by hand.
Allow the download on Windows Server
On some Windows Server images, browser security settings block downloads. If the installer won't download, open Server Manager > Local Server, click IE Enhanced Security Configuration, and set it to Off for Administrators. You can also download it on your own PC and paste the file into the RDP window, since clipboard file transfer works when drive and clipboard redirection are enabled in your RDP client.
Install MT4 Into Its Own Folder
- Run the installer. Before clicking Next, click Settings and change the install folder to something short, such as
C:\MT4\BrokerA. - Finish the install and let the terminal open.
- In the login dialog, choose your broker's live or demo server and enter your account number and password. Tick Save account information so the terminal reconnects on its own after a restart.
A dedicated folder per terminal matters if you ever run a second account. Each install becomes an independent copy with its own settings and EAs.
Use portable mode
By default MT4 stores EAs, logs and settings under %APPDATA%\MetaQuotes\Terminal\<long ID>, which is easy to lose track of. Portable mode keeps everything inside the install folder instead. Create a shortcut with this target:
"C:\MT4\BrokerA\terminal.exe" /portable
Always launch from that shortcut. Mixing portable and normal launches gives you two separate data folders and EAs that seem to disappear.
Load and Enable Your EAs
- In MT4, open File > Open Data Folder.
- Copy your EA files (
.ex4or.mq4) intoMQL4\Experts, and any indicators intoMQL4\Indicators. Libraries (DLLs) go inMQL4\Libraries. - In the Navigator panel, right-click Expert Advisors and choose Refresh.
- Open Tools > Options > Expert Advisors and tick Allow automated trading. Tick Allow DLL imports only if your EA's vendor says it needs them. If the EA calls a web API, add the URL under Allow WebRequest for listed URL.
- Drag the EA onto its chart, check its inputs, and confirm the AutoTrading button on the toolbar is green.
The EA is active when its name appears in the chart's top-right corner with a smiling face. A frowning face means AutoTrading is off or the EA's own "Allow live trading" box is unticked in its properties.
Save your layout
Use File > Profiles > Save As to store your charts and attached EAs. MT4 restores the last profile on launch, so a restart brings everything back without manual work.
Trim MT4 for a Server
- Tools > Options > Charts: lower Max bars in chart and Max bars in history to what your EAs need. Large values eat memory on every open chart.
- Tools > Options > Server: untick Enable news if you don't read it.
- Close charts you don't trade from. Each chart redraws on every tick.
Keep EAs Running When You Disconnect
MT4 runs inside your user session, not as a service. If the session ends, the terminal closes. Three settings decide whether that happens.
Disconnect, don't sign out
Close the RDP window with the X, or run tsdiscon from a prompt. Choosing Sign out from the Start menu ends the session and closes MT4.
Stop Windows from ending disconnected sessions
Run gpedit.msc and go to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits. Set Set time limit for disconnected sessions to Enabled with Never, and leave Set time limit for active but idle Remote Desktop Services sessions disabled. Apply it with:
gpupdate /force
Keep the server awake
Switch to the High performance power plan so the system never sleeps:
powercfg /setactive SCHEME_MIN
powercfg /getactivescheme
Check it from PowerShell
After you reconnect, confirm the terminal survived and see how much memory it uses:
Get-Process terminal | Select-Object Id, StartTime, @{n='RAM_MB';e={[math]::Round($_.WorkingSet64/1MB)}}
A StartTime from before you disconnected means nothing restarted. Then check MT4's Experts and Journal tabs for errors.
Plan for Reboots
Windows Update will eventually restart the server, and a reboot does not bring your session back on its own. Set up automatic sign-in and a startup launch of your portable shortcut using our guide to auto-restarting MT4 and MT5 after Windows Update reboots. Because you saved the account login and a profile, MT4 reconnects and reloads its EAs when it starts.
FAQ
Can I run MT4 and MT5 on the same VPS?
Yes. They install into separate folders and don't conflict. For the MT5 side, follow our MetaTrader 5 VPS setup guide.
Do I need to open any firewall ports for MT4?
No. MT4 makes outbound connections to your broker, which Windows Firewall allows by default. Don't open inbound ports for it.
Why does my EA show a frowning face?
Either the AutoTrading toolbar button is off, or "Allow live trading" is unticked in the EA's properties (press F7 on the chart to open them). Fix both and the face turns to a smile.
Run this on your own Windows VPS
Get a Windows VPS from WindowsVPS in about 60 seconds, with full Administrator access over RDP, NVMe storage and the Windows license included.
Written by the WindowsVPS Team
We run Windows Server VPS hosting and write these guides from the same setups our customers use: RDP, PowerShell, trading terminals and always-on bots. Questions about a guide? Contact us.