# Installing on Linux

How to run the Relay2Trade app on a Linux VPS or a Linux computer with the one command the Desk gives you: which systems and machine sizes it needs, how long the command stays valid, "Give me more time", what happens after a restart, how updates work and how to stop or remove it. On Linux the app has no window: everything is done in the Desk.

## What you need

- **A Linux system:** Debian, Ubuntu, Fedora or Arch.
- **A 64-bit Intel or AMD machine** with at least 1 processor, 1 GB of memory and 10 GB of disk. A VPS or a computer of your own both work: the same command works on a Linux computer at home.
- **A processor with AVX.** MetaTrader 5 needs it to trade. Almost every machine has it; on a VPS it depends on how the provider set the processor up (see "If something goes wrong").
- **Root access**, or a user with sudo, and a terminal on the machine (on a VPS, sign in to it first, usually over SSH as your provider describes).
- **A Relay2Trade account** you can sign in to in the Desk, on any device.

You do not install MetaTrader 5, Relay2Trade or anything else yourself: the command does it all and signs the app in to your account.

On a VPS the app trades around the clock. On a Linux computer at home it trades while that computer is on and awake.

## Get the command and run it

1. In the Desk on relay2trade.com, open "Where the app runs" (on the Overview while no app runs yet; afterwards Account → "Where the app runs", or Account → Security → "Computers running the app" → "Run it on a VPS").
2. Choose "On a VPS or a Linux computer you already have", then "Linux: get the command".
3. "On Linux, with one command" opens. Confirm it is you (your password, plus the two-factor code if it is on; Google instead when your account has Google connected) and press "Show the command".
4. Choose how you are signed in on the machine: "I am logged in as root" or "As a user with sudo". The command changes to match.
5. Copy the command. Open a terminal on that machine, paste it and press Enter. Nothing else is needed. If the machine has no curl, the Desk shows another line under "No curl there? Use this in its place:".
6. Watch the Desk. The steps show there as the machine reports them, each ticked when done:
   - "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"
7. The set-up takes about ten minutes. You can leave the page: the machine joins your account by itself, with the app signed in, and shows up in the list of computers.

The command is made for your account and signs the app in once, by itself. Keep it to yourself, as you would a password.

## How long the command stays valid

- The command works once.
- It is waited for ten minutes. Every step the machine reports gives it more time, so a set-up that is working never runs out.
- "Give me more time" starts the ten minutes again. It can be pressed a few minutes after the last time, not sooner.
- If nothing ran the command within ten minutes, the Desk says "This command has run out of time: nothing ran it within ten minutes. Make a new one when you are at the machine." Press "Make a new command".
- "Cancel this set-up" ends a set-up that stopped halfway.
- While one set-up is under way, another cannot start ("A VPS is being set up already. Wait for it to finish, or for its command to run out.").

## After it joins: MetaTrader, Telegram, listeners

When the set-up ends, the Desk says "Your VPS is running the app. One thing is left: sign in to MetaTrader on it." Then:

1. Press "Sign in to MetaTrader", or open Connections in the Desk, and log in to your broker account (account number, password, server). See https://relay2trade.com/help/connecting-metatrader.md.
2. Connect Telegram in Connections: scan the QR code with Telegram on your phone, or use your phone number and the code Telegram sends. See https://relay2trade.com/help/connecting-telegram.md.
3. Add a listener, starting on "Watch — record only". See https://relay2trade.com/help/listeners-and-modes.md.

With "Sync settings & listeners" on, your profiles, listeners and limits come from your account. If you are moving from a Windows PC with settings sync off, the Desk makes no command until it is on: "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." Turn "Sync settings & listeners" on in the app on that PC (Settings → "Application" → "Remote control & sync"), then get the command.

## Everything is done in the Desk

On Linux the app has no window. The Desk is how you reach it, so "Remote control" stays on: "Your app runs without a window of its own, so remote control stays on: the Desk is how you manage it." In the Desk you:

- sign MetaTrader 5 and Telegram in and out (Connections);
- add, change and remove listeners and run dry runs;
- change every setting;
- follow signals, positions and activity, approve signals and close trades;
- restart the app or sign it out (Account → Security → "Computers running the app").

In the list of computers, the machine shows its name, its system, the app's version, when it first signed in and when it was last heard.

## Restarts

The app starts again by itself when the machine restarts. Nothing has to be signed in on the machine for that. After a restart, give it a few minutes, then check in the Desk that it does not say "Your app is offline".

You can also restart only the app from the Desk: Account → Security → "Computers running the app" → "Restart the app". Open trades stay in MetaTrader.

## Updates

The app keeps itself up to date on Linux as on Windows: it installs a new version at the first moment with no open trades, no pending orders and no signals waiting for approval, and checks its signature first. There is nothing to do on the machine. To update at once, press "Update now" under "Needs you" in the Desk when a newer version is out; open trades stay in MetaTrader while the app restarts.

Running a new command from the Desk on the same machine also sets everything up again over what is kept there: nothing kept there is lost.

## Stopping it or removing it

- **To stop it trading there:** in the Desk, Account → Security → "Computers running the app" → "Sign it out" on that machine. It stops there until it is signed back in; open trades stay in MetaTrader. "Sign it back in" brings it back without touching the machine.
- **To move the app elsewhere:** start it in the new place. The Linux machine is signed out at that moment. See https://relay2trade.com/help/computers-and-moving.md.
- **To take it off the list:** once it is signed out, press "Remove". If the app there is ever started again, it signs in as on a new computer.
- **To get rid of a rented VPS:** sign it out, then delete the VPS at your provider. A VPS you rent is yours: it is not removed with your Relay2Trade plan, and it keeps costing until you delete it there.

## If something goes wrong

- **"This machine's processor has no AVX, which MetaTrader 5 needs to trade: nothing was installed."** On a VPS that is the provider's setting for the processor. Ask them to give the VPS the host's own processor type (often called "host CPU" or "CPU passthrough"), or use another VPS.
- **The command says the machine was updated and has not been restarted since.** Restart the machine, then run the same command again (or make a new one if it ran out of time).
- **The command asks to be run as root.** Choose "As a user with sudo" in the Desk, or sign in as root, and paste it again.
- **"This needs a 64-bit Intel/AMD machine".** The machine has a different kind of processor (an ARM machine, for example). Use a 64-bit Intel or AMD machine.
- **"The set-up on your VPS stopped before the app started."** Get a new command and paste it there: it starts over, and nothing kept there is lost.
- **"The command made at … ran out of time: nothing ran it, or its set-up stopped."** Get a new one and paste it on that machine.
- **The Desk stopped waiting while the machine was still busy.** On a slow machine, press "Give me more time" while it works; if it ran out, make a new command and paste it.
- **The app joined, but nothing trades.** MetaTrader 5 and Telegram are signed in where the app runs. Open Connections in the Desk, sign both in, then add a listener and set it to Auto when you are ready.
- **"Your app is offline" after the machine restarted.** Give it a few minutes. If it stays offline, check that the machine is running and online at your provider, then restart the app from the Desk or run a new command.
- **MetaTrader will not log in to your broker.** If your broker's server is not in the list, check the name against the list first; if it is right, write to support with your broker's name and the server name so it can be added (the app runs without a window there, so it cannot be looked up by hand).

More: https://relay2trade.com/help/troubleshooting.md.
