A Docker container setup for mining Monero (XMR) using XMRig. This repository provides a simple Docker and Docker Compose setup to facilitate a fast and efficient mining experience.
- Docker
- Docker Compose
-
Pull the Docker image:
docker pull ghcr.io/jonas-merkle/container-xmr-mining:latest
-
Run the Docker container:
docker run -d --name xmr-miner -v $(pwd)/config:/miner-config:ro ghcr.io/jonas-merkle/container-xmr-mining:latest
-
Clone the repository:
git clone https://github.com/jonas-merkle/container-xmr-mining.git cd container-xmr-mining
-
Copy the demo configuration file:
cp ./config/config_demo.json ./config/config.json
-
Edit the
config.json
file to suit your needs:nano ./config/config.json
-
Start the Docker Compose setup:
docker-compose up -d
The XMRig tool must be configured before the first run. Follow these steps to set up the tool:
-
Copy the Demo Configuration File:
cp ./config/config_demo.json ./config/config.json
-
Edit the Configuration File: Open the
config.json
file in your preferred text editor:nano ./config/config.json
-
Essential Configuration Settings:
-
Pool Information:
"url": "pool.minexmr.com:4444"
-
Wallet Address:
"user": "YOUR_WALLET_ADDRESS"
-
-
Advanced Configuration Options:
-
Worker ID (Optional):
"rig-id": "my-miner-01"
-
Algorithm Selection:
"algo": "rx/0"
-
Threads Configuration:
"threads": 4
-
Background Mode:
"background": true
-
Max CPU Usage:
"max-cpu-usage": 75
-
Donate Level:
"donate-level": 1
-
-
Logging and Monitoring:
-
Log File:
"log-file": "/miner-config/xmrig.log"
-
Print Time Interval:
"print-time": 60
-
-
Tuning for Optimal Performance:
-
Huge Pages:
"huge-pages": true
-
Affinity:
"cpu-affinity": [0, 2, 4, 6]
-
For more detailed information on configuring XMRig, refer to the XMRig Configuration Guide. Configuration
The XMRig tool must be configured before the first run. Have a look at the short documentation on how to set up the tool.
-
Ensure Docker and Docker Compose are installed on your system.
-
Clone the repository and navigate to the project directory:
git clone https://github.com/jonas-merkle/container-xmr-mining.git cd container-xmr-mining
-
Copy and edit the configuration file:
cp ./config/config_demo.json ./config/config.json nano ./config/config.json
-
Start the Docker Compose setup:
docker-compose up -d
-
Check the logs to ensure the miner is running correctly:
docker-compose logs -f
- Environment Variables: Ensure that
.env
files are not shared or tracked in version control, as they may contain sensitive information such as API tokens or credentials. - Sensitive Files: Always keep sensitive files like
.env
secure and ensure they are not exposed publicly.
This project is licensed under the GNU Lesser General Public License v3.0 (LGPLv3). It is distributed "as is", without warranty of any kind. You are free to use, modify, and distribute this software under the terms specified in the LGPLv3.
See the LICENSE file for more detailed information.