How to stop Mac from sleeping guide
Sleep mode is a mode of macOS in which the display turns off, the processor runs in power-saving mode, and the hard drive and some background processes are paused.
Is sleep mode useful? Absolutely. Is sleep mode sometimes annoying? Also yes, and here’s why.
- If your job requires you to use a computer occasionally (e.g., periodically enter data), it takes constant clicking to wake the Mac up.
- The computer may fall asleep while downloading or uploading a large file, and the process may fail.
- You may miss important notifications, and so on.
So, we need to deal with this. By the end of this article, you'll also know 7 ways of how to stop your Mac from sleeping.
#1. One-click solution to prevent your Mac from sleeping
Let me start with a simple solution.
[I will definitely show you how to set up sleep modes using standard Mac tools in the next section, but believe me, this method is a piece of cake.]
The tool I recommend is Lungo – an app that prevents your Mac from sleeping for as long as you want. And all it takes is a few clicks.
- Install Lungo.
- Click an icon with a cup of coffee that appears in the menu bar. Set the wake-up time you want, from 10 minutes to indefinite. Simple, isn't it?
Lungo is free for 7 days if you download it from Setapp. Along with Lungo, you'll get 240+ other apps for Mac and iPhone that are also free and available without limitations during the trial period.
#2. How to change sleep time on macOS Ventura and macOS Sonoma?
Now, let’s explore Mac’s built-in tools. The settings differ slightly from OS to OS. macOS Sonoma and macOS Ventura (the two of the latest versions of macOS at the time of writing) let you customize your battery and power settings in a similar way.
Here’s how to turn off sleep mode on Mac with macOS Ventura and Sonoma:
- Click the Apple logo in the upper-left corner of the screen.
- Click System Settings.
- Scroll down the sidebar and click on Lock Screen.
- Find the line "Turn display off on power adapter when inactive" in the right panel and click on the drop-down next to it.
- Set the sleep time by selecting the desired option in the drop-down window (from 1 minute to never).
- Find the line "Turn display off on battery when inactive" and repeat step 5.
#3. How to keep MacBook from sleeping on macOS Big Sur and Monterey
Big Sur and Monterey have similar systems for changing sleep patterns.
Here’s how to change sleep time on Mac while running on battery power:
- Click the Apple logo in the upper left corner and go to System Preferences.
- Click Battery.
- Move the slider at the top of the screen to Never.
And here’s how to prevent your Mac from sleeping while running on battery power:
- Click the Apple logo in the upper left corner and go to System Preferences.
- Click Battery.
- Choose Power Adapter from the sidebar menu on the left.
- Move the slider to adjust the display off time.
#4. How to make Mac not sleep on macOS Catalina and older
macOS Catalina and older versions have a slightly different design, but the essence of the settings is the same: to set up separate battery and mains operations.
- Click on the Apple icon.
- Choose Setting Preferences.
- Click Energy Saver.
- Move the slider at the top of the screen to Never.
- Check the boxes next to all the lines you see.
#5. How to prevent Mac from going to sleep when closing the lid
By default, your Mac goes to sleep as soon as you close the lid. This is logical and good: the battery is saved, and after opening the lid, you just need to enter the password and continue working. But if, for example, you use an additional monitor for work and want to close the laptop, you don't want your Mac to switch to sleep mode. Let’s discover how to set it up.
macOS Sonoma: keep awake when lid closed
Here's how to stop your Mac from sleeping with the lid closed on macOS Sonoma:
- Go to the Apple menu > System Settings.
- Choose Battery in the sidebar.
- Then click Options.
- Enable "Prevent automatic sleeping on power adapter when the display is off".
- Click Done to save changes.
macOS Ventura: keep awake when lid closed
Here's how to keep Mac from sleeping with the lid closed on macOS Ventura:
- Go to the Apple menu > System Settings.
- Choose Displays in the sidebar.
- Then click Advanced.
- Check "Prevent automatic sleeping when display is off".
- Click Done to save changes.
macOS Monterey and earlier: keep awake when lid closed
Here's how to stop your Mac from sleeping with the lid closed on macOS Monterey and earlier:
- Click the Apple icon in the upper left corner of the screen.
- Choose System Preferences.
- Click on Energy Saver.
- Find the line "Prevent your Mac from automatically sleeping when the display is off," select the checkbox and confirm.
#6. How to prevent Mac from sleeping with Terminal
If you want to make temporary changes to the sleep settings, you can do this through the Terminal. The changes will be active as long as the Terminal window is open.
- Open Terminal (type “Terminal” in the search bar in Launchpad).
- Enter the following command in the Terminal: caffeinate -d.
- If you want to keep your laptop awake for a certain amount of time, type caffeinate -t X, where X is the number of seconds.
#7. How to schedule sleep on your Mac
If your Mac runs macOS Monterey and some earlier, you can set up your computer to turn on and off at the same time consistently. Here's how to set up a power-on and power-off schedule:
- Click the Apple icon > System Preferences.
- Click on Energy Saver.
- Click on Schedule.
- Set the necessary parameters:
- Start or wake: on weekdays, weekends, every day, or on a specific day.
- Sleep, restart, or shut down: on weekdays, weekends, every day, or on a specific day.
In macOS Sonoma, this feature has been removed, but you can still use terminal commands to schedule startup and shutdown times.
- Open Terminal.
- Enter the command sudo pmset repeat sleep MTWRFSU 22:00:00. This will make your Mac switch to sleep mode every day at 10 PM. You can customize this command with slight changes.
- Press Enter.
- Type your admin password and press Enter.
You can replace sleep with wake, shutdown, or wakeorpoweron and adjust the time and days accordingly.
MTWRFSU stands for the days of the week, and you can exclude any if you want to.
To check the schedule, enter the following command: pmset -g sched. If you need to cancel it, enter sudo pmset schedule cancelall.
Bonus: How to change sleep mode on Mac
Did you know that you can actually choose the sleep mode type for your Mac?
Macs have three sleep modes, one of which will be the default depending on your macOS type. Check yours, and then compare it to our explanation below.
- Click on Launchpad (it's an icon with a total of nine squares of different colors on the Dock).
- Type "Terminal" in the search bar and open Terminal.
- Enter the following combination: pmset -g | grep hibernatemode and press Enter.
The Terminal will show you the sleep mode for your Mac:
- hibernatemode 0 (standard sleep)
- hibernatemode 1 (hibernate mode for pre-2005 portable MacBooks)
- hibernatemode 3 (safe sleep)
- hibernatemode 25 (for post-2005 MacBooks).
Let's take a closer look at them.
Let’s compare! | Standard sleep | Hibernate mode | Safe sleep |
RAM | On | Off | On |
Data processing | Unsaved files, documents, and processes are stored in RAM. | Before hibernating, the startup drive saves data from the RAM. | Startup drive saves data from the RAM. |
Wake-up time | Fast | Longer (Mac copies data from the disk back to RAM) | Fast |
You can change the sleep mode on your Mac by entering the following command at the Terminal: sudo pmset hibernatemode X
Choose the best solution how to stop Mac from sleeping
So, the answer to your question, "Why does my Mac keep going to sleep?" is that it's all about your settings. In general, there are three ways to change sleep settings.
- System Settings (differ from macOS to macOS). Usually, you need to go to System Preferences > Lock Screen / Battery / Energy Saver > Battery or Power.
- Terminal. Enter the caffeinate -d command and press Enter.
- Lungo and OneSwitch. These apps free you from digging through the settings and are the easiest way to customize your sleep mode.
Both Lungo and OneSwitch are available on Setapp along with 240+ other apps that solve a variety of Mac, iPhone, and iPad tasks. All apps are free during a seven-day trial.
FAQ
How do I make my Mac stay awake longer?
To make your Mac stay awake longer:
Go to System Settings > Lock Screen.
Find the line "Turn display off on power adapter when inactive" in the right panel and click on the drop-down next to it.
Set the sleep time to 3 hours or Never.
Find the line "Turn display off on battery when inactive" and repeat step 3.
How do I change how long my Mac screen stays on?
To change how long your Mac screen stays on, set this in System Settings > Lock Screen.
Here's what you should know:
- By default, your Mac can stay awake for up to 3 hours before it falls asleep. You can also make it never turn off the display — there is nothing in between.
- For more flexible customization, use third-party apps Lungo and OneSwitch. Lungo keeps your Mac awake for 1, 2, 4, 8, or 12 hours, or indefinitely. One Switch lets you keep your Mac awake for 5 minutes, 30 minutes, 1 hour, 2 hours, 5 hours, or 8 hours. With One Switch, your Mac can stay awake even when its lid is closed.
How to put Mac to sleep with keyboard?
To put Mac to sleep with the keyboard, press Option + Command + power button.
How do I stop my Mac from sleeping when the display is off?
To stop your Mac from sleeping when the display is off:
Go to System Settings > Battery.
Scroll down and click Options.
Turn on Prevent automatic sleeping on power adapter when the display is off.
Is the turn off display the same as the sleep Mac?
Turn off display is not the same as the sleep Mac. When you turn off the display, all computer functions continue to run. Sleep puts your Mac into a low-power state to save power. Most system functions are paused.