Guide to Installing MT4 on Ubuntu Linux

image

Getting Started with MetaTrader 4 on Linux

This guide will walk you through installing and running MetaTrader 4 (MT4) on Linux, from downloading the setup to launching your first trade. Whether you’re using a desktop or a VPS, you’ll be ready to start trading in no time.

What is MetaTrader 4?

MetaTrader 4 (MT4) is a popular trading platform for Forex and CFDs. Although it’s not natively supported on Linux, it can run smoothly using compatibility tools such as Wine. This guide covers everything you need to install and use MT4 on Linux systems.


Preparing Your System for Wine

Before installing MT4, ensure your system is ready for Wine. MT4 is a 32-bit application, so you need to enable 32-bit support and configure the official WineHQ repository.

Check your Ubuntu version
These instructions are compatible with Ubuntu 20.04 LTS, 22.04 LTS, and newer:

lsb_release -a

Recommended Linux distributions

  • Ubuntu (20.04/22.04 LTS) and Linux Mint: stable and beginner-friendly.
  • Lightweight distros like MX Linux or Lubuntu work well on older hardware.
  • Servers: Ubuntu LTS is preferred for VPS installations.

Tip: A lighter desktop environment improves MT4 performance. Avoid heavy setups like GNOME with many extensions if your PC is low-powered.

Enable 32-bit architecture

sudo dpkg --add-architecture i386

Add WineHQ keyring

sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key

Add WineHQ repository (replace $(lsb_release -cs) with your Ubuntu codename, e.g., jammy for 22.04)

sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources
sudo apt update

Your system is now ready to install Wine.


Installing MT4 on Linux Desktop

Step 1: Install Wine

Wine allows MT4 to run on Linux. Open a terminal and type:

sudo apt-get install wine-stable

For the development version:

sudo apt-get install wine-development

Verify installation:

wine --version

Step 1.1: Create a 32-bit Wine prefix

MT4 requires a 32-bit environment:

WINEARCH=win32 WINEPREFIX=~/.wine32 winecfg
  • Allow Wine to install Mono (.NET) and Gecko (browser support).
  • Set the Windows version to Windows 7.
  • Autodetect drives to map Linux directories.

Step 1.2: Correct installation folder

Install MT4 in Program Files (x86) inside your Wine prefix.


Step 2: Download MT4

Get the Windows MT4 installer (mt4setup.exe) from your broker (e.g., FBS).

Step 3: Install MT4 using Wine

Run the installer:

  • Option 1: Open with Wine Windows Program Loader and follow the steps.
  • Option 2: Copy a pre-installed MT4 folder from a Windows system and launch terminal.exe via Wine.

Alternative: Use the MT4 web or mobile version if desktop installation fails.


Using GUI Tools: PlayOnLinux, Bottles, or Lutris

PlayOnLinux

sudo apt install playonlinux
  • Launch → Install a program → Create 32-bit virtual drive → Install MT4.

Bottles

  • Install via package manager or Flathub.
  • Create a 32-bit environment → Run MT4 installer.

Lutris (optional, gaming-focused)

  • Manage Wine prefixes and run MT4 as a custom executable.

These GUI tools simplify Wine configuration and isolate MT4 from other applications.


MT4 File Locations in Wine

Default 32-bit Wine prefix:

~/.wine32/drive_c/Program Files (x86)/MetaTrader 4/

Subdirectories:

  • MQL4/Experts → Expert Advisors (EAs)
  • MQL4/Indicators → Custom indicators
  • MQL4/Scripts → Scripts
  • profiles/templates → Chart templates

Access via MT4: File → Open Data Folder

Paths differ if using a custom Wine prefix or GUI tools.


Installing MT4 on a Linux VPS

  1. Connect to VPS:
ssh user@your-vps-ip
  1. Install Wine (same as desktop)
  2. Configure 32-bit Wine prefix
WINEARCH=win32 WINEPREFIX=~/.wine32 winecfg
  1. Install or copy MT4
  • Run installer via Wine
  • Or copy existing MT4 folder and launch terminal.exe
  1. Optimize VPS
  • Disable unnecessary services
  • Keep MT4 minimized
  • Backup MQL4 folders regularly

First-run Checklist

  1. Login: File → Login to Trade Account → Select server → Enter credentials
  2. Check connection: Green/red status bar
  3. Open chart: Market Watch → Right-click → Chart Window
  4. Apply templates/indicators
  5. Test trade: Right-click chart → New Order → Small volume (e.g., 0.01 lots)
  6. Close trade: Trade tab → Right-click → Close Order

Use a demo account for initial testing.


Common Linux MT4 Issues

  • Market tab not working → Download manually from MQL5.
  • MT5 installer downloaded by mistake → Use official MT4 installer (mt4setup.exe).
  • Broken fonts → Install Microsoft TrueType fonts:
