Skip to content
86% off$349 $48.86code BF2026

Guides

Keep Your Mac Awake Until a Download Finishes

How to keep your Mac awake while downloading: why sleep stops downloads, plus sleep settings, caffeinate, and a watched folder that ends on its own.

Use caseUpdated 10 min read

On this page

A Mac that goes to sleep stops downloading. The quickest built-in way to keep your Mac awake while downloading is to open Terminal, run caffeinate -i, and press ⌃C (Control-C) when the file is done. If you don't want to watch the progress bar, have an app watch the folder the download is saving into and allow sleep once that folder goes quiet. That way you don't have to guess how long the download will take.

We make Glowmoth, the keep-awake app used for the watched-folder method below. The built-in options come first, and for many downloads they're enough.

What a good result looks like

  • The Mac stays awake until the last byte is written, even if the download takes longer than you expected.
  • The display can turn off in the meantime. Only system sleep stops a download.
  • When the download is done, the Mac goes back to its normal sleep behavior, or sleeps as soon as it's done if you want that.
  • Nothing is left switched on that you have to remember to undo.

Does a Mac keep downloading while it sleeps?

No. When a Mac goes to sleep, apps stop running and network connections close, so a download in progress stops with them. Whether it picks up again when the Mac wakes depends on the app and the server. Some downloads resume from where they stopped. Others fail and have to start over.

Power Nap doesn't change this. It lets some Apple services update while the Mac sleeps, but it doesn't keep your browser running.

Two things that look like sleep don't interrupt a download:

  • The display turning off. The Mac is still awake.
  • The screen locking. Apps keep running behind the lock screen.

Some apps tell macOS they're busy while they download, and that keeps the Mac awake on its own. To see whether yours does, run this in Terminal while the download is running:

bash
pmset -g assertions

This lists what is currently holding the Mac awake, by process. It's read-only and changes nothing. If your download app isn't listed with a PreventUserIdleSystemSleep assertion, the Mac will sleep on its usual timer.

Built-in option: change sleep settings temporarily

macOS has a setting that stops automatic sleep while the display is off. You switch it on before the download and off again afterward.

  1. Open System Settings and search for "Prevent automatic sleeping". If the search finds nothing, look under Battery ▸ Options… on a MacBook, or in the Energy settings on a desktop Mac.
  2. Turn on the option that starts with Prevent automatic sleeping. On a MacBook it's Prevent automatic sleeping on power adapter when the display is off. On a desktop Mac it's Prevent automatic sleeping when the display is off.
  3. When the download is done, turn it off again.

What this can't do:

  • On a laptop, it only works while the power adapter is connected.
  • It doesn't end by itself. If you forget to turn it off, your Mac never idle-sleeps from then on.
  • Closing a laptop's lid still puts the Mac to sleep.

Keep your Mac awake while downloading with caffeinate

caffeinate is built into macOS. It keeps the Mac awake while it runs and changes no settings, so there's nothing to undo. Our caffeinate guide covers all the flags. These are the ones that matter for downloads.

Keep the Mac awake until you stop it (the display may still sleep):

bash
caffeinate -i

Press ⌃C or close the Terminal window to end it.

Keep the Mac awake for a set time, in seconds (7200 is 2 hours):

bash
caffeinate -i -t 7200

For downloads you start from Terminal, wrap the command. The Mac stays awake exactly as long as the download runs:

bash
caffeinate -i curl -L -O https://example.com/big-file.zip

curl -L -O follows redirects and saves the file under its original name in the current folder.

There's also caffeinate -w <PID>, which waits for a process to exit. It doesn't help with browser downloads, because the browser keeps running after the file finishes. So for a browser download, caffeinate leaves you two choices: stop it by hand, or guess a timer. Guess short and the Mac sleeps mid-download. Guess long and it stays awake for nothing.

For command-line downloads, caffeinate is all you need.

Wait for a download to finish, then allow sleep

Glowmoth can watch the folder a download is saving into and keep the Mac awake until that folder goes quiet. You don't set a timer, and nothing needs undoing afterward.

For one download: This Download Finishes

  1. Start the download in your browser.
  2. Right-click (or Control-click) the Glowmoth moth icon in the menu bar.
  3. Choose Keep Awake While ▸ This Download Finishes.
  4. The first time, Glowmoth asks you to "Choose the folder your download is saving to." The picker starts in your Downloads folder. Select the folder and click Watch Folder.

