Skip to content

jonas-merkle/container-xmr-mining

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

container-xmr-mining

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.

Table of Contents

Requirements

  • Docker
  • Docker Compose

Setup

Using only the Docker image

  1. Pull the Docker image:

    docker pull ghcr.io/jonas-merkle/container-xmr-mining:latest
  2. Run the Docker container:

    docker run -d --name xmr-miner -v $(pwd)/config:/miner-config:ro ghcr.io/jonas-merkle/container-xmr-mining:latest

Using Docker Compose

  1. Clone the repository:

    git clone https://github.com/jonas-merkle/container-xmr-mining.git
    cd container-xmr-mining
  2. Copy the demo configuration file:

    cp ./config/config_demo.json ./config/config.json
  3. Edit the config.json file to suit your needs:

    nano ./config/config.json
  4. Start the Docker Compose setup:

    docker-compose up -d

Configuration

The XMRig tool must be configured before the first run. Follow these steps to set up the tool:

  1. Copy the Demo Configuration File:

    cp ./config/config_demo.json ./config/config.json
  2. Edit the Configuration File: Open the config.json file in your preferred text editor:

    nano ./config/config.json
  3. Essential Configuration Settings:

    • Pool Information:

      "url": "pool.minexmr.com:4444"
    • Wallet Address:

      "user": "YOUR_WALLET_ADDRESS"
  4. 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
  5. Logging and Monitoring:

    • Log File:

      "log-file": "/miner-config/xmrig.log"
    • Print Time Interval:

      "print-time": 60
  6. 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.

Running the Project

  1. Ensure Docker and Docker Compose are installed on your system.

  2. Clone the repository and navigate to the project directory:

    git clone https://github.com/jonas-merkle/container-xmr-mining.git
    cd container-xmr-mining
  3. Copy and edit the configuration file:

    cp ./config/config_demo.json ./config/config.json
    nano ./config/config.json
  4. Start the Docker Compose setup:

    docker-compose up -d
  5. Check the logs to ensure the miner is running correctly:

    docker-compose logs -f

Security Notes

  • 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.

License

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.