# Running Relay2Trade on a VPS

Every way to run the app on a VPS: "VPS: Quick install" (a VPS created for you with the app already on it), a VPS in your own DigitalOcean account, a Windows VPS you set up yourself and a Linux VPS with one command, with choosing a location, restarts, managing a VPS from the Desk and what happens when a paid VPS ends.

## What a VPS is for

A VPS is a computer in a data centre that stays on. With the app on it, your signals are read and traded around the clock, while your own computer is off, asleep or in your bag. You do not need to open it day to day: the Desk shows what the app does and is where you change it, from any device. Whether you need one, and MetaTrader's own "VPS" button (where Relay2Trade cannot run): https://relay2trade.com/help/where-the-app-runs.md.

## The ways to a VPS

All of them start in the Desk, under "Where the app runs": on the Overview while no app runs yet, and afterwards under Account → Security → "Computers running the app" → "Run it on a VPS". You can do every step from any device, a phone included.

| Way | What you do | Ready in | Who you pay |
|---|---|---|---|
| "VPS: Quick install" | Press "Create it now" | Under a minute | Your Relay2Trade plan (included in the demo day) |
| "On a VPS in your own DigitalOcean account" | Approve at DigitalOcean, add a payment method there | About ten minutes | DigitalOcean, about 6 USD a month |
| A Linux VPS you already have | Paste one command | About ten minutes | Your provider |
| A Windows VPS you set up yourself | Remote Desktop, install, a few settings | About forty minutes, once | Your provider, roughly €10–20 a month |

The first three need no Remote Desktop and nothing installed by hand. On them the app has no window: you do everything in the Desk, and "Remote control" stays on. After the VPS restarts, the app on them starts again by itself.

## VPS: Quick install

A VPS created for you, with the app already on it. Nothing to install, rent or set up, and it stays on around the clock.

### Getting it

- **On your demo day** it is included: "Included in your demo day: nothing to buy". Your demo day starts when your app is signed in, which is the moment you press "Create it now". Have your MetaTrader login and your Telegram at hand: the rest of the set-up takes about five minutes.
- **With a plan** it is an optional paid extra beside the plan, paid through your Relay2Trade plan and renewed with it. When you pick a plan, the Desk asks "Where should the app run?": choose "VPS: Quick install" to take it with the plan, or "Your own device/VPS" to take the plan alone. The total is shown before you pay.
- **Added to a plan you already have:** Desk → Account → "Plan & billing" → "Add it to my plan". The Desk says what is charged now for the days left in the period and what each renewal costs, then asks you to confirm. If your card does not go through, finish on "Pay on Stripe's page", with this card or another; if you leave it, nothing is added and nothing is charged.
- **While your plan is on free time** it is added to paid time: "Renew now and add it, or add it when the free time ends."
- **A plan that was not bought as a subscription** (set up for you by hand) cannot take it from the Desk: write to support and it is set up for you.

Bought together with a new plan while your app is signed in nowhere yet, it is created as soon as the payment goes through. Otherwise creating it is its own press, "Create it now": the VPS then takes the app over from the computer it runs on.

### Creating it

1. In "Where the app runs", on the "VPS: Quick install" card, press "Create it now".
2. The Desk shows "Creating your VPS": "Your VPS is ready", "Fetching and checking the app", then the app signing in. It shows up by itself in under a minute. You can leave the page.
3. The Desk says "Your VPS is running the app. One thing is left: sign in to MetaTrader on it." Press "Sign in to MetaTrader", or open Connections.
4. Connect Telegram in Connections and add a listener.

Starting the app on this VPS signs it out on the computer that ran it before: one computer runs the app at a time.

### In the list of computers

Desk → Account → Security → "Computers running the app". Your VPS is marked "VPS" and shows one of: "running the app", "starting" ("The app is starting on your VPS: it takes under a minute."), "stopped", or "put away". Its buttons:

- **"Stop it":** "Stop the app on your VPS? It trades nothing until you start it again. Trades already open stay open in MetaTrader." While stopped: "It is stopped: nothing is traded from it until you start it again."
- **"Start it":** starts it again in a moment, as it was.
- **"Remove it":** "Remove your VPS? The app and its MetaTrader on it are deleted for good." While your plan still includes it, you keep paying for it and can create it again; to stop paying, take it off your plan under "Plan & billing".
- **"Run it on the VPS":** shown when the app was signed in on another computer since. It moves the app back to the VPS and signs it out on the other computer.