sudo apt-get install ttf-mscorefonts-installer
  • No server connection → Ensure wine-gecko and wine-mono are installed; check firewall.
  • Crashes after update → Delete terminal.exe cache in Wine prefix and reinstall MT4.

GUI tools like PlayOnLinux or Bottles can improve stability for Wine users.


One-command installation (advanced)

Some users create scripts to automate Wine setup and MT4 installation with a single command. This is suitable for experienced Linux users comfortable with scripting.

image

Simplifying MT4 Installation with a One-Command Script

To make installing MT4 on Linux easier, you can use a prebuilt script that automates the process:

wget https://download.mql5.com/cdn/web/metaquotes.software.corp/mt4/mt4ubuntu.sh
chmod +x mt4ubuntu.sh
./mt4ubuntu.sh

What the Script Does

  • Downloads the official mt4ubuntu.sh script from MetaQuotes.
  • Makes the script executable using chmod +x.
  • Runs the script, which:
    • Installs necessary Wine packages.
    • Creates a Wine prefix for MT4.
    • Downloads and launches the MT4 installer automatically.

Prerequisites

Before running the script, ensure:

  • 32-bit architecture is enabled: sudo dpkg --add-architecture i386
  • WineHQ repository and packages are already configured.
  • You are using Ubuntu 20.04 LTS, 22.04 LTS, or later.

How to Remove MT4 (Rollback)

If you need to uninstall or reset the auto-installed MT4:

  1. Delete the Wine prefix (default ~/.wine or ~/.wine32 if specified): rm -rf ~/.wine ~/.wine32
  2. Remove Wine packages if necessary: sudo apt remove --purge winehq-stable wine-stable wine-stable-i386 wine-stable-amd64 sudo apt autoremove
  3. Delete the script itself: rm mt4ubuntu.sh

Tip: If you want more control over Wine prefixes or prefer GUI tools like PlayOnLinux or Bottles, stick to the manual installation method instead of the one-command script.


Security Considerations for Wine and Shell Scripts

Running Windows software on Linux through Wine requires some extra caution:

  • Verify sources: Only download installers and scripts from official sources (WineHQ, MetaQuotes, FBS). Avoid unofficial mirrors or forums.
  • Review scripts: Shell scripts can execute any command with your user privileges. Inspect the contents before running and avoid sudo unless necessary.
  • Least privilege: Run Wine as a regular user, not root. Keep MT4 isolated in its own Wine prefix (~/.wine32) to prevent interference with other apps.
  • Sandbox prefixes: Creating a dedicated Wine prefix for MT4 isolates files and reduces risks.
  • Maintain system hygiene: Keep Linux, Wine, and MT4 updated. Use a firewall and avoid unnecessary Windows software inside Wine.

Note: MT4 in Wine isn’t inherently less secure than on Windows, but it slightly increases the attack surface. Treat your Linux trading environment with the same care as a production system.


Maintenance: Updating, Uninstalling, and Backing Up

Update Wine
Keep Wine updated for compatibility and bug fixes:

sudo apt update
sudo apt upgrade
wine --version

Update MT4
MT4 usually updates automatically. If an update breaks the platform under Wine, reinstall MT4 in the same prefix or create a fresh one.

Resetting a Wine prefix
If your MT4 installation becomes unstable:

rm -rf ~/.wine32
WINEARCH=win32 WINEPREFIX=~/.wine32 winecfg

Backing up trading profiles
Before resetting Wine, back up your MT4 data folder to preserve indicators, EAs, and templates:

~/.wine32/drive_c/Program Files (x86)/MetaTrader 4/

Copy the MQL4/ and profiles/ folders to another location. You can restore them later into a clean installation.

Uninstall Wine completely (if needed)

sudo apt purge winehq-stable wine-stable
sudo apt autoremove

Tip: Regularly backing up MQL4 and template folders saves time and effort if something goes wrong.

Get high-accuracy trading signals delivered directly to your Telegram. Subscribe to specialized packages tailored for the world’s top markets:

Free Crypto Signals Subscribe via Telegram

Free Forex Signals Subscribe via Telegram

Free VIP Signals (Gold, Oil, Forex, Bitcoin, Ethereum, Indices) Subscribe via Telegram

Free Trading Acoount Open With ORON LIMITED Signals (Gold, Oil, Forex, Bitcoin, Ethereum, Indices)
Open Account

Not profitable? Don’t worry! Join our copy trading system where we provide lower risk returns. Benefits of Joining Us:

-Lesser Risk as lot size is minimal
-Higher returns (approx. 5% to 10% monthly)
-Easy Deposit and Withdrawal with USDT using crypto wallets
-Lesser Drawdown
-Instant Support
-Invest Now and get guaranteed returns with us. DM us for more info❤️
-Start Now

*Copy Trading is free but we charge some percentage of profit as fees.*

Full VIP signals performance report for September 22–26, 2025:

  View Full Performance Report

meetkheni0011@gmail.com
meetkheni0011@gmail.com

Leave a Reply

Your email address will not be published. Required fields are marked *