---
title: How to keep a Mac awake without installing an app
description: macOS has three built-in ways: System Settings, caffeinate and pmset. Exact menu paths, Terminal recipes for downloads and timers, and their limits.
date: 2026-10-20
kicker: Built in
section: The closed lid, explained
related: caffeinate-lid-closed, pmset-disablesleep, clamshell-mode-without-external-monitor
order: 6
---

> **Short answer:** macOS has three built-in ways to keep a Mac awake: the sleep options in System Settings, the `caffeinate` command, and `pmset` for advanced users. For a download or a long command with the lid open, `caffeinate -i` is enough: `caffeinate -i curl -L -O <url>` keeps the Mac awake until the download ends, and `caffeinate -i -t 7200` keeps it awake for two hours. None of them keeps a closed MacBook awake without an external display safely: only `sudo pmset disablesleep 1` gets past the lid, and it stays on until you undo it.

## Which System Settings stop a Mac from sleeping?

Three places, as of October 2026 on macOS 26 and later, per Apple's Mac User Guide. They control sleep after inactivity, not the lid.

| Setting | Where | What it does |
| --- | --- | --- |
| "Turn display off on battery when inactive" | System Settings > Lock Screen | How long the Mac waits on battery |
| "Turn display off on power adapter when inactive" | System Settings > Lock Screen | How long the Mac waits on the charger |
| "Prevent automatic sleeping on power adapter when the display is off" | System Settings > Battery > Options (laptops) | The Mac keeps running after the display turns off, while plugged in |
| "Prevent automatic sleeping when the display is off" | System Settings > Energy (desktops) | The same for a Mac mini, iMac or Mac Studio |