Glowmoth then lists the reason as "Waiting for Downloads to finish" (with your folder's name), and the menu item shows a checkmark. It holds the Mac awake for at least 2 minutes, then until the folder has been quiet for 2 minutes. Because of that 2-minute minimum, you can also choose the menu item just before you start the download.

To confirm it's working, run pmset -g assertions. Glowmoth's assertion is named after its reason, for example "Glowmoth: Waiting for Downloads to finish".

Details that matter:

  • The folder is remembered. There's no setting to change it later. It only resets if the folder disappears or you use Reset all settings in Glowmoth's Settings ▸ Advanced, which also resets your other preferences. So pick the folder your browser actually saves to. For other folders, use the saved Folders list below.
  • Only the Mac stays awake. Folder reasons never keep the display on, so the screen turns off on its normal schedule.
  • Quitting Glowmoth cancels it. One-off reasons aren't restored after a relaunch.
  • macOS may ask for access to Downloads, Desktop or Documents the first time. Glowmoth only checks file names and sizes, never contents.

For every download: the Folders list

If you download large files often, save the folder once. Glowmoth then keeps the Mac awake whenever something is being written into it.

  1. Right-click the menu bar icon and choose Settings… (or press ⌘, (Command-Comma) with the panel open).
  2. Click the Automation tab.
  3. In Folders, click Add Folder….
  4. Choose the folder and click Watch Folder.
Glowmoth Settings, Automation tab: two rules, Xcode, the ffmpeg and rsync processes, and Downloads in Folders
Watched folders keep the Mac awake while files are arriving.

A watched folder counts as busy in either of these cases:

  • It contains a partial download file: .download (Safari), .crdownload (Chrome), .part (Firefox), .partial or .opdownload (Opera).
  • A file grew, or a new non-empty file appeared, in the last 60 seconds.

The reason ends 2 minutes after the folder goes quiet, and Glowmoth shows it as "Downloads folder is busy". This only works while Glowmoth is set to Automatic, which is the default.

The partial-file check has a catch. A stalled or paused download, or a leftover partial file from an old failed one, keeps the folder busy indefinitely. Before you leave the Mac, cancel stuck downloads and delete leftover files with the extensions above. To end the hold right away, click the ✕ on its row in the panel's Held By list.

Downloads from Terminal or other apps

Some downloads don't land in a folder you'd think to watch, like command-line tools or apps that save into their own library folders. You have a few options:

  • Watch a running process. Choose Keep Awake While ▸ A Process Runs…, search by name or PID, and click Keep Awake. The reason ends within about a second of the process exiting.
  • Watch by name. In Settings ▸ Automation ▸ Processes, add an executable name such as curl or rsync. Any process with that name keeps the Mac awake, including ones started later.
  • Wrap the command. If you installed the glowmoth command-line tool, glowmoth run -- curl -L -O https://example.com/big-file.zip works like the caffeinate version, and the download also shows up in Glowmoth's list of reasons.
  • Fall back to a timer. If an app saves somewhere you can't find, right-click the icon and pick a duration.

The Keep Awake While docs cover each option in more detail.

Large copies to external or network drives

A long Finder copy has the same problem as a download: if the Mac sleeps, the copy stops. The fixes are the same, plus one more for drives that go idle on their own.

Copies from Finder. Add the destination folder on the external drive to the Folders list. A new file appearing and growing makes the folder busy, and the reason ends 2 minutes after the copy stops. macOS may ask whether Glowmoth can access removable or network volumes the first time.

Copies from Terminal. Wrap the command so the Mac stays awake exactly as long as it runs:

bash
caffeinate -i rsync -a ~/Movies/ /Volumes/Backup/Movies/

This copies the contents of your Movies folder to a folder on a drive named "Backup" while blocking idle sleep. Replace the paths with your own. In Glowmoth, you can instead choose A Process Runs… and pick the running rsync.

Drives that spin down or disconnect. Keeping the Mac awake doesn't stop an external drive from going idle between bursts of activity. Glowmoth's drive keep-alive writes a tiny hidden file to the drives you choose, on a schedule:

  1. Open Glowmoth's Settings ▸ Advanced ▸ Drives.
  2. Turn on Keep drives from sleeping.
  3. Click Add Drive… and choose any folder on the external or network drive.
  4. Leave When set to While Keeping Awake (the default) so it only runs while Glowmoth is keeping the Mac awake. Choose Always if you want it all the time.
  5. Adjust Every N min if needed (1–30 minutes, default 4).

The file is .glowmoth-keepalive at the root of each drive. It's deleted when you turn the feature off or remove the drive. Glowmoth never mounts a drive, skips read-only drives ("Read-only, skipped"), and won't accept your startup disk. See Keep external drives from sleeping for the details.

Sleep, lock or run a command when it's done

If you start a big download before bed, you probably want the Mac to sleep once it finishes, not on its usual idle timer.

With caffeinate, chain a sleep command after the download. The following command puts the Mac to sleep as soon as the download succeeds:

bash
caffeinate -i curl -f -L -O https://example.com/big-file.zip && pmset sleepnow

-f makes curl report a server error (such as a missing file) as a failure. Because of the &&, the Mac only sleeps if curl succeeded.

With Glowmoth, set an end action:

  1. Open Glowmoth's Settings ▸ Sessions.
  2. Under When a Session Ends, set Then to Sleep the Mac. The other choices are Turn Off the Display, Start the Screen Saver and Lock the Screen. The default is Do Nothing.
  3. Optional: set Also to Run a Shortcut or Run a Shell Command, for example say "Download finished".
Glowmoth Settings, Sessions: notification switches, then When a Session Ends with Then set to Sleep the Mac and Also running say
Choose what happens when a session runs out on its own.

How end actions behave:

  • They fire only when the last reason ends on its own, for example when a watched folder goes quiet. If your own keep-awake session is still running, nothing happens until that ends too.
  • They don't fire when something else ends the hold: Stop, the ✕ on a row, Stop Everything, the screen locking, unplugging the power adapter, or a safety pause.
  • The setting stays on for everything. It fires whenever the last reason ends on its own, including a timer running out or a saved app quitting. Set it back to Do Nothing if you only wanted it for tonight.
  • Shell commands run in zsh from your home folder, with GLOWMOTH_EVENT and GLOWMOTH_REASON set, and are stopped after 30 seconds. With Sleep the Mac, your command runs before the Mac sleeps.

Notifications and end actions covers the rest.

Which method to use

MethodEnds by itself when the download is doneWorks for browser downloadsSomething to undo afterward
Sleep setting in System SettingsNoYes (laptops: only on power)Yes, turn the option off
caffeinate -i / -tNo (manual stop or a guessed timer)YesNo
caffeinate wrapping a commandYesNo, command-line downloads onlyNo
Glowmoth This Download FinishesYes, 2 minutes after the folder goes quietYesNo
Glowmoth Folders listYes, every time, without starting anythingYesNo
  • Use caffeinate if you start the download from Terminal, or you'll be at the Mac when it finishes.
  • Use the sleep setting if you're on a desktop or plugged in, and you'll remember to switch it back.
  • Use Glowmoth if you download or copy large files often, leave the Mac unattended, or want it to sleep once a download is done. Glowmoth is part of MacSuite; you can try it free for 7 days.

Common mistakes and fixes

  • The Mac slept anyway, and the lid was closed. caffeinate and Glowmoth's normal keep-awake only prevent idle sleep, so closing a MacBook's lid still sleeps it unless it's set up for clamshell use. Keep the lid open, or see our clamshell mode guide and Keep a MacBook awake with the lid closed.
  • Glowmoth is watching the wrong folder. Check where your browser saves downloads. If it doesn't match the remembered folder, add the right one under Folders in Settings.
  • The panel says "Paused". A safety limit released the hold: the battery dropped below the floor (20% by default) while on battery power, or the Mac was running hot. Plug in, or click Resume Anyway (30 min) in the panel.
  • Nothing automatic keeps the Mac awake. The panel may be set to Manual, which ignores every reason except your own session. Switch it back to Automatic. If you clicked Stop Everything earlier, automatic reasons stay suspended until you start a session or relaunch Glowmoth.
  • Glowmoth isn't keeping anything awake at all. If the panel says "Your trial has ended", Glowmoth holds nothing until you enter a MacSuite license.
  • The Mac never sleeps after a failed download. A stalled or leftover partial file keeps a watched folder busy. Cancel the download, delete the partial file, or click the ✕ on its row.
  • The download failed even though the Mac stayed awake. Keeping the Mac awake doesn't keep a Wi-Fi or VPN connection from dropping. Check the network, then restart or resume the download.

If your Mac sleeps too soon in general, not just during downloads, start with How to Stop Your Mac From Going to Sleep.

Every app.
One purchase.