How do I install XMRig on Ubuntu or Debian?
You can install XMRig on Ubuntu or Debian by installing its build tools, downloading the official source code, and compiling it into a program you can run. Then you start it with your Monero wallet address and mining pool details; XMRig runs in your terminal, not in your browser.
Install the required packages
Use a computer you own or have clear permission to mine on. Mining keeps your processor busy, so check that its cooling works and consider electricity costs before starting.
Open Terminal and run:
sudo apt update
sudo apt install build-essential cmake libuv1-dev libssl-dev libhwloc-dev
These packages provide the compiler and supporting libraries XMRig needs. A compiler turns source code—the human-readable instructions for a program—into software your computer can run.
sudo gives these installation commands administrator permission. You do not need to run every later command with it.
Download and build XMRig
Go to the official XMRig project on GitHub and open its releases page. Download the source archive for the latest stable release, rather than an unofficial installer or a “boosted earnings” version.
Extract the archive using your file manager. Open the extracted folder, then right-click inside it and choose Open in Terminal, if your desktop offers that option. You should be in the folder containing CMakeLists.txt.
Run:
cmake -S . -B build
cmake --build build -j2
The first command prepares the build. The second compiles XMRig, using two parallel tasks to keep memory demands modest.
When it finishes, check the program:
./build/xmrig --version
You can run XMRig from this folder. There is no need to copy it into system directories or use sudo make install.
If configuration reports a missing library, check that the package installation above completed successfully.
Connect to a Monero mining pool
A mining pool combines miners’ work and shares rewards according to its rules. Before connecting, get:
- Your public Monero receiving address from your wallet.
- The pool’s server name and port number.
- Its minimum payout, fees, and connection instructions.
Never give XMRig or a pool your wallet’s recovery words or private keys. Your public receiving address is enough.
Replace the placeholders below with your actual details:
./build/xmrig \
-o POOL_HOST:PORT \
-u YOUR_XMR_WALLET_ADDRESS \
--coin monero
If the pool requires an encrypted connection, add --tls and use its designated TLS port. Follow its instructions for any worker name or password setting.
Check that mining works
Look for accepted shares in the terminal. A share is a piece of mining work your pool accepts; it is not an immediate wallet payment. Payments depend on the pool’s payout rules.
Keep these points in mind:
- Monero uses RandomX, a mining method designed to favor CPUs.
- Fast-mode RandomX needs roughly 2 GB for its dataset, plus additional memory.
- Huge-page warnings usually concern performance, not a failed installation. Huge pages are larger memory blocks that can improve mining speed.
- Standard XMRig builds include a default 1% developer donation.
- Watch temperatures and responsiveness. Press Ctrl+C to stop.
Start without administrator privileges. Do not run an unfamiliar optimization script just to remove warnings.
The bottom line
Build the official source, connect with your public wallet address, and confirm accepted shares. Before running continuously, compare your electricity costs with a live mining calculator; installing successfully does not guarantee a profit.
