How do I run XMRig from the command line with a wallet and pool?
You run XMRig from the command line by giving it your mining pool’s address and your Monero wallet address. The pool tells your computer what mining work to do, and your wallet address tells the pool where to credit your earnings.
Get your pool and wallet details ready
XMRig is a mining program you install and run on your computer. It is not a browser miner, so these commands belong in a terminal or command prompt, not your browser’s address bar.
Before you start, you need:
- XMRig: Get it from the official project release source. Avoid repackaged downloads that promise extra earnings.
- Your public Monero wallet address: Copy the receiving address from your wallet. Never enter your wallet’s recovery words, private keys, or spending password into XMRig.
- A pool hostname and port: A pool combines miners’ work and shares rewards. Its setup page should list the server name and connection port.
- The pool’s connection rules: Check whether it requires encryption, a particular password value, or a specific wallet-address type.
Only mine on computers you own or have explicit permission to use.
Run the command for your system
Open a terminal inside the folder containing XMRig. Replace the example hostname, port, and wallet placeholder below with your actual details.
Windows PowerShell:
.\xmrig.exe -o pool.example:3333 -u YOUR_XMR_WALLET_ADDRESS -p x -a rx/0
Linux or macOS:
./xmrig -o pool.example:3333 -u YOUR_XMR_WALLET_ADDRESS -p x -a rx/0
Here is what each part means:
-osets the pool hostname and port, separated by a colon.-usets the username. For many Monero pools, this is your public wallet address.-p xsupplies a placeholder pool password. Use a different value if your pool’s instructions require one.-a rx/0selects RandomX, the mining algorithm—the set of calculations—used by Monero.
For Windows Command Prompt rather than PowerShell, you can use xmrig.exe without the initial .\.
For this simple setup, start in a folder without an old config.json configuration file. XMRig can load settings from that file too, which may introduce pool entries or other settings you did not intend.
Add encryption and an optional worker name
If your pool provides a TLS port, add --tls and use that specific port. TLS encrypts the connection between your miner and the pool.
For example, on Linux or macOS:
./xmrig -o pool.example:443 -u YOUR_XMR_WALLET_ADDRESS -p x -a rx/0 --tls --rig-id home-pc
Here, 443 is only an example. Use the port your pool actually lists for TLS.
--rig-id home-pc gives your computer a worker name so you can identify it. Not every pool supports this option; some require a worker name in the username or password instead. Follow your pool’s exact format.
Check that mining works and stop safely
After starting, look for a successful pool connection, new mining jobs, and eventually accepted shares. A share is a submitted piece of work that the pool uses to measure your contribution. It is not an immediate wallet payment.
If something fails:
- Connection error: Check the hostname, port, internet connection, and TLS setting.
- Login rejected: Recheck your wallet address and the pool’s username/password format.
- No payout yet: Check the pool’s payment schedule and minimum payout.
Watch temperature and power use. Press Ctrl+C to stop XMRig.
The bottom line
Start with -o for your pool and -u for your wallet, then match the pool’s password and TLS requirements. Accepted shares confirm useful submissions; actual payments depend on the pool’s payout rules.
