Getting started with NiceHash Docker Miner image
To get started, ensure you have a NiceHash Mining Address and a system equipped with an AMD or NVIDIA Graphics Card. The installation is as easy as running two simple commands:
NVIDIA Example:
$ docker pull dockerhubnh/nicehash:latest
$ docker run -it --rm --env MINING_ADDRESS="mining-address" --env MINING_WORKER_NAME="worker-name" --gpus=all dockerhubnh/nicehash:latest
AMD Example:
$ docker pull dockerhubnh/nicehash:latest
$ docker run -it --rm --env MINING_ADDRESS="mining-address" --env MINING_WORKER_NAME="worker-name" --device=/dev/kfd --device=/dev/dri dockerhubnh/nicehash:latest
Additional notes for executing the commands:
--gpus=all to a chosen GPU UUID or index, as per NVIDIA's guidelines--device /dev/dri to a chosen GPU index, as per AMD's guidelines>Once the Docker is started, you should see the machine online inside your NiceHash Rig Manager after a couple of minutes and in the Benchmarking state.

Run the following command to test if Docker engine is working:
docker run --rm hello-world
Run the following command to test if Docker miner is detecting GPUs:
You can run NiceHash Docker Miner as an idle job inside the Vast.ai platform. The process is relatively simple as all you have to do is Create a Job inside Vast platform. Find Docker Miner on DockerHub.com.
Ensure that you modify the VAST template commands according to the provided guidelines for either AMD or NVIDIA systems.
Follow this link to copy the Docker Image Template from vast to your template automatically.
Once copied, SELECT the job and SET JOB on your machines via CREATE A JOB tab.
Additional notes for duplicating a job template:
--gpus=all to Docker Options field to choose GPU UUID or index, as per NVIDIA's guidelines--device=/dev/kfd --device=/dev/dri to Docker Options field to choose GPU index, as per AMD's guidelines
Follow these steps to create an idle mining job with NiceHash Docker Miner on Vast.ai:
dockerhubnh/nicehash:latestlatest-e MINING_ADDRESS=your-mining-address -e MINING_WORKER_NAME=your-preferred-worker-name
Launch Mode: Run interactive shell server, SSH
On-Start Script (Bash commands): /opt/nhm4/nhm4 -b debugNiceHash Docker Miner
Additional notes for setting up a job template:
--gpus=all to Docker Options field to choose GPU UUID or index, as per NVIDIA's guidelines--device=/dev/kfd --device=/dev/dri to Docker Options field to choose GPU index, as per AMD's guidelines>
By using the CLI option, you can operate multiple rigs with more ease since you can programmatically name each of the workers instead of manually setting multiple templates in the Vast platform GUI. To run the above example in CLI, use this example:
--image dockerhubnh/nicehash --env '-e MINING_ADDRESS=your-mining-address -e MINING_WORKER_NAME=your-preferred-worker-name' --onstart /opt/nhm4/nhm4 -b debug --disk 16 --ssh
Additional notes:
--gpus=all to your command to choose GPU UUID or index, as per NVIDIA's guidelines--device=/dev/kfd --device=/dev/dri to your command to choose GPU index, as per AMD's guidelines>