How to Prevent a Mac From Sleeping While Downloading
Stop your Mac sleeping during an App Store, macOS update or torrent download. Use caffeinate or Glowmoth, with steps for each download type.
GuideUpdated 8 min read
On this page
You start a big download, walk away, and come back to find the Mac asleep and the progress bar stalled. It happens with App Store apps, macOS updates, torrents and sync apps like Dropbox. The cause is almost always idle sleep, and the fix is to hold the Mac awake for exactly as long as the job needs.
Why the download stops
The Mac goes to sleep after a period of inactivity, and a sleeping Mac suspends most network work. Two settings are involved: when the display turns off, and whether the Mac may then sleep. Apple's help page for these settings lists a "Prevent automatic sleeping" option for when the display is off, and it appears in different panes for laptops and desktops. On a laptop it is under Battery, then Options, and it applies on the power adapter.
Common causes, most likely first:
- Idle sleep with nothing holding the Mac awake. Some apps do hold it awake while they work, but not all do, and not for every kind of transfer. Users report that long App Store and macOS update downloads stall once the display goes off.
- A laptop on battery. The "prevent sleeping" option applies on the power adapter, so on battery the Mac sleeps regardless.
- A closed lid. A normal keep-awake hold does not stop a laptop sleeping when you shut the lid.
- A hold that was too short. A
caffeinate -ttimer that runs out before the file finishes. - A network drop. The Mac stayed awake, but Wi-Fi or a VPN disconnected. No keep-awake tool fixes that.
Pick the right method for your download
| What is downloading | Easiest fix | Why |
|---|---|---|
| App Store app or macOS update | Timed session (caffeinate -t or Glowmoth) | No download folder you can watch |
| Browser download (Safari, Chrome, Firefox) | Glowmoth This Download Finishes | Ends by itself when the file is done |
| Torrent client | Glowmoth app rule or folder watch | App rule holds while the client is open; folder watch holds while files grow |
| Dropbox or other sync app | Glowmoth app rule or timed session | Sync pauses when the Mac sleeps |
| Command-line download | caffeinate -i <command> or glowmoth run -- <command> | Holds exactly as long as the command runs |
Fix 1: caffeinate in Terminal
caffeinate is built into macOS. It holds a sleep-prevention assertion while the command runs, and it changes no setting, so there is nothing to undo.
- Open Terminal (Spotlight, then type "Terminal").
- Run this, changing the seconds to suit:
caffeinate -i -t 7200This blocks idle system sleep for 7,200 seconds (two hours). The display can still turn off. Press Control-C or close the window to end it early. Add -d to keep the display on too.
Hold the Mac while one command runs
If you download from Terminal, put caffeinate in front. It ends when the command ends:
caffeinate -i curl -O https://example.com/file.isoHold the Mac until a process exits
Find the app's PID in the PID column of Activity Monitor, then run:
caffeinate -i -w 1234Replace 1234 with the real PID. For more flags, see our caffeinate command guide.
Fix 2: Glowmoth, so the hold ends on its own
We make Glowmoth, a menu bar app that stops idle sleep and always tells you why the Mac is awake. For one download, caffeinate is enough. Glowmoth is worth it if you download often or want the hold to end when the download does. It needs macOS 14 or later and is part of MacSuite ($349 one-time, as of November 2026), with a 7-day free trial.
Glowmoth has no window and no Dock icon, only a moth-and-lamp icon in the menu bar. If you can't see it, a full menu bar or the notch may be hiding it. Hold ⌘ and drag icons to make room.
App Store downloads and macOS updates
These have no folder to watch, so use a timed session.
- Right-click (or Control-click) the Glowmoth icon.
- Under Keep This Mac Awake, pick a duration such as 2 Hours, or open Until and pick a time such as 18:00 Today.
- For another length, choose Custom…, type
3h 20mand press Return. Forms like90,1h30and2h 15malso work.
If the download runs long, Option-click the icon to open the panel and use the +15m or +1h chips. When you're done, choose Stop in the right-click menu.
Browser downloads
Glowmoth recognizes the partial files browsers leave behind (.download, .crdownload, .part, .partial, .opdownload).
- Start your download.
- Right-click the icon, choose Keep Awake While, then This Download Finishes.
- The first time, choose the folder the download is saving to and click Watch Folder. The picker starts in
~/Downloads, and macOS may ask for folder access.
Glowmoth holds the Mac for at least 2 minutes, then until the folder has been quiet for 2 minutes. It checks only file names and sizes, never contents. It remembers the folder, and there is no setting to change it. To watch a different folder, open Settings (⌘,), go to Automation, and under Folders click Add Folder….
Torrent clients and sync apps
Pick the app rather than the folder if you want the Mac held for as long as the client is open.
- Open Settings (⌘,) and go to Automation.
- Under Apps, use Add App and choose your torrent client or sync app.
- Set While to Running (or In Front), and Then Wait to No Delay, 1 Min or 5 Min.
The Mac then stays awake while that app is open, even when it has nothing to transfer. A folder entry is the alternative: it holds only while files in that folder are growing. For a one-off job, choose Keep Awake While, then A Process Runs… and pick the process from the list.
Command-line downloads
Install the tool in Settings, Advanced, Command Line, Command-line tool, Install. Then:
glowmoth run -- curl -O https://example.com/file.isoThis holds the Mac while the command runs and returns its exit code. If glowmoth isn't found, add ~/.local/bin to your shell's PATH.
Let the screen go dark, then sleep when done
Glowmoth sessions keep the display on by default. For a download you probably want it off: choose Keep Display On in the right-click menu to clear the checkmark, or turn off Keep the display on in Settings, Sessions for new sessions. Folder, app and process reasons never keep the display on.
To sleep the Mac afterward, go to Settings, Sessions, When a Session Ends and set Then to Sleep the Mac. This runs only when the last reason ends on its own, not when you choose Stop. For an overnight download, start This Download Finishes and go to bed.
Fix 3: change the system sleep settings
You can also raise the idle times yourself. Open System Settings, click Lock Screen in the sidebar, and use the "Turn display off" pop-up menus. Apple's page on unexpected sleep and wake covers this, and the options live in different panes for laptops and desktops, as Apple's sleep and wake settings page describes. This is a global change you must reverse later, or the Mac stays awake when nothing is downloading. Our Mac sleep settings guide explains each option.
Checklist before you try again
- The Mac is plugged in, especially for a macOS update.
- The lid is open (or you have read about closed-lid mode, which is off by default, laptops only, and needs an approved helper).
- Your hold is long enough, or tied to the app or folder rather than a guess.
- Glowmoth's icon is not slashed (battery or heat pause).
- The trial or license is valid. Without one, Glowmoth holds nothing.
- The panel's Automatic | Manual control is on Automatic. In Manual, only your own session counts, so This Download Finishes and app rules are ignored. Also check you didn't choose Stop Everything.
- You didn't sleep the Mac by hand. Apple menu ▸ Sleep and the power button still work.
If the Mac still sleeps, open the panel's Show More and read Also Keeping This Mac Awake. It lists other apps holding the Mac and traps like a scheduled pmset sleep or an automatic log-out. See what's keeping my Mac awake.
If nothing works
Glowmoth doesn't keep Wi-Fi or VPN connections alive. If the download stalls while the Mac was awake and plugged in, look at the network or the download source. A macOS update can also restart the Mac during installation, and no keep-awake tool carries through a restart.
For Glowmoth problems, see Troubleshooting Glowmoth or MacSuite support. Include what you were downloading, the icon state, and what the panel header said.
Hi, Glowmoth did not keep my Mac awake during a download.
Download type: (App Store / browser / torrent / other)
Method used: (timed session / This Download Finishes / app rule)
Panel header text and icon state when it failed:
Mac model and macOS version:
Plugged in, lid open: (yes/no)
Steps already tried:Common questions
Does caffeinate work for macOS updates?
It can cover the download phase while the command runs. It can't cover the install, because it ends when the Mac restarts.
Will the download continue if only the screen turns off?
Usually yes, if the Mac itself doesn't sleep. caffeinate -i, or a Glowmoth session with Keep the display on off, lets the display go dark while the Mac keeps running.
Do I need an app if I use Terminal?
No. For one download, caffeinate is enough. An app helps when you want the hold to end when the download does, a visible icon, or rules you don't want to retype.
Why did my Mac sleep even with a timer running?
Check for a closed lid, battery power, a safety pause or a manual sleep. A timer only blocks idle sleep.