Apple uses the two Lock Screen menus to set how long the Mac waits before it sleeps ([If your Mac sleeps or wakes unexpectedly](https://support.apple.com/guide/mac-help/if-your-mac-sleeps-or-wakes-unexpectedly-mchlp2995/mac)). The Battery option will "Prevent your Mac from sleeping when it's plugged in and its display is off" ([Battery settings](https://support.apple.com/guide/mac-help/change-battery-settings-mchlfc3b7879/mac)), and the Energy option will "Prevent your Mac from going to sleep automatically when its display is off" ([Energy settings](https://support.apple.com/guide/mac-help/change-energy-settings-mchlp1168/mac)). Apple adds: "delaying, preventing, or allowing disruption of sleep may increase power consumption" ([Apple Support](https://support.apple.com/guide/mac-help/set-sleep-and-wake-settings-mchle41a6ccd/mac)).

For a MacBook on its charger, turn on the Battery option and leave the lid open: the display can go dark while the Mac keeps working. On battery there is no such switch, only the display timer.

## How do I keep a Mac awake from Terminal?

Use `caffeinate`, which ships with macOS at `/usr/bin/caffeinate`. The man page: "If no assertion flags are specified, caffeinate creates an assertion to prevent idle sleep." With a command after it, the assertion lasts "for the duration of the utility's execution"; without one, until `caffeinate` exits (press Control-C).

```sh
caffeinate -i curl -L -O https://example.com/big.zip   # until the download ends
caffeinate -i make                                     # while a command runs (Apple's example)
caffeinate -i -t 7200                                  # for 2 hours (7,200 seconds)
caffeinate -i -w 4242                                  # until process 4242 exits
caffeinate -i -w "$(pgrep -n -x rsync)"                # until the newest rsync exits
caffeinate -d -i                                       # keep the display on too, until Control-C
```

The options, from `man caffeinate`:

- `-i` prevents idle sleep; `-d` keeps the display on as well.
- `-t` sets the timeout in seconds, and is "not used when an utility is invoked".
- `-w` "Waits for the process with the specified pid to exit", and "is ignored when used with utility option". `pgrep -n` picks "the newest (most recently started)" match, and `-x` requires an exact name (`man pgrep`).
- `-s` also prevents system sleep, but "is valid only when system is running on AC power."

### How do I keep a MacBook awake while downloading?

Wrap the download in `caffeinate` when you start it from Terminal, as in the `curl` line above. For a download in a browser or an app, run `caffeinate -i -t` with a time longer than the download needs. To see whether the app already holds the Mac awake, run `pmset -g assertions` and look for its name under `Listed by owning process:`.

### How do I check that it works?

Run `pmset -g`. While something holds an assertion, the `sleep` line ends with a note such as `(sleep prevented by caffeinate)` ([pmset.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmset/pmset.m#L1306)), and `pmset -g assertions` lists `PreventUserIdleSystemSleep 1`.

`caffeinate` stops at the lid: Apple says that with this assertion "The system may still sleep for lid close, Apple menu, low battery, or other sleep reasons" ([Apple developer docs](https://developer.apple.com/documentation/iokit/kiopmassertiontypepreventuseridlesystemsleep)). The details are in [why caffeinate does not keep your MacBook awake with the lid closed](/blog/caffeinate-lid-closed).

## How do I change sleep settings with pmset?

`pmset` changes the saved power settings, so it needs `sudo`: "pmset must be run as root in order to modify any settings." Changes are stored "per-system, not per-user", and "pmset modifies the same file that System Settings modifies" (`man pmset`).

```sh
pmset -g custom                 # current settings under "Battery Power:" and "AC Power:"
sudo pmset -c sleep 0           # no idle sleep on the charger (0 means never)
sudo pmset -c displaysleep 15   # display off after 15 minutes on the charger
pmset displaysleepnow           # turn the display off now
sudo pmset restoredefaults      # back to the default power settings
```

From the man page: `sleep` is the "system sleep timer (value in minutes, or 0 to disable)"; `-c` means "charger (wall power)", `-b` battery and `-a` all; `restoredefaults` "Restores power management settings to their default values."

The risks: a change stays until you change it back, `-a` or `-b` applies it on battery too, and it affects every user of the Mac. Write down the old values from `pmset -g custom` before you start.

### What about sudo pmset disablesleep 1?

It is the one built-in command that gets past the lid. It turns on `SleepDisabled`, and the Mac stops sleeping for any reason, on AC power and on battery, even after a restart ([PMSettings.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmconfigd/PMSettings.m#L1160)), until `sudo pmset disablesleep 0`. It is not in `man pmset`; Apple's [pmset source](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmset/pmset.m#L5813) defines it. Use it only for a job you will watch, and check afterwards that `pmset -g | grep SleepDisabled` shows 0. Full details: [what sudo pmset disablesleep 1 does and how to undo it](/blog/pmset-disablesleep).

## What can't the built-in options do?

They cannot keep a closed MacBook awake without a display, safely. Closing the display puts a Mac laptop to sleep ([Apple Support](https://support.apple.com/guide/mac-help/put-your-mac-to-sleep-or-wake-it-mh10330/mac)), and the built-ins cover it only in two ways:

- **Closed-display mode** keeps it running with an external display, keyboard and mouse, and power connected ([Apple Support](https://support.apple.com/en-us/102501)). See [clamshell mode without an external monitor](/blog/clamshell-mode-without-external-monitor).
- **The disablesleep switch**, `sudo pmset disablesleep 1`, has no timer, no battery floor and no heat check, and survives a restart.

"Wake for network access" and Power Nap work while the Mac sleeps, to provide shared resources or check for updates ([Energy settings](https://support.apple.com/guide/mac-help/change-energy-settings-mchlp1168/mac)); neither keeps your own task running. The whole map is in [how to prevent a MacBook from sleeping when the lid is closed](/blog/prevent-macbook-sleep-lid-closed).

> **Careful:** A closed MacBook that is awake still makes heat. Apple says to use a Mac laptop "on a stable work surface that allows for good ventilation" and not "in your bed, on a pillow, or under bedding" ([Apple Support](https://support.apple.com/en-us/102336)). Never close an awake Mac into a bag.

## What to use

With the lid open, the built-ins are free and enough: the Battery option on the charger, or `caffeinate -i` for one job. To keep a MacBook with Apple silicon awake with the lid closed and no external display, Keep Mac Awake (keepmacawake.com) turns the same `SleepDisabled` setting on for a session you start with `keepmacawake start --hours 8`, supervises it with a watchdog and restores normal sleep afterwards. It is an app, so it needs installing, on macOS 26 or later; sessions run on AC power by default, and it is free for 3 days, then 9 USD once per Mac plus tax. It does not keep Wi-Fi alive or wake a Mac that is already asleep. More on how to [keep a MacBook awake with the lid closed](/).

## FAQ

### How do I keep my Mac awake without downloading an app?

Turn on "Prevent automatic sleeping on power adapter when the display is off" in System Settings > Battery > Options, or run `caffeinate -i` in Terminal. Both work with the lid open.

### What is the Terminal command to keep a Mac awake?

`caffeinate -i`, which prevents idle sleep until you press Control-C. Add `-t 3600` for one hour, `-w PID` to wait for a process, or put a command after it.

### How do I stop my Mac from sleeping in System Settings?

On a laptop, open System Settings > Battery > Options and turn on "Prevent automatic sleeping on power adapter when the display is off". On a desktop, use "Prevent automatic sleeping when the display is off" in System Settings > Energy.

### How do I keep my MacBook awake while downloading?

Start the download through `caffeinate -i`, as in `caffeinate -i curl -L -O <url>`, or run `caffeinate -i -t` with a time longer than the download. Keep the lid open.

### Can I keep a MacBook awake with the lid closed without an app?

Yes, with closed-display mode (display, keyboard, mouse and power), or with `sudo pmset disablesleep 1`, which stays on until you run `sudo pmset disablesleep 0`.

## Sources

- [Apple Support: Set sleep and wake settings for your Mac](https://support.apple.com/guide/mac-help/set-sleep-and-wake-settings-mchle41a6ccd/mac)
- [Apple Support: If your Mac sleeps or wakes unexpectedly](https://support.apple.com/guide/mac-help/if-your-mac-sleeps-or-wakes-unexpectedly-mchlp2995/mac)
- [Apple Support: Change Battery settings on a Mac laptop](https://support.apple.com/guide/mac-help/change-battery-settings-mchlfc3b7879/mac)
- [Apple Support: Change Energy settings on a Mac desktop computer](https://support.apple.com/guide/mac-help/change-energy-settings-mchlp1168/mac)
- [Apple Support: Put your Mac to sleep or wake it](https://support.apple.com/guide/mac-help/put-your-mac-to-sleep-or-wake-it-mh10330/mac)
- [Apple Support: If your external display is dark](https://support.apple.com/en-us/102501)
- [Apple Support: Mac laptop operating temperatures](https://support.apple.com/en-us/102336)
- `man caffeinate`, `man pmset` and `man pgrep` on macOS
- [Apple open source: pmset.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmset/pmset.m) and [PMSettings.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmconfigd/PMSettings.m)
- [Apple developer docs: kIOPMAssertionTypePreventUserIdleSystemSleep](https://developer.apple.com/documentation/iokit/kiopmassertiontypepreventuseridlesystemsleep)
- [Keep Mac Awake: command line](https://keepmacawake.com/command-line.md)