Signing out, restarting, stopping, moving and removing ask you to confirm it is you first. While a request is on its way, the row says "Sent: it takes a few seconds."

### When it ends

- **You take it off your plan** (Plan & billing → "Remove it"): it keeps running until the end of the paid days, then it is put away. With no paid days ahead, it is put away right away.
- **You cancel your subscription:** the Desk asks "And your VPS until then?" with "Cancel, and keep the VPS running until …" or "Cancel, and stop the VPS now". It ends with the subscription.
- **Your demo day ends without a plan:** it is put away. "Choose a plan with the VPS and it comes back as it was, or run the app on your own device or VPS."
- **Put away** means: nothing is traded from it, and its settings and sign-ins are kept for 12 months, until the date the Desk shows ("Put away because the VPS ended on your plan…"). When your plan has the VPS again within that time, it comes back as it was ("Bring it back"). A week before the 12 months end, your inbox says on which day what was kept is removed.
- **Remove what is kept** at any time with "Remove it": "Remove what is kept of it? Its settings and sign-ins are deleted for good."
- **You delete your Relay2Trade account:** "Your VPS is removed with your account, with everything on it."

Open trades are never closed or touched when a VPS is stopped, put away or removed: they stay at your broker with their own stop-loss and take-profit, and the app no longer manages them from there.

## On a VPS in your own DigitalOcean account

The Desk creates a small VPS in your own DigitalOcean account and starts the app on it. It is DigitalOcean's Basic plan (1 GB memory, 1 processor, 25 GB disk): 6.00 USD a month, charged by DigitalOcean to your account, not by Relay2Trade. It is yours, and it stays in your account until it is destroyed.

### Setting it up

1. In "Where the app runs", on "On a VPS in your own DigitalOcean account", press "Set it up".
2. Read what it is and costs. Under "Choose where it runs", pick a location near your broker's servers if you can, or "Wherever DigitalOcean has room".
3. Press "Continue to DigitalOcean". Sign up or sign in there and approve the Relay2Trade application. Relay2Trade holds that permission for at most an hour and gives it back as soon as the VPS runs.
4. A new DigitalOcean account makes no VPS until it has a payment method. The Desk says "DigitalOcean wants a payment method" and takes you to their billing page ("Go there now", or "Stay here"). Add one, come back to the Desk and press "Try again".
5. The Desk shows "Your VPS is being set up": "DigitalOcean is making it now. It shows up here by itself in about six minutes, with the app signed in. You can leave this page." The steps tick off as the VPS reports them: "The VPS has started", "Preparing the system", "Building what the app runs in", "Preparing what MetaTrader needs", "Installing MetaTrader", "Installing the app", "Signing the app in".
6. Then: "Your VPS is running the app. One thing is left: sign in to MetaTrader on it." Press "Sign in to MetaTrader", connect Telegram and add a listener.

When the VPS starts, the app is signed out on your other computer.

### Afterwards

In the list of computers it shows as "VPS at DigitalOcean" with its location, "See it at DigitalOcean" and "Destroy this VPS". "Restart the app" and "Sign it out" work as for any computer.

**Destroying it:** "Destroy this VPS" removes the VPS and everything on it for good, and the app on it stops at once. DigitalOcean may ask for your approval for this one step; if you do not finish it, nothing is destroyed. You can always destroy it in your own DigitalOcean account instead.

**Your plan and your DigitalOcean VPS are separate.** Cancelling your Relay2Trade subscription does not stop it: it keeps running, and DigitalOcean keeps charging you, until it is destroyed. Right after you cancel, the Desk asks whether to destroy it ("Destroy this VPS" or "Keep it"). Deleting your Relay2Trade account does not remove it either: the Desk offers to destroy it first.

## A Windows VPS you set up yourself

You rent a Windows machine from any provider, connect with Remote Desktop and install the app as on a PC. Some brokers give their clients a free Windows VPS above a certain balance or volume; any ordinary Windows VPS works. The contract is between you and the provider.

