How to Auto-Start MT4 After a VPS Reboot (Step by Step)
A forex VPS is meant to keep your Expert Advisors running while you sleep, work or travel. But every Windows server restarts from time to time, whether for security updates, scheduled maintenance or a rare crash. If MetaTrader does not start again by itself, your EAs stay offline until you notice and log in. That might be ten minutes later, or it might be the next morning.
The fix takes about fifteen minutes and you only do it once. In this guide you will set up your VPS so that, after any restart, Windows signs in automatically, every MT4 terminal opens, logs in to your broker and resumes trading with the same charts and EAs. The same steps work for MetaTrader 5.
Why MT4 Does Not Restart by Itself
MetaTrader 4 is a normal desktop program, not a Windows service. It needs a signed-in user session with a desktop to run in. When the VPS restarts, Windows boots to the sign-in screen and waits. Until someone signs in, there is no desktop, so MetaTrader cannot start, even if you have added it to the startup list.
That means a reliable auto-start needs three parts working together:
- Automatic sign-in, so Windows creates your user session without anyone typing a password.
- Automatic launch, so every MetaTrader terminal opens as soon as that session starts.
- Saved charts, EAs and settings, so each terminal reopens with AutoTrading on and every EA attached.
Before You Start: Check What Your Plan Already Includes
All Cheap Forex VPS plans list MT4/MT5 auto startup as a feature. If you are not sure whether it has already been configured on your server, ask our 24/7 support team before making changes. They can confirm the setup or configure it for you. The steps below are useful if you want to set it up yourself, add new terminals, or understand how it works.
You will need:
- Remote desktop access to your VPS. If you are not sure how to connect, see how to connect to a forex VPS from a Windows PC.
- MT4 or MT5 already installed. If not, follow how to install MT4 on a VPS step by step.
- Your VPS Windows password.
Step 1: Save Your Login in Every MetaTrader Terminal
When MT4 reopens, it needs to log in to your broker without you typing anything.
- Open each MT4 terminal and click File > Login to Trade Account.
- Enter your account number, password and server.
- Tick Save password (or Save account information in some builds).
- Click Login and check the connection status in the bottom-right corner of the terminal.
Repeat this for every terminal you run.
Step 2: Make Sure Your EAs Will Reload
MetaTrader saves your open charts, attached EAs and their inputs in the current profile when it closes. When it starts again, it reloads that profile. To make this dependable:
- In each terminal, click Tools > Options > Expert Advisors and tick Allow automated trading. If your EA uses DLLs, also tick Allow DLL imports.
- Make sure the AutoTrading button in the toolbar is green.
- Open the charts you want, attach each EA with the right inputs, and check that each one shows a smiling face (MT4) or a blue hat icon (MT5) in the top-right corner of the chart.
- Save the setup as a profile: click File > Profiles > Save As, and give it a name such as “Live EAs”.
- Close MetaTrader normally once with File > Exit, so it writes everything to disk.
Saving a named profile gives you a backup. If a terminal ever reopens with the wrong charts, you can switch back to “Live EAs” in two clicks.
Step 3: Turn On Automatic Sign-In with Autologon
The most reliable way to sign in automatically on Windows Server is Autologon, a free tool from Microsoft’s Sysinternals suite. Unlike older registry tricks, it stores your password encrypted rather than as plain text.
- Inside the VPS, open a web browser and search for Sysinternals Autologon. Download it from Microsoft’s official site (learn.microsoft.com).
- Extract the ZIP file and run Autologon64.exe. Accept the licence.
- Check the Username (usually Administrator) and Domain (your server name).
- Type your Windows password in the Password field.
- Click Enable. You will see a message confirming that autologon is configured.
From now on, when the VPS starts, Windows signs in to that account by itself.
Important: if you ever change your VPS password, run Autologon again and enter the new password. Otherwise automatic sign-in will fail after the next restart, and MetaTrader will not start.
Is automatic sign-in safe on a VPS?
Automatic sign-in creates a session on the server’s own console, which is not visible to anyone on the internet. Remote desktop still requires your password. The real security risk on any VPS is a weak remote desktop password, so use a long, unique one and keep it in a password manager.
Step 4: Launch MT4 Automatically
You have two options. The Startup folder is the simplest and suits most traders. Task Scheduler gives you more control.
Option A: The Startup folder (simplest)
- Press Windows key + R, type shell:startup and press Enter. A folder opens. Anything placed here starts when you sign in.
- Open another File Explorer window and find your MT4 installation folder. It is usually in C:Program Files (x86)YourBroker MT4 Terminal.
- Right-click terminal.exe and choose Create shortcut. Windows may offer to place it on the desktop; accept.
- Move the shortcut into the Startup folder.
- Repeat for each MT4 installation. For MetaTrader 5, use terminal64.exe.
If you run several terminals, each one must be installed in its own folder, with its own shortcut. Our article on how many EAs a cheap forex VPS can run explains how to organise several terminals.
If you installed MetaTrader in portable mode, right-click the shortcut, choose Properties, and add /portable at the end of the Target field, after the closing quotation mark.
Option B: Task Scheduler (more control)
Task Scheduler lets you add a short delay, which gives the network time to connect before MetaTrader tries to log in. This is helpful if your terminals sometimes open showing “No connection”.
- Open the Start menu, type Task Scheduler, and open it.
- Click Create Task (not Create Basic Task).
- On the General tab, name it “Start MT4 – Broker A” and choose Run only when user is logged on. MetaTrader needs a visible desktop, so do not choose the option to run whether the user is logged on or not.
- On the Triggers tab, click New, choose At log on, select your user account, tick Delay task for and choose 30 seconds.
- On the Actions tab, click New, choose Start a program and browse to terminal.exe. In Start in, paste the folder path that contains terminal.exe.
- On the Settings tab, untick Stop the task if it runs longer than, so Windows never closes MetaTrader after a few days.
- Click OK. Create one task per terminal, adding a few extra seconds of delay for each so they do not all log in at the same moment.
Use either Option A or Option B for each terminal, not both. Otherwise the terminal starts twice.
Step 5: Test It with a Real Restart
Do this at the weekend or when your EAs have no open trades.
- Click Start > Power > Restart inside the VPS. Your remote desktop connection drops.
- Wait two or three minutes, then reconnect.
- Check that every terminal has opened and shows a connection in the bottom-right corner.
- Check that AutoTrading is green and each EA shows as active on its chart.
- Open the Experts tab in the Terminal window and confirm the EA has loaded without errors.
If everything is running, you are done. From now on, a restart will cost you a couple of minutes rather than a trading session.
The Habit That Matters Most: Disconnect, Do Not Sign Out
When you finish checking your VPS, close the remote desktop window or choose Disconnect. Your session, MetaTrader and your EAs keep running. If you click Start > Sign out, Windows closes every program in your session, including MetaTrader. Your EAs stop, and they will not start again until the next restart or until you open them yourself.
When you reconnect, sign in with the same account that Autologon uses. You will return to the same session with your terminals still running.
Advanced: Open a Chart and EA from a Startup File
MetaTrader 4 can also read a startup configuration file that tells it which account to log in to and which chart and EA to open. This is useful for very large setups, or when a terminal must always start with exactly one chart and one EA.
Create a text file named start.ini in the terminal’s config folder, with lines such as:
- Login=12345678 and Server=YourBroker-Live to choose the account
- Symbol=EURUSD and Period=H1 to open a chart
- Expert=YourEAName and ExpertParameters=yoursettings.set to attach the EA with a saved set file
Then add the file to the end of your shortcut’s Target, for example: “…terminal.exe” configstart.ini. For most traders, the saved profile from Step 2 is simpler and just as reliable, so only use this method if you need it.
Troubleshooting
MetaTrader opens but says “No connection”
The terminal started before the network was ready, or the saved password was not stored. Re-save the login (Step 1), or switch to Task Scheduler with a 30-second delay (Option B).
Windows still stops at the sign-in screen
Autologon is not configured, or your password changed. Run Autologon again with the current password.
MetaTrader opens twice
You have added the same terminal to both the Startup folder and Task Scheduler. Remove one.
The EA is attached but not trading
Check that AutoTrading is green and that Allow automated trading is ticked in Tools > Options > Expert Advisors. Some EAs also need Allow DLL imports. Look in the Experts tab for error messages.
The VPS keeps restarting at random times
Frequent unplanned restarts usually come from automatic Windows updates. Follow our guide on how to stop Windows updates restarting your forex VPS to move updates to the weekend.
Make Restarts Even Safer
- Use stop losses stored at your broker, so trades are protected while the VPS restarts.
- Choose EAs that recover their open trades after a restart, usually by tracking magic numbers.
- Back up your MetaTrader data folder regularly. See how to back up your forex VPS and trading data.
- Keep enough memory free. A server close to its RAM limit starts slowly after a reboot. Check how much RAM MT4 needs on a VPS if you are adding terminals.
- Moving to a new server? Follow how to migrate your MT4 setup to a new VPS, then repeat the auto-start steps on the new server.
Looking for a VPS that is ready for automated trading? Explore our forex VPS plans with MT4/MT5 auto startup, a dedicated IP and servers in London and New York.
Frequently Asked Questions
Why does MT4 not open after my VPS restarts?
MT4 is a desktop program and needs a signed-in Windows session. After a restart, Windows waits at the sign-in screen, so MT4 cannot start until you enable automatic sign-in and add MT4 to startup.
Does this work for MetaTrader 5?
Yes. The steps are the same. Use terminal64.exe instead of terminal.exe when creating the shortcut or scheduled task.
Will my EA settings be lost after a restart?
No, as long as MetaTrader was closed normally at least once after you set up your charts. It reloads the last profile with every chart, EA and input. Saving a named profile gives you an extra backup.
Can I auto-start several MT4 terminals?
Yes. Install each terminal in its own folder and add a separate shortcut or scheduled task for each one. Adding a short delay between them reduces the load at startup.
Is it safe to store my Windows password for automatic sign-in?
Microsoft’s Autologon tool stores the password encrypted. It does not weaken remote desktop security, which still requires your password. Use a strong, unique password for your VPS.
What happens if I sign out instead of disconnecting?
Signing out closes MetaTrader and stops your EAs. Always close the remote desktop window or choose Disconnect instead.
Will my open trades be closed during a restart?
No. Your trades stay open at your broker. However, your EA cannot manage them while the VPS is restarting, which is why stop losses stored at the broker are important.
