Skip to Content
Sindre Sorhus
Back to Lungo

Updated

How to Keep Your Mac Awake

By Sindre Sorhus, who makes the Lungo app

With Lungo

  1. Open Lungo. Its icon is in the menu bar.
  2. Click the icon, and below “Keep this Mac awake”, choose a duration, like “1 Hour”, or “Indefinitely”.
  3. Your Mac and its screen stay awake until the time ends. To stop earlier, click the icon, and choose “Deactivate”.

Lungo is useful for presentations, long downloads, and reading without touching the keyboard. In the settings, you can:

  • Turn on “Activate on left-click”, so one click turns it on and off.
  • Set a keyboard shortcut to turn it on and off.
  • Turn on “Allow display to sleep while keeping computer awake”, so the screen turns off, but the downloads and other tasks continue.
  • Turn on “Deactivate when switching to battery”, so it does not empty the battery.

For a duration that is not in the menu, use the “Set Enabled State” action of Lungo in the Shortcuts app. The “Enable Lungo until time” shortcut asks for a time, and keeps the Mac awake until then. To keep the Mac awake only while an app is open, like Keynote, use a Shortcuts automation.

Amphetamine is a popular free app for this, with triggers and support for a closed lid. Its last update was in November 2023.

Keep your Mac awake with the lid closed

When you close the lid of a MacBook, macOS puts it to sleep. Lungo can keep it awake only when the Mac is connected to a charger and an external display, as the App Store does not allow apps to keep a closed MacBook awake. Why Lungo does not do more.

The menu of Lungo with the times to keep the Mac awake

Get Lungo

Prevent your Mac from going to sleep

Download on the App StoreDownload on Setapp

$4, one-time purchase

Requires
macOS 26 or later
Family Sharing
Yes
Updated
September 2026
US App Store rating
4.9/5 (228 ratings)

More about Lungo

Without an app

Terminal: The caffeinate command of macOS keeps the Mac awake while it runs. Open the Terminal app, and run:

Terminal
caffeinate -di

-d keeps the screen on, and -i keeps the Mac from going to sleep. Press ControlC, or close the window, to stop it. To stop after a time, add the number of seconds, like caffeinate -di -t 3600 for one hour. To keep the Mac awake only while a long task runs, put the command of the task after caffeinate -i, like caffeinate -i claude for Claude Code. Your Mac stays awake until the command ends, like when the AI agent is done.

System Settings: To change the sleep settings for all tasks, not only one:

  1. Open “System Settings › Lock Screen”, and set “Turn display off when inactive” to a longer time, or “Never”. A MacBook has one setting for battery and one for the power adapter.
  2. On a MacBook, open “System Settings › Battery”, click “Options”, and turn on “Prevent automatic sleeping on power adapter when the display is off”. On a desktop Mac, open “System Settings › Energy”, and turn on “Prevent automatic sleeping when the display is off”. Apple

The settings are good when your Mac must always stay awake, like a Mac mini that is a server. For a meeting or a download, it is easier to turn on Lungo or caffeinate for that time, and not to remember to change the settings back.

When the Mac is awake, but asks for your password after the screen saver or after the display turns off, see how to stop your Mac from locking.