MetaTrader 4 on Linux

23 November 2012, 14:12
163 423


Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. Linux systems are widely used in smartphones and server hardware. Many home PC users prefer it to MS Windows series.

In this article, you will find out how to work in MetaTrader 4 via one of the Linux versions - Ubuntu.

Installing Wine on Ubuntu

One of the Linux features is the absence of a unified distribution kit. Different groups of developers work on several Linux versions including Debian, Mint, Ubuntu, OpenSUSE, Gentoo, etc. In this article we will consider one of the most popular distribution kits - Ubuntu.

Wine is a free software that allows users of the Unix-based systems to run an application developed for the Microsoft Windows systems. Among all the Wine versions there is one for Ubuntu.

  • Note that Wine is not a fully stable application. Thus, some functions in the applications you start under it may work improperly or not work at all.
  • It is strongly recommended to use the latest version of Ubuntu and Wine. Timely update provides the greatest stability of the trading platform.

All applications under Ubuntu are installed from the packages contained in repositories. In the latest versions of Ubuntu, the required Wine installation repository is already available in the system without additional settings. Therefore, to install Wine, you only need to execute one command on the command line (called "Terminal" in Ubuntu):

sudo apt-get install wine-stable

This command installs the latest stable version of Wine.

Installing Wine from the Command Line

You can also install the Wine version for developers. This version may contain various improvements, but be less stable. To install it, run the following command:

sudo apt-get install wine-development

If your Ubuntu version does not provide a repository and you get an error during Wine installation, run the following commands one by one:

wget -nc
sudo apt-key add Release.key
sudo apt-add-repository

Next, update the package information by executing the following command:

sudo apt-get update

After the command execution, install Wine using the following command:

sudo apt-get install --install-recommends winehq-stable

For details on installation under Ubuntu, please visit the official Wine site.

Starting MetaTrader 4

To install the terminal, download the installer "mt4setup.exe". After the download is complete, launch the setup file. The system will automatically determine that you are trying to run a file designed for Microsoft Windows and will offer to open it with Wine. Select this option and click "OK".

Opening MetaTrader 5 installation package via Wine

The system will automatically determine that you are trying to run a file designed for Microsoft Windows and will offer to open it with Wine. Select this option and click "OK". MetaTrader 4 installer will be launched. Complete all installation steps:

Installing MetaTrader 4

After installation is complete, you can start using MetaTrader 4 by running its terminal.exe file.

Another way to start using MetaTrader 4 in Ubuntu is copying the entire folder of the client terminal previously installed in Microsoft Windows:

Copying previously installed MetaTrader 4

After copying is complete, simply run terminal.exe file of MetaTrader 4 terminal. Wine will be used automatically to open the file. The screenshot below shows MetaTrader 4 terminal in Ubuntu system:

Known Issues

As was already mentioned above, Wine is not a completely stable software. Thus, some functions of the MetaTrader 5 terminal may work improperly. Currently the following issues are discovered:

Except for the above problem, you can enjoy all the features of MetaTrader 5 on Ubuntu.

MetaTrader 4 Data Directory

Wine creates a virtual logical drive with necessary environment for installed programs. The default path of the installed terminal's data folder is as follows:

Home\.wine\drive_c\Program Files\MetaTrader 4


If we type "Linux" in search box, we will receive about 30 pages of results. This suggests that many users are interested in running MetaTrader 4 on this operating system, and it is necessary to have a unified source of information on the subject. There is only one article on the topic written by one of the community members and it is long out of date, as it was published in 2006.

In the present article, we described an easy way to run MetaTrader 4 under Ubuntu operating system. All basic terminal functions are available to traders. We hope that this article, or, to be more precise - the comments to it, will become a good place for accumulating useful information about running Meta Trader 4 on Linux OS series.

Translated from Russian by MetaQuotes Software Corp.
Original article:

Last comments | Go to discussion (40)
Marco vd Heijden

Does anyone has a solution for Ubuntu 18.04 server?

I did everything but keeps giving error of proxy

Gecko is not even available anymore i kep getting error  " couldn't find any package wne-gecko2.21"

Mono is installed but still error of proxy

Internet is full of so called solutions but for the server edition of ubuntu 18.04 its not working 

Hope someone can help me out 

That is bionic beaver and that is the same one i proposed the solution for.

What is your processor architecture ? 

Here is the discussion for Metatrader on Linux:

