Many of our clients install trading terminals on virtual servers. It is quite convenient and the advantages are obvious. You do not need to be in front of the computer all the time, the VPS server is constantly online and the trading terminal is always on.
Due to the general interest of our clients to the MT4 terminal in conjunction with Linux systems, we decided to write how to install Metatrader 4 on a virtual server with access via x2go.
Server part
Connecting to the server via ssh, you must perform the following steps.
Add repositories with x2go:
')
$ echo "deb http://packages.x2go.org/debian jessie main" > /etc/apt/sources.list.d/x2go.list $ echo "deb-src http://packages.x2go.org/debian jessie main" >> /etc/apt/sources.list.d/x2go.list $ apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E $ apt-get update && apt-get install x2go-keyring && apt-get update
Install x2go:
$ apt-get install x2goserver x2goserver-xsession
Edit the .profile file in your home directory. You need to find the string
"mesg n"
and replace it with
"tty -s && mesg n"
:
$ vi.profile
Install the browser:
$ apt-get install iceweasel
Create a file to run the Metatrader installation. At the current stage, it will not work. This file will be launched a little later, from the client:
$ printf '#!/bin/bash\n\nwine \"Downloads/OBRTraderSetup.exe\"\n' > mtinstaller.sh
The following command creates a file for running Metatrader that is not yet installed:
$ printf '#!/bin/bash\n\nwine \"/root/.wine/drive_c/Program Files/OBR Forex/OBR Trader/terminal.exe\"\n' > mtrunner.sh
These files should be executable:
$ chmod +x mtrunner.sh && chmod +x mtinstaller.sh
Now put the wine:
$ dpkg --add-architecture i386 && apt update && apt-get install wine wine32
This completes the work on ssh, you can proceed to connect to your remote machine via x2goclient.
Client part
Download client
from here . After installing and opening the client, click on the "New session" button:
Next you need to create three sessions:
1. Session to launch the browser:
2. Session to start Metatrader 4:
3. Session to start the installation of Metatrader 4:
Now the x2go client window should look like this:
Click on the “Debian-Firefox” session, enter the password, open a browser window running on our VPS, go to the
forex site and log in. In x2to, the clipboard works fine, so links can be copied.
Now you need to put Metatrader 4 on our
VPS . Download the program from the
site . While swinging, you can open a "demo account"; to the post office. specified at registration will come all the necessary data on the account. The browser is no longer needed. If you do not want to close it, but want to return to the open tabs later, click on the button marked with a red circle in the x2go client. Similarly, to leave Metatrader open, but to disconnect from the VPS you need to use this button.
We start the installation of Metatrader 4. Click on the “Debian-Metatrader4-Installer” session, enter the password from the VDS and follow the instructions on the screen.
Everything. Now you can open the x2go session Debian-Metatrader4 and Metatrader will start on the remote machine. If you want to keep it running, do not close the window; instead, use the pause button in the x2go client window. Successful trade!
PS In addition to this method of connecting to VDS and installing Metatrader, you can use some other option from a recent article on
Habré , but it seems to us that this is the most preferred method, because there are no RAM costs to run extra programs.
For MT-4 stable operation, the following server configuration will suffice:
CPU 1 x2.2GHz, RAM 1GB, DISK 20 GB, one dedicated IP address