To do this you should have some basic knowledge about Linux and cryptocurrencies / mining. This method is tested on Debian 12.
Compiling XMRig
- Install build-tools:
- Clone the official git repository:
- Navigate into the repository and create a build directory, then navigate into it:
- Read the "CMakeLists.txt" from repository, generate build-scripts:
- Compile XMRig:
$ sudo apt install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev -y
$ https://github.com/xmrig/xmrig.git
$ cd xmrig && mkdir build && cd build
$ cmake ..
$ make -j$(nproc)
Configuring XMRig
After compiling XMRig, you should write or generate a configuration file. You can generate one on xmrig.com/wizard. This is where you specify what pool you want to mine in, if you are using CUDA, OpenCL, or are using CPU only. Monero mining works good with CPU-Only setups, because is uses the RandomX algorithm. This PoW algorithm is ASIC resistant, which means it is impossible to build specialized hardware to mine Monero: Miners must use consumer-grade hardware and compete fairly. Monero can be mined by both CPUs and GPUs, but the former is much more efficient.
- Place your configuration file in the right location: xmrig/build/
- Start mining:
- (Optional) Configure systemd service or tmux session: If you want to keep your miner running constantly, it might be useful to do that, so the mining can happen in the background and continue automatically after a reboot.
- Check your balance: Depending on the mining pool you are using, you can check your due balance & paid balance on a website.
$ ./xmrig