How to Install XMRig on Ubuntu or Debian

XMRig is a program for mining various cryptocurrencies, one of which is Monero. It is very important to keep XMRig up to date in order to support the latest algorithms implemented by the mined coins.

Actually all users can directly use the XMRig that has been installed compile. But you can also compile or install it independently to make sure the XMRig program you use is safe.

Either on Windows or Linux, you can do a manual installation. And this article will share the procedures for install XMRig on Ubuntu and Debian Linux OS in detail according to your needs in adding crypto coins.

Installing XMRig on Ubuntu and Debian

If on Windows the compilation process must be done with Visual Studio, while on Linux, you can do it from the Terminal only. Of course, this requires several programs installed for the needs of the compile process later.

First of all, please install some required programs. Here is the command:

sudo apt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev -y

Next download XMRig from Github via GIT.

git clone https://github.com/xmrig/xmrig.git

Then go to the directory xmrig and create a new folder named build to put the compiled results later.

cd xmrig && mkdir build && cd build

Now is the preparation to compile the XMRig program using the CMAKE command.

cmake ..

And the last stage is the XMRig compilation process.

make

Wait for the process to complete, this will only take a moment and the results will appear in the build directory that was created.

Some Additional CMAKE Options

Here are some additional CMAKE options that you can use for set up XMRig before compiling:

  • -DWITH_LIBCPUID=OFF Disable libcpuid.
  • -DWITH_AEON=OFF Disabling the CryptoNight-Lite algorithm and all similar variants.
  • -DWITH_SUMO=OFF Disabling the CryptoNight-Heavy algorithm and all similar variants.
  • -DWITH_CN_GPU=OFF Disabling the CryptoNight-GPU algorithm.
  • -DWITH_HTTPD=OFF Disable API and HTTP Server.
  • -DWITH_DEBUG_LOG=ON Enable LOG for Debugging purposes.
  • -DWITH_TLS=OFF Disable SSL/TLS support.
  • -DWITH_ASM=OFF Disables Assembly Language support.
  • -DWITH_EMBEDDED_CONFIG=ON Enable internal JSON configuration.
  • -DBUILD_STATIC=ON Add flag --static by default.
  • -DWITH_HWLOC=OFF Disabled HWLOC support.

For example here I want to compile XMRig by disabling CryptoNight-GPU and HTTP Server. So the CMAKE configuration will be like this.

cmake .. -DWITH_CN_GPU=OFF -DWITH_HTTPD=OFF

Well after that, just continue using the command make to start the compilation process.

Also read: XMRig Proxy Installation Tutorial on Ubuntu

Setting up the XMRig JSON Configuration

Once XMRig is created, it won’t be able to open right away like xmr-stack, because later a notification will appear that there is no saved configuration. And the configuration in question is the file config.json which should be in the same directory where the XMRig is.

To make the configuration. Please use the features Configuration Wizard which has been provided by XMRig.

After getting the configuration, just save it on the file config.json and now try to open XMRig, surely the program can be used to mine perfectly.

Hopefully useful and good luck