mangir | 29 Jun 2019 at 16:37

I have found an easy way to use mt4 on linux. I use linux mint cinnamon.

1-Find the folder in your windows computer, May be it is c: program files (x86)/ Meta Trader 4 IC Markets. 

2-Copy this folder any where in your linux computer.

3-Open this folder and right click terminal.exe, choose open with wine  ( I have Q4wine so I choose Q4wine)  now your MT4 is running on linux.

4-Bad news is no market tab, and can not adjust the tester speed.

5-Good news is you can do the same thing to run MT5 and MT5 has market tab and tester speed.

G Cat
G Cat | 15 Oct 2020 at 03:31
As much as I love Linux, I run MT4 in Virtual Box on my Manjaro desktop. The VM is Windows 10. Everything is blazing fast. However, I have a crazy quick Ryzen processor with 32 gigs of RAM. That's probably why is works flawlessly. Having enough RAM is key for proper VM performance.
[Deleted] | 29 Nov 2020 at 12:55
Marco vd Heijden:

I did already.

Many times actually.

But people keep posting these proxy problems without searching the site for a solution.

The installer fails to set up a secure connection and as a result the proxy window appears.

The solution is to update the necessary packages, Gecko and Mono.

Or to use a portable version of metatrader since it is not necessary to actually install the terminal.

A portable copy will run fine.(even the one straight from your C: drive !)

As for the (Market) indicators and EA's no they do not work and have never worked,

Simply because if they did it would become peanuts to copy them and this would pose a security threat for the developers/sellers.

Here is it is on Kali, directly from the Live DVD !

For those that want to be sure about things, (and stay in control) you can monitor your system and connections in Kali, using the build in WireShark.

Here are the steps for Knoppix, directly from USB Drive or (micro)-SD Card.

In case of a system failure you can use this USB Drive to boot up (almost) any machine as to manage your open positions.

It works out of the box with mobile modems in case your local connection drops.

Security is important if you take trading seriously.

Anyway here are the steps.

That's it !

In case you wonder about the USB drive itself just download the Knoppix ISO (currently 7.6.1) and burn it to your USB drive with UnetBootin.


If you are not sure just don't do it and ask someone who knows how to do it.

If that's done you can boot your system from the USB Drive and set up your trading environment following the steps above.

And you will be able to take your personal trading environment with you, anywhere you go.

Why does EA fail on Linux systems?
simone559 | 9 Jun 2021 at 15:27

Good day,

Can anyone please help me, i have tried all that i know and then some more, i have installed wine on my linux 18.04, but when i try to install MT4 or MT5 nothing happens, i right click and open with Wine the cursor just loads for a while then stops, no pop up nothing, but it seems all other App's work fine, i can install them via wine, its just Metatrader thats giving issues, i would appreciate the help thanks

MetaTrader 4 Expert Advisor exchanges information with the outside world MetaTrader 4 Expert Advisor exchanges information with the outside world
A simple, universal and reliable solution of information exchange between МetaТrader 4 Expert Advisor and the outside world. Suppliers and consumers of the information can be located on different computers, the connection is performed through the global IP addresses.
An Insight Into Accumulation/Distribution And Where It Can Get You An Insight Into Accumulation/Distribution And Where It Can Get You
The Accumulation/Distribution (A/D) Indicator has one interesting feature - a breakout of the trend line plotted in this indicator chart suggests, with a certain degree of probability, a forthcoming breakout of the trend line in the price chart. This article will be useful and interesting for those who are new to programming in MQL4. Having this in view, I have tried to present the information in an easy to grasp manner and use the simplest code structures.
The Random Sandbox The Random Sandbox
The article includes an interactive "sandbox" as an Excel file which simulates randomized Expert Advisor backtest data. Readers can use this to help explore and more deeply understand the EA performance metrics offered by default with MetaTrader. The text of the article is designed to guide the user through this experience.
MetaTrader 4 on Mac OS MetaTrader 4 on Mac OS
Apple products have become very popular. MetaQuotes Software Corp. attentively follows the progress of the IT industry and has already released the special mobile applications for iOS-based devices - MetaTrader 4 for iPhone and MetaTrader 5 for iPhone.There are many topics on the forum, where people are seeking a solution for running MetaTrader 4 under the Mac OS operating system. In this article, you will find out how to work in MetaTrader 4 via the Apple's popular operating system.