Home

How do I keep Termux mining when the screen is off?

You can usually keep a Termux miner running with the screen off by taking a wake lock and allowing Termux to run without battery restrictions. A wake lock asks Android to keep the processor awake, but your phone may still stop mining because of heat, low memory, or its own power-saving rules.

Keep the processor awake

In Termux, run this before starting your miner:

termux-wake-lock

Then start your miner with your usual command. You can turn the screen off with the power button; you do not need to leave the display lit.

The wake lock keeps the processor available while the screen is off. It does not protect Termux from being force-stopped or guarantee that Android will keep its network connection active.

When you finish mining, stop the miner and release the lock:

termux-wake-unlock

Otherwise, the phone may stay awake unnecessarily and drain its battery. These commands are normally included with Termux’s standard tools; you do not need root access, which means special administrator control over Android.

Change Android’s battery settings

Open Settings → Apps → Termux → Battery, or the closest equivalent on your phone. Menu names vary by Android version and manufacturer.

Look for settings that let you:

  • Set Termux’s battery use to Unrestricted or Don’t optimize.
  • Allow background activity.
  • Remove Termux from sleeping apps or deep sleeping apps.
  • Allow background data if you mine over mobile data.

Some phones also have a separate auto-start or background-app setting. Enable it for Termux if your phone uses it to limit background apps. This does not automatically restart your mining command after a reboot.

Keep Termux’s ongoing notification enabled so you can see that its session is active. Avoid force-stopping Termux, using “clean memory” tools, or swiping it away on phones that treat that action as closing the app. Battery Saver may also interrupt mining.

Check that mining really continues

Start with a short test rather than leaving your phone unattended overnight:

  1. Run termux-wake-lock and start your miner.
  2. Check that it connects to your mining pool—the service that combines miners’ work.
  3. Turn the screen off for 10–15 minutes.
  4. Unlock the phone and inspect the miner’s output.

Look for work recorded during the screen-off period, not just new activity after unlocking. If your pool has a worker-status page, check it from another device. Pool updates can be delayed, and low-powered phones may take a while to submit an accepted share—a small proof of mining work.

If mining still stops, recheck your phone’s manufacturer-specific battery controls. A tool such as tmux can preserve your terminal workspace when you disconnect from it, but it cannot keep mining alive if Android kills Termux.

Keep heat under control

Screen-off mining still puts a sustained load on your processor. Start with fewer mining threads, meaning fewer simultaneous mining tasks.

Keep the phone uncovered on a hard, ventilated surface. Never leave it mining under bedding or in a closed bag. Charging while mining can add heat and speed up battery wear.

If the phone becomes uncomfortably hot, reduce the workload or stop. Do not disable thermal protections to keep mining running.

The bottom line

Use a wake lock, remove Termux’s battery restrictions, and verify activity while the screen is off. These steps improve reliability, but they cannot override every Android limit—and protecting your phone matters more than uninterrupted mining.

All 1,000 questions

MyAiMiner.com

MyAiMiner.com — Monero mining blog. 1,000 questions. Clear answers.

Monero (XMR) Mining BLOG

Hashes0
Blocks accepted0
Blocks rejected0
Runtime00:00:00