### Picking one

- **Windows with a desktop:** Windows Server 2019 or newer, or Windows 10 or 11. If the provider asks, take the version "with Desktop Experience".
- **2 cores, 4 GB of memory:** Windows takes about 2 GB, the app 200–400 MB and each MetaTrader terminal another 100–200 MB, and every profile runs its own terminal. 2 GB works for one profile but leaves Windows little room. 40 GB of disk is plenty.
- **Near your broker** (see "Choosing a location" below).

### Setting it up

1. **At home first:** in the app on your own computer, open Settings → "Application" and, under "Remote control & sync", switch "Sync settings & listeners" on, so the VPS picks up your profiles, listeners and limits. Skip this if the VPS is your first install.
2. **Order the VPS** with a Windows image and a location. The provider sends you an IP address, a user name (usually Administrator) and a password.
3. **Connect with Remote Desktop.** On Windows press Start, type "Remote Desktop Connection", enter the IP address, then the user name and password. On a Mac, iPad, iPhone or Android use Microsoft's free "Windows App". The first connection warns that the certificate cannot be verified; that is normal for a fresh server.
4. **Change the password, then update Windows.** Press Ctrl+Alt+End, choose "Change a password" and set a long one you use nowhere else. Run Windows Update until nothing is left, and restart.
5. **Install Relay2Trade.** In the VPS's browser open relay2trade.com/download, press "Download for Windows" and run the setup. Leave "Start Relay2Trade automatically" ticked. See https://relay2trade.com/help/installing-on-windows.md.
6. **Sign the app in:** confirm in the browser, type your email and password, or use a code from the Desk ("Windows: sign in with a code"). Signing in here signs your home computer out. If a profile is missing, press ↻ in the top bar. Look through the settings once before anything trades.
7. **Connect MetaTrader 5 and Telegram.** Telegram lists a new device called Relay2Trade and may warn about a login from the country your VPS is in: that is this one. The session on your old computer is no longer used; if you are not going back, remove it in Telegram under Settings → Devices.
8. **Check the two start-up switches:** in Settings → "Application", "Launch at startup" and "Start minimized in tray" both on.
9. **Close the Remote Desktop window with its X.** That leaves your Windows session, MetaTrader and the app running. "Sign out" or "Shut down" in the Start menu stops everything.

### Coming back after a restart

