How to setup xmrig pool mining on Debian Linux VPS

This article will show you how to install and run xmrig and setup pool mining on Debian 8 VPS. You can also opt for Ubuntu 16 using this tutorial.

Requirements

VPS
Mining Pool

Cryptocurrency Supported

  • Aeon
  • BBSCoin
  • Croat
  • Edollar
  • Electroneum
  • Graft
  • Haven
  • Intense
  • Karbo
  • Monero
  • MoneroV
  • Stellite
  • Sumokoin
  • Turtlecoin

Please note that this is not an endorsement nor a complete list.

Installation Steps

Prep the system

Assuming you already have built a Debian 8 / Ubuntu 16 instance

1. cd ~; sudo apt-get update && sudo apt-get --assume-yes install software-properties-common libmicrohttpd-dev libuv1-dev libssl-dev cmake build-essential libhwloc-dev screen git nano

Setup Huge Pages

2. sysctl -w vm.nr_hugepages=128; sudo nano /etc/sysctl.conf

At the end of the file add:

vm.nr_hugepages=128

Save and exit [ctrl][x].

Install the needed compilers

3. sudo echo -ne '\n' | sudo add-apt-repository ppa:jonathonf/gcc-7.1
4. sudo apt-get update && sudo apt-get install gcc-7 g++-7 -y

Download xmrig

5.a sudo git clone https://github.com/xmrig/xmrig.git
5.b sudo mkdir xmrig/build && cd xmrig/build
5.c sudo cmake .. -DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7 -DWITH_HTTPD=OFF && sudo make

Edit configuration according to your needs:

5.d nano config.json

Save and exit [ctrl][x].

5.e ./xmrig

The miner will run after successful configuration; Press [ctrl][c] to exit because we will have to make it run as a daemon.

Create service

6. nano /lib/systemd/system/mine.service

Paste this code

[Unit]
Description=mine
After=network.target
[Service]
ExecStart=/root/xmrig/build/xmrig -c /root/xmrig/build/config.json
User=root
[Install]
WantedBy=multi-user.target

Save and exit [ctrl][x].

Activate service

7. sudo systemctl daemon-reload && sudo systemctl enable mine.service
8. sudo systemctl restart mine.service && service mine status

Status check

9. service mine status

You should see something like

Active: active (running).

Congratulations, you now have a 24/7 miner!

Note: On some systems, systemd is not available. You will have to use nohup ./xmrig to run xmrig as a background process.

Note #2: In the event you want to change the pool address and wallet address, just nano config.json and edit the corresponding field. [ctrl][x] to save and exit; You will have to repeat steps 7 to 8 to activate changes.

You can check your earnings on your selected mining pool website.

Like this post? Consider donating!

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.