Skip to main content

Install and Configure xmrig for Monero XMR Crypto Mining

Create a directory for xmrig under /opt:

mkdir /opt/xmrig

Download attached xmrig-linux.zip  and extract to the /opt/xmrig directory you created above:

unzip xmrig-linux.zip -d /opt/xmrig

Edit /opt/xmrig/config.json file and under the following section:

"pools": [
{
"algo": null,
"coin": null,
"url": "xmr.pool.minergate.com:45700",
"user": "12345678",
"pass": "x",
"rig-id": null,
"nicehash": false,
"keepalive": false,
"enabled": true,
"tls": false,
"tls-fingerprint": null,
"daemon": false,
"socks5": null,
"self-select": null
}
],

set the 123456 in the "user": "12345678"  section to your Minergate.com UserID.

Make /opt/xmrig/xmrig executable:

chmod +x /opt/xmrig/xmrig

Move the xmrig.service file that was included in the xmrig-linux.zip file to /etc/systemd/system:

mv /opt/xmrig/xmrig.service /etc/systemd/system/

Create a user for xmrig:

sudo adduser xmrig

Set a password for the user and answer the resultant prompts

Enable the xmrig service:

sudo systemctl enable --now xmrig

Start the xmrig service:

sudo systemctl restart xmrig

Ensure xmrig service has started:

systemctl status xmrig

If the service is started, the output should be similar to below:

● xmrig.service - XMRig Monero Miner
   Loaded: loaded (/etc/systemd/system/xmrig.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-02-19 21:17:30 UTC; 11min ago
 Main PID: 7516 (xmrig)
    Tasks: 14 (limit: 4915)
   CGroup: /system.slice/xmrig.service
           └─7516 /opt/xmrig/xmrig --config=/opt/xmrig/config.json --log-file=/opt/xmrig/xmrig.log

View xmrig service logs:

journalctl -u xmrig