All guides

ONLINEHOURS GUIDES

Keep a Mac Awake: caffeinate and Caffeine

To keep a Mac awake, open Terminal and run caffeinate -d: the Mac and its display stay awake until you press Control-C. caffeinate -t 3600 does the same for one hour. Menu-bar apps such as Amphetamine, KeepingYouAwake or Caffeine do it with a click. Staying awake is not the same as being active, though: Slack and Teams can still show you as away.

Start 7-day free trialOne app, no card

caffeinate commands you will actually use

caffeinate is built into macOS. With no options it stops the Mac from idle sleeping for as long as the command runs. Press Control-C, or close the Terminal window, to stop it.

caffeinate -d also keeps the display awake. caffeinate -s keeps the whole system awake, but only while the Mac is on power. caffeinate -t 3600 stops after 3,600 seconds, one hour; combine it with the others, for example caffeinate -d -t 7200 for two hours with the screen on.

caffeinate -u tells macOS the user is active and turns the display on; on its own it lasts only five seconds unless you add -t.

Caffeine, Amphetamine and other menu-bar apps

Menu-bar apps such as Amphetamine, KeepingYouAwake or Caffeine put the same switch next to the clock: one click to stay awake, with timers like 1 hour or until a download finishes. They ask macOS for the same kind of “do not sleep” permission as caffeinate.

Pick one, not several: two keep-awake tools running together make it hard to tell which one is in charge when the Mac does fall asleep.

Does keeping your Mac awake keep Slack active?

Not on its own. caffeinate and the menu-bar apps stop the Mac from sleeping; they do not type or move the mouse. Slack still sets you to away after 10 minutes without activity on desktop, and Teams still switches to Away when your computer is idle or locked.

What a keep-awake tool does prevent is the instant switch to away when the Mac sleeps. If you also need to look active while you read or take a call away from the keyboard, you need something that sets your status, not just a screen that stays on. A mouse jiggler fakes the activity instead, with its own trade-offs, and the guide to keeping Slack active compares the methods that do set a status.

What happens when you close the lid

On a MacBook, closing the lid normally puts it to sleep whatever caffeinate says. The exception is closed-display (clamshell) mode, where the Mac is on power with an external display and keyboard connected.

So with the lid closed, Slack, Teams and ClickUp on that Mac go offline or away. To stay online during your hours with the lid closed, the status has to come from somewhere else: OnlineHours keeps Slack, ClickUp and Teams online from its own servers during the hours you choose, and stops outside them.

The same goes for tools that rely on your computer: Slack Green’s self-hosted version can run on it, Presence Scheduler’s optional extension keeps a Slack tab open on it, and OnlineHours’ experimental Google Chat extension needs it awake as well.

On Windows

Windows 11 has screen and sleep timeouts under Settings → System → Power & battery. For a one-off, Microsoft’s free PowerToys includes Awake, which keeps the PC awake indefinitely or for a set time without changing your power plan.

The same rule applies as on a Mac: an awake PC is not the same as an active Slack or Teams status.

Keep your status on your hours, laptop closed

OnlineHours sets Slack, Teams or ClickUp to online from its servers during the hours you choose, and stops outside them.

caffeinate and Amphetamine are free and right for keeping a Mac awake. They don’t set a status, and they stop when the lid closes.

One app, no card. Nothing is charged when it ends.

Common questions

Is caffeinate safe to use?

Yes. It is a built-in macOS command and stops as soon as you quit it. The only cost is battery: a Mac that never sleeps drains it faster.

Does caffeinate work with the lid closed?

Not on a MacBook by itself; closing the lid still puts it to sleep unless it is in closed-display mode with power and an external display.

Will Amphetamine or Caffeine keep me green on Slack?

They keep the Mac awake, but Slack can still mark you away after 10 minutes without activity. For a green dot during your hours, use a schedule that sets your status.

Related

Official sources