Howto Install an Ubuntu Server for Metatrader5 (MT5) (with RDP)

Choose a Server

I personally prefer a German Cloud Server from, very reliable and good prices. First choose a location (Nuremberg, Falkenstein and Helsinki available). It doesnt make a big difference where your Cloud is located, unless you are a High-Frequency Scalper. Then choose the newest Ubuntu Image available (eg. 20.04) and a non-dedicated Server with a local SSD. You really dont need many CPU ressources or Network storage.
Lastly I recommand to choose 3 Cores (VCPUs), 4GB Ram and the lowest SSD size available (40GB is more than enough). In this case the Server costs are 8.21€/monthly. Thats enough to smoothly run Ubuntu with a Desktop you can connect to via RDP, start several independant Metatrader 5 instances via the Windows Emulator WINE and open a dozen Charts with EAs on top of it. After you get the Root-Password from your Provider and you logged in as Root, proceed as follows:

Update, Cleanup

Update all
apt -y update && apt -y upgrade

Cleanup all
apt -y autoclean && apt -y clean && apt -y autoremove --purge

Install some basic stuff
apt install -y vim mc tree wget curl bzip2 unzip tar git htop ca-certificates rsync bind9-utils

Install Firewall related
apt install -y fail2ban

Create a User

adduser matze
usermod -aG sudo matze
Maybe disable root account (passwd -l root), reboot and log in as user. Never log in as root again.

Harden, Firewall

Edit /etc/ssh/sshd_config
PermitRootLogin no
MaxAuthTries 4
MaxSessions 2
AllowTcpForwarding no
X11Forwarding no
ClientAliveCountMax 2

Edit /etc/fail2ban/jail.local
bantime = 8h
ignoreip =
ignoreself = true
enabled = true
port = 22
filter = sshd
logpath = /var/log/auth.log
maxretry = 3

Start Firewall
sudo ufw allow ssh
sudo ufw enable
sudo ufw status

Install lightweight Desktop Environment

sudo apt install -y xfce4 xfce4-terminal xorgxrdp tango-icon-theme firefox
echo xfce4-session > ~/.xsession

Application -> Settings -> Appearance: Style "Adwaita Dark", Icons "Tango"

Install RDP Remote Desktop

sudo apt install -y xrdp
sudo ufw allow 3389

Install Wine

sudo apt install -y wine wine32 winbind

Reboot your machine, start Firefox and download Metatrader. Then you open a terminal in your Download Directory /home/matze/Downloads/ and execute
wine mt5setup.exe