How to keep your Mac awake
A download, a presentation, a long export — keep the Mac awake for exactly as long as you need.
macOS can stop sleep through System Settings or the caffeinate Terminal command. MacFixes does it from the menu bar — for a set time, until you turn it off, or while an app runs.
Part of MacFixes: 7 days free, then $2.99 a month or $17.99 once, with every app and fix included.
What macOS gives you
System Settings → Energy (desktop Macs) or Battery → Options (laptops, on the power adapter only) can stop automatic sleep, and Lock Screen sets when the display turns off. But changing them each time is a chore, and it’s easy to forget to change back. The Terminal command caffeinate keeps the Mac awake while it runs.
How MacFixes fixes it
- 1It’s already on“Keep awake” is on from the start. To turn it off, open MacFixes Settings → Everyday and use the switch on its row.
- 2Keep the Mac awakeFrom the menu bar panel, choose a time limit or leave it on until you switch it off.
- 3Or automate itKeep the Mac awake while a chosen app runs, or while it’s on the power adapter.
Why your Mac goes to sleep in the middle of something
macOS decides a Mac is idle when nobody has touched the keyboard, mouse or trackpad for a while. After that it turns the display off, and later it can put the whole Mac to sleep. Whether something is still working away in the background doesn’t come into it, unless the app doing the work tells macOS not to sleep.
Some apps do tell it. A video playing full screen or a presentation running in Keynote usually keeps the screen on, because those apps ask macOS to. Plenty of long jobs don’t ask: a large download in some apps, a script in Terminal, a render, a file copy to a network drive. Whether a job keeps the Mac awake is up to the app running it, which is why the same Mac stays on through a film and falls asleep halfway through an upload.
It helps to know there are two kinds of sleep. Display sleep only turns the screen off; the Mac keeps running, and a download carries on. System sleep pauses almost everything, and network connections drop, so a download or an upload stops until the Mac wakes. Most of the time it’s system sleep you need to prevent. Display sleep matters when someone has to see the screen — a presentation, a recipe, a dashboard on a wall.
Keeping a Mac awake with macOS’s own settings
On a MacBook, open System Settings → Battery → Options and turn on “Prevent automatic sleeping on power adapter when the display is off”. As the name says, it only works on the power adapter; on battery, a MacBook still sleeps when it’s idle.
On a desktop Mac, open System Settings → Energy and turn on “Prevent automatic sleeping when the display is off”.
For the screen, open System Settings → Lock Screen and set when the display turns off when inactive, separately for battery and the power adapter on a laptop. Set it to Never and the screen stays on — until you remember to put it back.
These are settings, not switches. They’re right if you want the Mac never to sleep, and clumsy if you want it awake for the next two hours: you change them, the job finishes, and the Mac stays awake for weeks because nobody changed them back.
The Terminal way: caffeinate
macOS has a command built in for exactly this. Open Terminal and type caffeinate, and the Mac won’t sleep from idleness until you press Control-C or close the window. Its options choose what to prevent and for how long:
caffeinate -d keeps the display on as well. caffeinate -t 3600 keeps the Mac awake for 3,600 seconds — an hour — and then stops by itself. caffeinate -s prevents system sleep entirely, but only while the Mac is on the power adapter. Options combine, so caffeinate -d -t 7200 keeps the screen on for two hours.
Tie it to a job. Put caffeinate in front of a command and the Mac stays awake exactly as long as that command runs: caffeinate -i followed by your script, backup or build. Or keep the Mac awake until an app that’s already running quits with caffeinate -w and the app’s process ID, which Activity Monitor shows in its PID column.
caffeinate is reliable and costs nothing. The catch is that it lives in a Terminal window you have to keep open, and nothing on screen reminds you it’s running.
Doing it from the menu bar with MacFixes
Keep awake is on from the start in MacFixes and has its own card in the menu bar panel. From there you can keep the Mac awake for a set time, or until you switch it off — the two things people most often reach for caffeinate to do, without Terminal.
It can also do it automatically: while apps you choose are running, while the Mac is on the power adapter, or while an external display is connected. Choose your video editor, say, and the Mac stays awake whenever it’s open and goes back to its usual sleep settings when you quit it. Your System Settings stay as they are the whole time.
It needs no permissions.
When the Mac still sleeps, or won’t
Closing a MacBook’s lid sleeps it. Keep awake doesn’t change that, and neither do the settings above. Apple’s supported way to keep a MacBook running with the lid shut is closed-display mode: plugged into power, with an external display, keyboard and mouse or trackpad connected.
On battery, awake costs charge. A Mac kept awake on battery drains it faster, and when the battery runs low macOS sleeps the Mac anyway. Keeping it awake only on the power adapter is the safe choice for a laptop.
The screen may lock even while the Mac is awake. Keeping the Mac awake isn’t the same as keeping the screen unlocked; Lock Screen’s settings decide when a password is asked for.
If the Mac won’t sleep when you want it to, something is holding it awake. Activity Monitor’s Energy tab has a Preventing Sleep column that shows which apps are, and pmset -g assertions in Terminal lists every reason macOS currently has for staying awake. A forgotten caffeinate shows up there too — and check the Keep awake card in the menu bar panel in case it’s still on.
Sleep brings its own small problems, and two have fixes of their own. If your headphones keep connecting to the Mac while it’s asleep instead of to your phone, turn Bluetooth off for as long as it sleeps. And on a desk with several monitors, if they come back from sleep in the wrong order, keep your display arrangement.
Permissions, and turning it off
To stop using it, open MacFixes Settings → Everyday and use the switch on the “Keep awake” row.
Questions
How do I stop my Mac from going to sleep?
On a MacBook, turn on “Prevent automatic sleeping on power adapter when the display is off” in System Settings → Battery → Options; on a desktop Mac, the same setting is in System Settings → Energy. For a while rather than for good, use caffeinate in Terminal, or Keep awake in MacFixes’ menu bar panel.
What does caffeinate do on a Mac?
It’s a Terminal command built into macOS that stops the Mac sleeping while it runs. caffeinate -d also keeps the display on, -t sets a time limit in seconds, and putting it in front of another command keeps the Mac awake until that command finishes.
Does closing the lid still sleep the Mac?
Yes. Keep awake stops idle sleep; closing a MacBook’s lid still sleeps it. Apple’s supported way to keep a MacBook running with the lid shut is closed-display mode — power, an external display, keyboard and mouse or trackpad connected.
Will my download continue if the display turns off?
Yes, if only the display has gone to sleep. If the whole Mac sleeps, network connections drop and the download stops until it wakes, unless the app resumes it.
Can I keep it awake only while one app is open?
Yes. Keep awake can stay on while apps you choose are running, and stop when they quit.
What does it cost?
Keep awake comes with MacFixes: 7 days free, then $2.99 a month or $17.99 once. It’s on from the start.
More fixes macOS doesn’t give you
One of 47 fixes and 10 apps in MacFixes. Every fix · Every app · Something else your Mac won’t do? Request it.
Keep your Mac awake with MacFixes
MacFixes has 47 fixes for things macOS gets wrong or leaves out. Add only the ones you want. Free for 7 days, then $2.99 a month or $17.99 once. macOS 14 Sonoma or later.