
MT5 Auto Start: Reopen MetaTrader 5 After a VPS Restart
This guide shows how to make MetaTrader 5 reopen by itself when a Windows VPS restarts, so it is not left closed until you next connect. It assumes only that MetaTrader 5 is installed on the VPS and logged in to your trading account. Auto start works the same whether or not an Expert Advisor is trading yet, and nothing in this guide changes a trading permission. If MetaTrader 5 is not on your VPS yet, our step-by-step guide to setting up an EA on a VPS covers installing it. Everything below is done on the VPS, through your remote desktop connection.
What auto start does, and why a VPS needs it
When a VPS restarts — for Windows updates, for maintenance, or because you restarted it yourself — Windows starts again, but nothing opens MetaTrader 5. Until something does, your Expert Advisor is not running: it opens no new trades and manages none of the trades it already has open.
Auto start sets the VPS up so that MetaTrader 5 opens by itself after every restart, with nobody connected. Restarts happen even on a host with a high uptime figure, which is why what VPS uptime figures actually measure is worth knowing before you rely on one.
Check your VPS provider first
Some VPS providers supply their own instructions or their own tool for auto start, sometimes as a file on the VPS’s desktop. If yours does, use it: it is made for that VPS. This guide is for a VPS whose provider gives you nothing for this, or only half of it.
If you have not chosen a VPS yet, our VPS hosting comparison records each provider’s published prices and specifications.
The two parts of auto start
Auto start has two parts, and you need both:
Part one: MetaTrader 5 set to open when Windows signs in.
Part two: Windows set to sign in by itself after a restart.
Without part two, MetaTrader 5 opens only when you next connect and sign in, which could be hours after the restart.
We tested every step below on 29 November 2026, on one VPS running Windows Server 2025, with MetaTrader 5 build 6361 and Autologon v3.10. We have not tested other versions of Windows Server, and screens can change with later versions.
Part one: open MetaTrader 5 when Windows signs in
Click Start and find MetaTrader 5. A recently installed app appears under Recommended; otherwise click All and find it in the list of apps.
Right-click MetaTrader 5 and choose Open file location. A folder opens that holds the MetaTrader 5 shortcut.

In that folder, right-click the MetaTrader 5 shortcut and choose Copy.

Click once in the address bar at the top of that same File Explorer window, type shell:startup and press Enter. The window changes to the Startup folder. Type it in File Explorer’s address bar, not in the Start menu’s search box: when we tried the search box, it found nothing.

Right-click the empty space in the Startup folder and choose Paste. The MetaTrader 5 shortcut now sits in the Startup folder.

Windows opens the apps whose shortcuts are in your Startup folder when you sign in, as Microsoft’s guide to configuring startup applications in Windows explains. MetaTrader 5 will now open each time this account signs in.
Part two: sign Windows in by itself after a restart
Part two uses Autologon, a free Microsoft tool that stores your sign-in so Windows can sign in by itself after a restart.
In the VPS’s own web browser, open Microsoft’s Autologon page.

Click Download Autologon. A small zip file, AutoLogon.zip, downloads.
In the VPS’s Downloads folder, right-click AutoLogon.zip, choose Extract All, then click Extract. The folder that opens holds Autologon.exe, Autologon64.exe, Autologon64a.exe and Eula.txt.

Run Autologon.exe. This is the file we tested.
Windows may ask whether you want to allow this app to make changes to your device. Check that the program named is Autologon and that the publisher shown is Microsoft, then click Yes. On our test VPS, where the account is the administrator, this question did not appear.
The first time Autologon runs on a computer, an Autologon License Agreement window appears. Click Agree. Our screenshot was taken on a Windows 11 PC; the window did not appear on our test VPS because Autologon had been run there before.

The Autologon window opens with Username and Domain already filled in. Leave both as they are: on a VPS, the Domain box holds the VPS’s own computer name. Type your VPS password in the Password box and click Enable. (The boxes are blanked in our screenshot.)

A message says “Autologon successfully configured” and notes that the password is encrypted. Click OK.

Test it
Test it the way we did, so you know both parts work:
Close MetaTrader 5 on the VPS.
Restart the VPS: Start, the power button, Restart. Your remote desktop connection drops.
Wait five minutes without connecting.
Connect again. MetaTrader 5 should already be open.
For proof, open the Journal tab in MetaTrader 5’s Toolbox window and read the time on the line that says MetaTrader 5 started. A start time within a minute or two of the restart means Windows signed in by itself. A start time at the moment you connected means only part one worked: run Autologon again and re-enter the password.

On our test VPS, MetaTrader 5 started about a minute after the restart, four minutes before anyone connected, and the Expert Advisor loaded onto its chart two seconds later. (Three lines of system details are hidden in the screenshot.)
The test is the one time Restart is the right button. To finish working on the VPS, close the remote desktop window: Sign out, Shut down and Restart all close MetaTrader 5.
Two cautions, and how to switch it off
Autologon does not check what you type. Microsoft’s Autologon page states that it does not verify the credentials you enter. A mistyped password fails silently, and the test above is how you find out.
Your VPS password is stored on the VPS. It is stored encrypted, but Microsoft’s page states that a user with administrator rights can retrieve and decrypt it. That is the price of auto start: anyone who gains administrator access to the VPS can read the password, so use one that you do not use anywhere else.
To switch it off or keep it working:
Stop the automatic sign-in: run Autologon again and click Disable.
Stop MetaTrader 5 opening by itself: delete its shortcut from the Startup folder (open the folder with shell:startup, as in part one).
If you change the VPS password: run Autologon again and enter the new one. Autologon keeps what you typed and does not check it, so the old password would simply fail.
After any restart, still check
Auto start reopens the platform. It does not promise that your Expert Advisor is trading. After any restart, connect and check that:
MetaTrader 5 is open, logged in to the right account and connected to the broker;
your Expert Advisor is on its chart, with its trading permissions as you left them, including the Algo Trading button on the toolbar.
If terms such as spread, leverage or stop loss are new to you, our free automated trading basics guides explain them one topic at a time.
FAQs
Will my Expert Advisor start trading again by itself after a restart?
On our test VPS, the Expert Advisor loaded back onto its chart two seconds after MetaTrader 5 started. In two restarts on that VPS, the Algo Trading button on the toolbar came back as we had left it: off when we left it off, on when we left it on. We have not tested the Expert Advisor’s own Allow Algo Trading setting, a restart forced by a provider or a crash, or any other VPS, so check both permissions after every restart.
My VPS provider has its own auto-start tool. Do I still need this guide?
No. Use your provider’s tool or instructions: they are made for that VPS. This guide is for a VPS whose provider gives you nothing for auto start, or only part of it.
Does this work with more than one MetaTrader 5 on the same VPS?
We tested it with one. The natural step is one shortcut in the Startup folder for each MetaTrader 5, but we have not tested that.
Trading foreign exchange and CFDs on margin carries a high level of risk and may not be suitable for all investors. This article is for educational purposes only and does not constitute financial advice.