The app starts when your Windows user signs in, and MetaTrader needs a signed-in desktop. After a restart (a Windows update, the provider's maintenance) nobody is signed in, so nothing runs until you connect. Set it up once:

- **Let Windows sign in by itself:** download Autologon from Microsoft (search for "Sysinternals Autologon" on learn.microsoft.com), run it inside the VPS, enter your user name and password and press Enable. From then on Windows signs that user in at every start, and the app starts with it.
- **Choose when Windows restarts:** in Settings → Windows Update, set the active hours to the hours your groups post. Better still, once a month at the weekend, when the markets are closed, install the updates and restart it yourself.
- **If it stops a few hours after you disconnect:** some server images end a disconnected session after a time limit. Press Start, type gpedit.msc and go to Computer Configuration → Administrative Templates → Windows Components → Remote Desktop Services → Remote Desktop Session Host → Session Time Limits. Open "Set time limit for disconnected sessions", choose Enabled and set it to Never.
- **Test it once:** restart the VPS from its Start menu and do not reconnect. Five minutes later open the Desk from your phone. If your profile runs and the Desk does not say "Your app is offline", the machine looks after itself.

### Day to day and keeping it in shape

- You rarely need to connect: day to day, everything is seen and done in the Desk.
- App updates install by themselves at a moment with no open trade, pending order or approval.
- Once a month: connect, install the Windows updates, restart, and check in the Desk a few minutes later that the app is back.
- If your provider has a firewall, allow Remote Desktop (port 3389) only from your own IP address. Share the Remote Desktop access with nobody: no signal provider and no support agent needs it, Relay2Trade's included. Use the VPS for this and nothing else, and turn on two-factor for your Relay2Trade account (https://relay2trade.com/help/security.md).
- When you stop renting it, uninstall Relay2Trade first (Settings → "Application" → "Danger zone"), then delete the VPS at the provider.

## A Linux VPS you already have

In the Desk choose "Linux: get the command", confirm it is you, and paste the command in a terminal on the VPS, as root or with sudo. It installs everything, MetaTrader 5 included, and signs the app in, in about ten minutes. It needs Debian, Ubuntu, Fedora or Arch on a 64-bit Intel or AMD machine with at least 1 processor, 1 GB of memory and 10 GB of disk. The full walkthrough: https://relay2trade.com/help/installing-on-linux.md.

## Choosing a location

If you can, pick a location near your broker's servers: it shortens the time from signal to order. MetaTrader shows the ping to each server in its login window; lower is better. If you cannot tell, a European location suits most European brokers. The time zone of the VPS does not matter for trading: trading hours and days in your settings follow your broker's server clock, the one MetaTrader shows.

## Any VPS in the list of computers

Desk → Account → Security → "Computers running the app", for every kind of VPS:

- **Stop trading:** "Sign it out". "Sign it back in" brings it back. A "VPS: Quick install" also has "Stop it" and "Start it" (above).
- **Restart the app:** "Restart the app". Open trades stay in MetaTrader.
- **Move to another computer or VPS:** start the app in the new place; the old one is signed out at that moment. See https://relay2trade.com/help/computers-and-moving.md.
- **Remove:** "Remove it" for "VPS: Quick install"; "Destroy this VPS" for one in your own DigitalOcean account; for any other VPS, sign it out, "Remove" it from the list and delete it at your provider.

## If something goes wrong

- **The Desk says "Your app is offline" after a restart (Windows VPS).** Nobody is signed in to Windows, so the app has not started. Connect with Remote Desktop once (that starts it), then set up the automatic sign-in and test it.
- **It ran for a few hours after you disconnected, then stopped (Windows VPS).** The session was ended by a time limit on the server, or the Start menu's "Sign out" was used instead of closing the Remote Desktop window.
- **"Settings sync is off, so your settings are only on your computer and a VPS would start without them. Turn settings sync on in the app first, then come back here."** In the app on your computer, switch on Settings → "Application" → "Remote control & sync" → "Sync settings & listeners", then try again in the Desk.
- **"Your VPS could not be started. You can try again."** Press "Create it now" again.
- **"No VPS can be set up for you right now."** Try again later, or use your own device or VPS.
- **"That could not be done on your VPS. Try again in a moment; if it keeps happening, write to us."** Try the button again shortly; write to support if it repeats.
- **"It stopped by itself."** Press "Start it". If it keeps happening, write to support.
- **"Signed out: your app runs on another computer now."** Your app was signed in elsewhere. To run it on the VPS again, press "Run it on the VPS" in the list of computers.
- **"Your plan includes a VPS, and none is created: it is paid for either way."** Create it, or take it off your plan under "Plan & billing".
- **"DigitalOcean did not make the VPS. On a new account it wants a payment method first."** Press "Add a payment method at DigitalOcean", add one, then "Try again".
- **"Your email address at DigitalOcean is not confirmed yet."** Confirm it there, then try again.
- **"DigitalOcean did not get your approval, so no VPS was made."** or **"That trip to DigitalOcean is no longer open."** Start again from "Set it up".
- **"Setting up the VPS failed. It may still exist in your DigitalOcean account and still cost: destroy it there."** Press "Destroy this VPS", then try again.
- **The app is on the VPS and nothing trades.** Sign in MetaTrader 5 and Telegram in Connections, then add a listener.
- **The app says "Session expired — log in again" (Windows VPS).** Your account signed in on another computer. Sign the VPS back in from the list of computers ("Sign it back in"), or in the app.
- **New Terms are announced.** Press "Read and accept" in the bar at the top of the Desk, once per account; nothing is done on the VPS. If the day passes without it the app pauses, you get an email, and it resumes by itself within ten minutes of accepting.
- **To hear when the app stops:** in the Desk, Settings → "Account settings" → "Tell me when the app goes quiet".

More: https://relay2trade.com/guide/vps and https://relay2trade.com/help/where-the-app-runs.md.
