Summary: A practical walkthrough of setting up a MetaTrader VPS, including RDP connection, Windows performance tuning to prevent disconnects, and managing the MQL5 hosting subscription.




I was running a scalping EA on a VPS in New York last year, and the thing would just disconnect at the worst possible times — usually right in the middle of a news spike. I'd log back in, see the red "No Connection" status in the bottom right corner, and watch the trades I should have gotten just... vanish.

That's when I learned that setting up a VPS is only half the job. Keeping it alive is the other half.

The official MetaTrader VPS hosting service is actually pretty straightforward to get started with. According to the MetaTrader 4 Help documentation, you just open Navigator, right-click your trading account, and select "Register a Virtual Server" . The system automatically picks the server closest to your broker to minimize ping. Lower latency equals less slippage and fewer re-quotes — that's the whole point .

Step 1: Getting Started

If you're using a third-party VPS provider (instead of MQL5's built-in hosting), you'll get an IP address, username, and password via email. Fire up Remote Desktop Connection, paste the IP, and log in . You're now looking at a Windows Server desktop that lives somewhere in a data center.

Download your broker's MT4 installer directly from the browser inside the VPS. Run it, log in with your trading account credentials .

Step 2: The Hidden Settings That Actually Matter

Here's where the official docs get a bit too optimistic. They tell you to enable "Allow DLL imports" and "Allow automated trading" for your EAs . But nobody warns you about what Windows does behind the scenes.

By default, a fresh Windows Server installation is configured for "Balanced" power usage, not for keeping your trading platform awake. Windows can temporarily suspend system resources, and the moment it does, your MT4 connection drops .

The fix is to switch to "High Performance" mode and disable sleep entirely. Run Command Prompt as administrator and punch these in:

``
powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
powercfg /change standby-timeout-ac 0
powercfg /hibernate off
`

These commands force the server to stay fully awake . After I did this, my disconnections dropped by about 90%.

Step 3: Keep the Connection Alive

Another thing that's not in any MetaQuotes manual: if MT4 sits idle during quiet market hours (like the Asian session lull), your internet connection to the broker can drop automatically. Windows waits a full 2 hours before sending a "keepalive" packet to check if the connection is still alive .

Two hours is way too long for a scalping EA.

Change the TCP Keepalive interval to 5 minutes using PowerShell as administrator:

`
New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\TcpIp\Parameters" -Name "KeepAliveTime" -PropertyType DWORD -Value 300000 -Force
`

After a reboot, your connection will send a "heartbeat" every 5 minutes, keeping the session alive even during dead quiet hours .

Step 4: Auto-Start After Reboot

If your VPS provider reboots the server overnight for maintenance (and they do), MT4 won't open by itself — your EA sits idle until you log back in and start it manually .

Add MT4 to the Windows Startup folder:

  • Right-click the MT4 desktop shortcut and select Copy.

  • Press Windows + R, type shell:startup, press Enter.

  • Right-click inside the Startup folder and select Paste Shortcut .


  • Now every time the VPS reboots, MT4 launches automatically. Also run
    netplwiz` to enable auto-login, so the server doesn't get stuck on the lock screen .

    Step 5: Managing MQL5 Hosting Subscriptions

    If you're using MetaTrader's own VPS hosting (through MQL5), there's a critical gotcha: if the subscription expires, your entire environment gets deleted from the server . You can rent it again, but you'll have to reconfigure everything from scratch.

    Enable "Automatically renew subscription" to avoid this. The system will check hosting activity before renewing, so you won't get charged for an inactive server . It uses the same payment method you used for the first subscription.

    One more thing: cancellation refunds are only available within the first 24 hours. After that, any unused time gets credited to your MQL5 account as "free minutes" for future rentals .

    Reference: MetaTrader 4 Help - Virtual Hosting (metatrader4.com); PerLod Hosting - Fix MT4 Disconnects on VPS (perlod.com).

    This article was originally published on FXEAR.com. All rights reserved. Unauthorized reproduction is prohibited.