This macOS hack stops your Mac putting itself to sleep
Learn how to stop your Mac sleeping using the 'caffeinate' Terminal command
Here at Tom’s Guide our expert editors are committed to bringing you the best news, reviews and guides to help you stay informed and ahead of the curve!
You are now subscribed
Your newsletter sign-up was successful
Want to add more newsletters?
Daily (Mon-Sun)
Tom's Guide Daily
Sign up to get the latest updates on all of your favorite content! From cutting-edge tech news and the hottest streaming buzz to unbeatable deals on the best products and in-depth reviews, we’ve got you covered.
Weekly on Thursday
Tom's AI Guide
Be AI savvy with your weekly newsletter summing up all the biggest AI news you need to know. Plus, analysis from our AI editor and tips on how to use the latest AI tools!
Weekly on Friday
Tom's iGuide
Unlock the vast world of Apple news straight to your inbox. With coverage on everything from exciting product launches to essential software updates, this is your go-to source for the latest updates on all the best Apple content.
Weekly on Monday
Tom's Streaming Guide
Our weekly newsletter is expertly crafted to immerse you in the world of streaming. Stay updated on the latest releases and our top recommendations across your favorite streaming platforms.
Join the club
Get full access to premium articles, exclusive features and a growing list of member rewards.
If you want to stop your Mac sleeping, there's a couple of ways you can go about it. The first and most obvious way is to go through the System Preferences Power menu and change the amount of time until the Mac goes to sleep to "Never".
However, there is a common scenario where that method just won't work: if you don't have system admin rights. The Power menu, where you adjust the sleep timer preferences, can be locked behind an administrator password. If you're on a machine managed by an employer (like me), or you're using a Mac owned by someone else, you may not be able to change the display timer settings. For me, this leads to my MacBook Pro always going to sleep after 2 minutes when I'm not plugged in.
Thankfully, there's a way you can get around this using a simple Terminal command.
Here's how to stop your Mac sleeping using Terminal.
How to stop your Mac sleeping using 'caffeinate' in Terminal
1. Open Terminal. If you're not sure how, read our guide on how to open Terminal on Mac.
2. Type "caffeinate" and hit Enter.
And you're done. Your Mac will now stay awake as long as you don't close the lid on a MacBook. To decaffeinate, with the Terminal window open, press Cmd + W and click Terminate.
Get instant access to breaking news, the hottest reviews, great deals and helpful tips.
Now that you know how to stop your Mac sleeping, why not read our other macOS guides. We can show you how to clear the cache on Mac and how to reset the SMC on a MacBook Pro — both will help you speed up a sluggish Mac. We can also show you how to change the screenshot location on Mac and how can you set default apps on Mac.
Next: learn how to use the Automator on Mac to simplify your processes.

Peter is a Senior Editor at Tom's Guide, heading up the site's Reviews team and Cameras section. As a writer, he covers topics including tech, photography, gaming, hardware, motoring and food & drink. Outside of work, he's an avid photographer, specialising in architectural and portrait photography. When he's not snapping away on his beloved Fujifilm camera, he can usually be found telling everyone about his greyhounds, riding his motorcycle, squeezing as many FPS as possible out of PC games, and perfecting his espresso shots.
