-
bitcoin $78311.742754 USD
-1.90% -
ethereum $2245.886032 USD
-2.70% -
tether $0.998203 USD
-0.04% -
bnb $712.879778 USD
-5.03% -
xrp $1.258841 USD
-2.42% -
usd-coin $0.999540 USD
-0.01% -
solana $97.855460 USD
-1.96% -
tron $0.331507 USD
0.16% -
hyperliquid $92.902634 USD
17.89% -
zcash $1261.764238 USD
1.85% -
dogecoin $0.076045 USD
-2.24% -
monero $588.272782 USD
-0.06% -
unus-sed-leo $9.437086 USD
-0.19% -
chainlink $11.095621 USD
-2.45% -
cardano $0.193396 USD
-2.04%
How to Mine Bitcoin on Linux? (Advanced Ubuntu Guide)
Set up Ubuntu 22.04 with full-disk encryption, install ROCm/CUDA drivers, compile BFGMiner with OpenCL/CUDA support, secure via non-root user and UFW, and monitor thermals headlessly.
Feb 03, 2026 at 08:59 pm
Setting Up the Mining Environment
1. Install Ubuntu Server 22.04 LTS with full disk encryption and minimal package selection to reduce attack surface and improve stability.
2. Update the system repository index and upgrade all installed packages using apt update && apt upgrade -y before proceeding.
3. Install essential build tools including build-essential, cmake, libtool, and autoconf to compile mining software from source.
4. Configure kernel parameters to prevent memory overcommit and adjust swappiness to 10 via /etc/sysctl.conf for sustained computational workloads.
5. Disable GUI services and unnecessary daemons such as systemd-resolved and ModemManager to free CPU cycles and reduce background I/O pressure.
Selecting Compatible Hardware Drivers
1. Identify GPU models using lspci | grep VGA and cross-reference with supported ASIC emulators or OpenCL-compatible devices.
2. For AMD GPUs, install rocm-opencl-runtime and validate compute capability with clinfo to confirm OpenCL 2.0+ support.
3. For NVIDIA hardware, deploy nvidia-driver-535 alongside cuda-toolkit-12-3, then verify CUDA availability using nvidia-smi and nvcc --version.
4. Load kernel modules explicitly: sudo modprobe amdgpu or sudo modprobe nvidia-uvm, then persist them in /etc/modules.
5. Set GPU power limits using rocm-smi --setpoweroverdrive or nvidia-smi -pl to stabilize thermal behavior during extended hashing sessions.
Compiling and Configuring BFGMiner
1. Clone the official BFGMiner repository from GitHub and checkout the latest stable release tag instead of using master branch.
2. Run ./autogen.sh followed by ./configure --enable-scrypt --enable-x11 --enable-opencl --enable-cuda to activate relevant algorithms and backends.
3. Compile with make -j$(nproc) and install globally using sudo make install to place binaries in /usr/local/bin.
4. Generate a configuration file at ~/.bfgminer/bfgminer.conf specifying pool URL, worker credentials, device targeting, and intensity settings per GPU.
5. Launch with bfgminer --config ~/.bfgminer/bfgminer.conf --log-file /var/log/bfgminer.log --debug to capture runtime diagnostics without terminal flooding.
Securing Remote Mining Operations
1. Create a dedicated non-root user named miner with no shell access and restrict sudo privileges to only /usr/local/bin/bfgminer.
2. Bind the mining daemon to localhost only and disable JSON-RPC remote access unless absolutely required for monitoring interfaces.
3. Configure UFW to deny all incoming connections except SSH on a non-standard port and allow outbound traffic solely to known mining pool IPs.
4. Rotate API keys and worker passwords weekly using a cron job that updates bfgminer.conf and reloads the process via systemctl restart bfgminer.service.
5. Store wallet.dat backups offline and encrypt them with gpg --symmetric --cipher-algo AES256 before transferring to air-gapped storage media.
Troubleshooting Common Failures
1. If clGetPlatformIDs returns CL_PLATFORM_NOT_FOUND_KHR, reinstall ROCm stack and ensure user belongs to render and video groups.
2. When nvidia-smi shows “No running processes found” but hash rate is zero, check if persistence mode is enabled via nvidia-smi -pm 1.
3. A segmentation fault during BFGMiner startup often indicates mismatched OpenCL library versions; verify LD_LIBRARY_PATH includes correct /opt/rocm/opencl/lib/x86_64 or /usr/local/cuda/lib64.
4. Pool connection timeouts may stem from DNS resolution failures; override resolver in /etc/systemd/resolved.conf to use 1.1.1.1 and restart systemd-resolved.
5. Sudden drops in accepted shares correlate with unstable memory clocks; underclock VRAM by 200 MHz using rocm-smi --setmemclock or nvidia-settings -a [gpu:0]/GpuMemoryTransferRateOffset[3]=0.
Frequently Asked Questions
Q: Can I mine Bitcoin directly with a GPU on Ubuntu?Bitcoin’s SHA-256 algorithm is no longer viable on GPUs due to ASIC dominance; attempting it yields negligible returns and high electricity cost per terahash.
Q: Why does BFGMiner fail with “No devices detected” even after driver installation?This occurs when OpenCL or CUDA libraries are not linked correctly; verify ldconfig -p | grep opencl and ensure vendor-specific ICD files exist in /etc/OpenCL/vendors/.
Q: Is it safe to run mining software as root?No. Running as root introduces critical privilege escalation risks; always operate under a restricted account with minimal filesystem and device permissions.
Q: How do I monitor temperature and fan speed without X11?Use rocm-smi for AMD or nvidia-smi -q -d TEMPERATURE,FAN for NVIDIA; parse output with awk and log to syslog via logger in a cron loop.
Disclaimer:info@kdj.com
The information provided is not trading advice. kdj.com does not assume any responsibility for any investments made based on the information provided in this article. Cryptocurrencies are highly volatile and it is highly recommended that you invest with caution after thorough research!
If you believe that the content used on this website infringes your copyright, please contact us immediately (info@kdj.com) and we will delete it promptly.
- Bitwise Bitcoin, Pepeto, and Pepe Record: A New York Minute on Crypto's Wild Ride
- 2026-10-31 04:35:01
- Circle CCTP Dominates Crypto Bridges, USDC Volume Soars Amidst Evolving Cross-Chain Landscape
- 2026-10-30 21:15:01
- Cardano Foundation's CIP-0113 Propels Tokenized Securities into Swiss Spotlight
- 2026-10-30 20:55:01
- Bank of Russia Taps NAUFOR as First Crypto SRO, Ushering in New Era for Exchanges
- 2026-10-30 20:45:01
- Ripple and World Liberty Financial Join Forces with Tether and Circle to Freeze Funds Amidst Binance Hack Concerns
- 2026-10-30 20:50:01
- PEPE Memecoin: Binance Hacker Dump vs. Whale Purchase – A Rollercoaster Ride
- 2026-10-30 20:55:01
Related knowledge
Which ASIC Miner Has the Lowest Power Consumption?
Oct 31,2026 at 04:40am
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed supply cap of 21 million coins, with new coins introduced through block rewards grante...
How to Calculate the Break-Even Point for Bitcoin Mining?
Oct 31,2026 at 05:40am
Understanding Mining Cost Components1. Electricity cost per kilowatt-hour directly impacts daily operational expenditure and must be verified with loc...
What Electricity Price Makes Bitcoin Mining Profitable?
Oct 31,2026 at 04:59am
Electricity Cost Thresholds for Mining Viability1. Bitcoin mining profitability hinges directly on the per-kilowatt-hour electricity rate paid by oper...
How to Calculate BTC Mining Revenue Per TH/s?
Oct 31,2026 at 12:39am
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed supply cap of 21 million coins, with new units introduced through block rewards. 2. Ev...
What Is the Best Hashrate for Bitcoin Mining in 2026?
Oct 30,2026 at 11:19am
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed issuance schedule where block rewards are cut in half approximately every 210,000 bloc...
How Much Bitcoin Can You Mine With 100 TH/s?
Oct 30,2026 at 11:00am
Hash Rate and Network Difficulty Relationship1. Bitcoin’s mining difficulty adjusts every 2016 blocks, approximately every two weeks, based on the tot...
Which ASIC Miner Has the Lowest Power Consumption?
Oct 31,2026 at 04:40am
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed supply cap of 21 million coins, with new coins introduced through block rewards grante...
How to Calculate the Break-Even Point for Bitcoin Mining?
Oct 31,2026 at 05:40am
Understanding Mining Cost Components1. Electricity cost per kilowatt-hour directly impacts daily operational expenditure and must be verified with loc...
What Electricity Price Makes Bitcoin Mining Profitable?
Oct 31,2026 at 04:59am
Electricity Cost Thresholds for Mining Viability1. Bitcoin mining profitability hinges directly on the per-kilowatt-hour electricity rate paid by oper...
How to Calculate BTC Mining Revenue Per TH/s?
Oct 31,2026 at 12:39am
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed supply cap of 21 million coins, with new units introduced through block rewards. 2. Ev...
What Is the Best Hashrate for Bitcoin Mining in 2026?
Oct 30,2026 at 11:19am
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed issuance schedule where block rewards are cut in half approximately every 210,000 bloc...
How Much Bitcoin Can You Mine With 100 TH/s?
Oct 30,2026 at 11:00am
Hash Rate and Network Difficulty Relationship1. Bitcoin’s mining difficulty adjusts every 2016 blocks, approximately every two weeks, based on the tot...
See all articles














