XMRig Setup Tutorial: Windows and Linux Guide 2026
XMRig Setup Tutorial: Windows and Linux Guide 2026
If you have ever wondered why a single optimized desktop CPU can quietly contribute to one of the most decentralized blockchains in existence, the answer has a name: XMRig. As of early 2026, more than 78% of all Monero network hashrate measured by P2Pool blocks comes from XMRig instances, and the share rises closer to 90% once solo miners and small pool participants are counted. Unlike GPU-dominated chains, Monero's RandomX proof-of-work was engineered so that consumer-grade processors stay competitive, and XMRig is the open-source miner that turns that design choice into actual mining rewards.
This guide walks through a clean, end-to-end XMRig setup on both Windows 10/11 and modern Linux distributions, from downloading the verified binary to tuning hugepages, MSR registers, and pool failover. The goal is not just to get the miner running, but to extract every reasonable hash per second your hardware can sustain without thermal throttling. Once those XMR rewards land in your wallet, you will also see how to swap them safely on MoneroSwapper if you need to convert a portion to another asset while preserving the privacy that made Monero worth mining in the first place.
Why XMRig Remains the Default Monero Miner in 2026
XMRig is a high-performance, cross-platform RandomX miner first released in 2017 and continuously maintained on GitHub by xmrig and a community of contributors. It supports CPU, OpenCL, and CUDA backends, but for Monero specifically the CPU backend is what matters — RandomX was deliberately tuned to favor general-purpose processors with large caches over specialized hardware. Five technical reasons keep XMRig at the top of the stack:
- Native RandomX implementation: the miner ships with a hand-optimized RandomX VM that uses AES-NI, SSE4.1, and AVX2 where available, plus a JIT compiler that translates RandomX programs into machine code on the fly.
- Huge pages support on every major OS: 2 MB and 1 GB pages dramatically reduce TLB misses during the dataset access phase, which is where most consumer CPUs lose 15–30% of their theoretical hashrate without proper configuration.
- MSR mod for AMD and Intel: on Ryzen and recent Core CPUs, XMRig can write model-specific registers to disable hardware prefetchers that hurt RandomX performance, adding 10–25% on Zen 3/Zen 4 silicon.
- First-class P2Pool support: the miner integrates cleanly with P2Pool, the decentralized Monero mining pool that pays in onchain XMR every few hours without a centralized payout operator.
- Active security review: binaries are reproducible, releases are signed, and the project publishes SHA-256 hashes for every artifact — essential because malicious miners that silently swap wallet addresses are a real threat in this space.
None of these features are unique on paper, but no competing miner combines them at the same level of polish. SRBMiner-Multi and Teamredminer focus on other algorithms; xmr-stak has been unmaintained for years; closed-source miners introduce trust assumptions that defeat the point of running your own node.
Hardware Requirements and Realistic Hashrate Expectations
RandomX is memory-hard. The full dataset is 2080 MB in fast mode, which means you need at least 4 GB of RAM available to the miner per NUMA node, and ideally fast DDR4-3600 or DDR5-6000 memory. CPU choice matters less than people assume; what matters is L3 cache size, memory bandwidth, and the number of physical cores capable of running one RandomX thread each.
What you can realistically expect per chip
| CPU | Threads (RandomX) | Hashrate (kH/s) | Power (W, stock) |
|---|---|---|---|
| AMD Ryzen 9 7950X | 16 | 22–25 | 140–170 |
| AMD Ryzen 9 9950X | 16 | 26–30 | 150–180 |
| AMD EPYC 7763 (64c) | 64 | 44–48 | 240–280 |
| Intel Core i9-14900K | 8 P-cores | 13–15 | 120–150 |
| Intel Xeon w7-3465X | 28 | 30–34 | 250–290 |
| Apple M2 Pro | 10–12 | 8–11 | 30–45 |
These numbers assume hugepages are enabled, MSR mod is active where supported, and the CPU is not thermally throttling. A laptop running XMRig on battery will give you maybe 30–40% of the figures above and shorten the lifespan of the device — mining belongs on a desktop, workstation, or dedicated server with proper airflow.
XMRig Setup on Windows 10 and Windows 11
Windows is the easier of the two paths because the official release ships as a pre-built ZIP with everything needed. The trade-off is that Windows Defender and most third-party antivirus tools flag any cryptocurrency miner as a potentially unwanted program, so you will need to whitelist the directory explicitly. This is normal and not a sign of malware, but it means you should always verify the SHA-256 hash before adding any exception.
- Download the verified binary. Go to the official xmrig GitHub releases page and pick the latest
xmrig-X.Y.Z-msvc-win64.zip. Download the matchingSHA256SUMSfile. In PowerShell runGet-FileHash xmrig-X.Y.Z-msvc-win64.zip -Algorithm SHA256and confirm the output matches the published hash. - Extract to a permanent path. Unzip to something like
C:\xmrig, not the Downloads folder. Right-click the folder, choose Properties → Security, and confirm your user account has Read & Execute. Avoid spaces in the path to keep batch scripts simple. - Add the Defender exclusion. Open Windows Security → Virus & threat protection → Manage settings → Exclusions, and add the folder
C:\xmrig. Without this, Defender will quarantine the executable within minutes of the first run. - Enable huge pages and lock-pages-in-memory. Open
secpol.msc, navigate to Local Policies → User Rights Assignment → Lock pages in memory, and add your username. Log out and back in for the change to take effect. XMRig will then request 1280 huge pages of 2 MB each at startup automatically. - Edit
config.json. Set"randomx"options:"init": -1(auto-detect),"mode": "fast","1gb-pages": trueif you have at least 4 GB free contiguous RAM. Add your pool URL (more on this below) and wallet address. Set"donate-level": 1as the project minimum. - Run elevated the first time. Right-click
xmrig.exe→ Run as administrator so it can apply MSR mod on the first launch. Subsequent runs from a standard prompt will work because the MSR values persist until reboot. - Confirm the startup banner. You should see
HUGE PAGES: 1280/1280 (100%),MSR REGISTER VALUES applied, andREADY threads N/N. If huge pages show less than 100%, close memory-heavy applications and restart.
If your antivirus keeps re-quarantining xmrig.exe even after exclusion, your software is probably running heuristic scans on extracted ZIPs — disable real-time scanning only for the xmrig folder, never globally, and never download miners from anywhere except the official GitHub releases page.
XMRig Setup on Linux (Ubuntu, Debian, Fedora, Arch)
On Linux you have two clean options: install the distribution package if it exists and is recent, or compile from source. The distribution route is faster but often lags two or three releases behind, which matters because each XMRig release can add 1–5% hashrate on new silicon. For serious miners, compiling is worth the extra fifteen minutes.
Option A: distribution package (fastest)
On Ubuntu 24.04 LTS and Debian 12: sudo apt update && sudo apt install xmrig. On Fedora 41+: sudo dnf install xmrig. On Arch and Manjaro: sudo pacman -S xmrig. Verify the installed version with xmrig --version and check it against the latest GitHub release before relying on the package.
Option B: compile from source
- Install build dependencies. On Debian-based systems:
sudo apt install git build-essential cmake automake libtool autoconf libhwloc-dev libuv1-dev libssl-dev. On Fedora swap apt for dnf and the package names follow the same pattern with-develsuffixes. - Clone the repository.
git clone https://github.com/xmrig/xmrig.git && cd xmrig. Check out the latest stable tag withgit checkout v6.22.x(substitute the current release number). - Build the dependency bundle.
cd scripts && ./build_deps.sh && cd ... This compiles OpenSSL, hwloc, and libuv as static libraries inside the source tree so the resulting binary is portable across distributions of the same architecture. - Configure and compile.
mkdir build && cd build && cmake .. -DXMRIG_DEPS=$(pwd)/../scripts/deps && make -j$(nproc). On a modern CPU this completes in 3–5 minutes. - Enable hugepages persistently. Add
vm.nr_hugepages=1280to/etc/sysctl.confand runsudo sysctl -p. For 1 GB pages addhugepagesz=1G hugepages=3to the kernel command line via GRUB and reboot. - Load the MSR module. Run
sudo modprobe msr, then start XMRig withsudo ./xmrigat least once so it can write the MSR values. After that, you can start it as an unprivileged user — the MSR writes persist until reboot or until another tool overwrites them. - Create a systemd service for unattended mining. Drop a unit file in
/etc/systemd/system/xmrig.servicewithUser=miner,AmbientCapabilities=CAP_SYS_NICE CAP_IPC_LOCK, andExecStart=/usr/local/bin/xmrig --config=/etc/xmrig/config.json. Runsudo systemctl enable --now xmrig.
The CAP_SYS_NICE capability lets XMRig set thread priority without running as root, and CAP_IPC_LOCK allows huge-page reservation. This is the cleanest production deployment pattern and avoids handing the miner full root privileges.
Choosing a Pool and Configuring the Miner
Solo mining Monero with a single desktop CPU produces, on average, less than one block per CPU per decade — statistically you will quit before earning anything. Pools aggregate hashrate from thousands of miners and pay each in proportion to contributed work. There are two philosophies: centralized pools and the decentralized P2Pool.
| Option | Pros | Cons |
|---|---|---|
| P2Pool (recommended) | No central operator, payouts directly onchain, no minimum, sidechain rewards every ~10 seconds | Requires running a Monero node + p2pool daemon locally |
| SupportXMR | Zero-config, low minimum payout (0.004 XMR), well-maintained dashboard | Centralized — operator could in theory withhold rewards or run away |
| MoneroOcean | Auto-switches between RandomX coins for higher fiat yield | Pays in XMR but mines other algos under the hood; reduces network decentralization for Monero specifically |
| Nanopool | Long-running, stable, geographically distributed servers | Centralized; 1% fee is higher than P2Pool's 0% |
For anyone serious about the protocol, P2Pool is the right answer. It preserves Monero's decentralization by ensuring that no single pool ever approaches 51% of network hashrate, and the only operational cost is roughly 100 GB of disk for a pruned node plus 6 GB of RAM. The configuration for XMRig pointing at a local P2Pool instance is essentially: "url": "127.0.0.1:3333", "user": "your-primary-address", "rig-id": "desktop-01", "keepalive": true, "tls": false (since the connection is loopback).
If you absolutely cannot run a node — for example because you mine from a laptop on a metered connection — pick a centralized pool with TLS enabled ("tls": true), set the URL to the pool's stratum+ssl endpoint, and configure failover pools as an array so that XMRig automatically switches if the primary becomes unreachable. Never use a pool that does not support TLS in 2026; plain stratum exposes your wallet address to anyone on the network path.
Performance Tuning and Common Pitfalls
A correctly tuned XMRig instance on a Ryzen 9 7950X should hit 22–25 kH/s. If yours produces 12–15 kH/s, one or more of the following is wrong, in order of frequency observed in the wild during the past year.
- Huge pages partial allocation: the startup banner shows something like 740/1280. Reboot, close everything else, and try again. On Linux check
cat /proc/meminfo | grep Huge. - MSR mod not applied: on Windows, run XMRig as administrator at least once per boot. On Linux ensure
modprobe msrran and the first XMRig launch had CAP_SYS_RAWIO or root. - Thermal throttling: RandomX is hot. A CPU that runs Cinebench at 95 °C will throttle within five minutes of mining and lose 20% hashrate. Improve case airflow, undervolt, or set
"max-threads-hint": 75to leave headroom. - Wrong thread count: XMRig defaults to one thread per physical core. On Intel hybrid chips (12th gen+) disable E-cores in BIOS or pin XMRig to P-cores only using affinity settings — E-cores hurt RandomX because they share L2 with P-cores.
- SMT/Hyper-Threading enabled but not configured: on AMD Zen 3/Zen 4, SMT can help slightly (≈3–5%) if you also tune cache affinity. On Intel, leave it disabled for mining.
- Background processes: a Chrome window with 40 tabs eats 6 GB of RAM and steals memory bandwidth. Run mining rigs as dedicated boxes or at least close everything before benchmarking.
Once tuning is complete, let the miner run for at least 30 minutes before reading the steady-state hashrate. The 60-second figure XMRig shows in the console fluctuates by 5–10% because of RandomX dataset access patterns; the 15-minute average is what you should report and what the pool will actually credit.
Securing Rewards: From Mined XMR to Spendable Privacy
Mining payouts arrive at the Monero address you configured in config.json. Best practice is to use a fresh subaddress generated specifically for mining rather than your primary address — even though Monero hides amounts and recipients onchain, separating mining subaddresses from spending subaddresses keeps your local wallet tidy and makes accounting easier if you ever need to file taxes in a jurisdiction that taxes mining income.
Three more security habits worth building from day one. First, run your wallet on an air-gapped or at least dedicated machine that does not host the miner — a compromised mining host should not have the spend key. Second, back up the 25-word mnemonic seed offline; the polyseed format used by recent CLI and GUI wallets is shorter and includes a birthday hint that simplifies recovery. Third, periodically sweep mining subaddresses into a different wallet through a churning transaction or by using an atomic swap to BTC and back — this hardens fungibility properties against statistical analysis that a hypothetical adversary could attempt across years of accumulated payouts.
When you eventually want to convert part of your mining yield to a different asset — say, a stablecoin to pay a hosting bill, or BTC to top up a Lightning channel — using a non-custodial swap service preserves the privacy advantages you earned with all that hashing work. MoneroSwapper aggregates rates across multiple no-KYC exchanges and pays out in a single transaction so the on-chain footprint stays small. The whole flow from XMRig payout to swapped destination asset can run in under fifteen minutes without ever creating an account or uploading identification documents.
FAQ
Is XMRig safe to install, or is it really malware?
XMRig itself is legitimate open-source software with a public source repository, signed releases, and reproducible builds. Antivirus products flag it because the exact same binary is also commonly bundled with browser hijackers and trojans that mine without consent. As long as you download from the official GitHub releases page and verify the SHA-256 hash, you are running clean code. Most security incidents involving XMRig trace back to pirated software or unverified mirrors, not the project itself.
Can I mine Monero on a laptop?
Technically yes, practically no. RandomX will sustain 100% CPU usage and push laptop cooling systems to their limit, shortening fan lifespan and risking thermal damage to the battery. You will also see roughly 30–40% of desktop hashrate per equivalent CPU because of lower sustained power limits. If you must mine on a laptop, plug it into AC, elevate the back for airflow, and limit XMRig to 50% threads with "max-threads-hint": 50.
How much can I realistically earn per month?
At April 2026 difficulty around 410 GH and the XMR price hovering in the low triple digits USD, a Ryzen 9 7950X producing 24 kH/s earns roughly 0.04–0.05 XMR per month before electricity. At a typical European electricity price of €0.28/kWh and 150 W draw, you spend about €30 in power to earn a similar amount in XMR — meaning solo desktop mining in 2026 is more about supporting the network than about profit. AMD EPYC servers in low-electricity regions still produce modest profit.
What is the difference between P2Pool and a regular pool?
A regular pool runs a centralized stratum server and database that tracks shares and pays out from a hot wallet on a schedule. If the operator vanishes, your unpaid balance vanishes with them. P2Pool is a sidechain: every share is a tiny block on a peer-to-peer chain that pays out atomically with each Monero mainnet block its miners find. There is no operator, no minimum payout, and no possibility of the pool stealing rewards. The trade-off is that you must run a Monero node and a p2pool daemon locally.
Does XMRig support GPU mining for Monero?
XMRig has CUDA and OpenCL backends, but RandomX on GPUs is significantly less efficient than on CPUs — typically a high-end GPU produces less hashrate per watt than a midrange CPU. Most miners disable the GPU backends entirely when mining Monero. The GPU code is useful for other algorithms supported by XMRig, but for XMR specifically, stick to CPU mining where the algorithm was designed to be competitive.
Will my ISP or VPS provider ban me for running XMRig?
Residential ISPs almost never detect or care about mining traffic, which looks like ordinary outbound TCP to port 3333 or 443 with TLS. VPS providers, on the other hand, often explicitly forbid mining in their terms of service because of the sustained CPU load — DigitalOcean, Linode, and AWS will suspend instances they detect mining on. Dedicated server providers like Hetzner and OVH allow it on bare-metal plans but not on shared cloud products. Read the AUP before deploying.
Conclusion
Setting up XMRig is a one-time investment of about an hour that turns idle CPU cycles into one of the few remaining truly decentralized cryptocurrency operations. The technical steps — verified download, huge pages, MSR mod, P2Pool configuration, systemd service on Linux or scheduled task on Windows — are well-trodden and stable enough that the same configuration will keep working through the next several XMRig releases. Tune once, run forever, and check in monthly to update the binary and review payouts.
The harder questions are operational: which pool philosophy you trust, how you secure the wallet that receives rewards, and how you eventually convert mined XMR back to other assets without leaking the privacy you spent kilowatt-hours producing. When that conversion moment arrives, MoneroSwapper offers a no-account, no-KYC route from your mining subaddress to whichever destination chain you need, keeping the entire pipeline aligned with the privacy guarantees that made Monero worth mining in the first place. Run the miner, support the network, and keep your funds yours — on your hardware, on your terms.
🌍 Read in