Warning icon
Russia has attacked Ukraine. Here’s what MacPaw and Setapp are doing to make sure our team members and infrastructure are safe.

How to use a shutdown timer on Mac

6 min read

Most of the time, Macs are good at preserving the energy they use. By default, after a few minutes of inactivity, you can see your screen dimming, then showing a screen saver, and eventually turning off and putting the Mac itself to sleep. 

The key word here is inactivity. Your Mac naturally doses off when it has nothing to do. However, when it’s tasked with something like playing a video or a podcast, it’ll stay turned on forever (or until the battery runs out if it’s a MacBook). 

In some cases, it might be beneficial to set a power schedule, so that your Mac can shut down automatically. For example, you might like to fall asleep to music, or sounds of nature (coming from your Mac), or a TV show, or a movie. 

If you use a platform like YouTube, it’ll continue to autoplay videos for hours, preventing your Mac from falling asleep. In cases like that, you might want to set Mac to turn off at a certain time. 

Luckily, you have plenty of options to enable a Mac shutdown timer. Let’s review the best ones so you can learn to schedule Mac to turn off at any time. 

How to make Mac shutdown timer

If you want to enable auto shutdown on Mac, you have four primary options:

  1. Use a built-in shutdown timer within Energy Saver
  2. Create your own shutdown timer in Terminal
  3. Automate shutting down with a third-party app
  4. Use third-party apps to put your Mac to sleep rather than shut it down (might be better for your Mac too)

So here’s how to shutdown MacBook Pros, iMacs, and other Macs at some point in the future. To shut down your Mac right now, just click the Apple icon in the menu bar and select Shut Down… 

How to schedule Mac shutdown in one click

Listing your Mac shutdown timer options from the easiest to the more difficult, the first would definitely be using a preset shortcut in Almighty. 

Almighty is the easiest way to unlock over 50 custom shortcuts for your Mac. This lightweight utility lives in your menu bar and makes lots of useful and complex actions accessible in just a single click. 

For example, you can use the Almighty icon in the menu bar to lock your keyboard, automatically convert all copied text into plain text, stop apps from opening automatically, and schedule auto shutdown. 

To enable a shutdown timer: 

  1. Launch Almighty
  2. Search shutdown in the app
  3. When you find “Schedule shutdown,” click to open settings 
  4. Specify how far into the future the shutdown should occur and record a shortcut if necessary
  5. Activate the scheduled shutdown with your shortcut or via the app’s menu bar icon

scheduled shutdown

How to use a built-in power schedule

You might be surprised to know that Mac already features a way to determine its power schedule. You can do so through the Energy Saver menu in System Preferences. 

To see how to shutdown MacBook Pro or other Macs: 

  1. Open System Preferences ➙ Energy Saver
  2. Switch to the Schedule tab
  3. Check Sleep and replace it with Shut Down in the dropdown menu
  4. Specify the exact date and time you’d like your Mac to shut down automatically
  5. Click Apply

shut down automatically with Energy Saver settings

How to make your own shutdown timer using Terminal

For users familiar with CLIs (command-line interfaces), it’s also possible to set Mac to turn off at a certain time with Terminal. 

You can use the shutdown command, adding specific options to it: 

  • -h lets you set a timer
  • -r will restart your Mac instead of shutting it down
  • -s will put your Mac to sleep

To add time in Terminal, use + followed by the number of minutes, like +15 (in 15 minutes). 

So to enable a built-in shutdown timer in Terminal: 

  1. Launch Terminal from Utilities
  2. Type: sudo shutdown -h +60 (for your Mac to shut down in one hour)
  3. Press Return
  4. Enter your user password

Terminal shutdown command

If you’ve done everything right, Terminal would acknowledge your command and give you its reference number, also known as pid.

How to generate a desktop shortcut for the shutdown timer

Once you get used to setting a shutdown timer with Terminal, you might wonder if you can do it faster than retyping the command all the time. Yes, you can! 

Essentially, it’s possible to create a text file on your Desktop with all the shutdown instructions inside. Once you open the text file, the command would automatically execute. Sounds great?

Here’s how to create a shortcut to schedule Mac to turn off: 

  1. Open a new file in TextEdit 
  2. Type #!/bin/bash at the very top
  3. Press Return twice to type on the third file. Enter the usual Terminal shutdown command, such as sudo shutdown -h +60
  4. Save your file with the .txt extension

create a shortcut to schedule Mac to turn off

Now you have to change Terminal directly to the Desktop:

  1. Launch Terminal
  2. Go to Desktop by typing cd /Users/[your username]/Desktop
  3. Press Return
  4. Type chmod 774 shutdown
  5. Press Enter

Now double-click on your Desktop text file and the timer will begin. 

You can even simplify the process further by assigning a special keyboard shortcut to open your TextEdit file. To do so, you’ll need to use Keysmith. 

Keysmith is an amazing app that turns anyone into a Mac power user in minutes. It allows you to record macros, or action sequences, of any complexity and assign keyboard shortcuts to them. Moreover, shortcuts can be universal or app-specific. 

To add your shutdown timer as a shortcut: 

  1. Launch Keysmith
  2. Click New Macro
  3. Name your shortcut and assign it a unique keyboard sequence
  4. Then click Record and double-click on your TextEdit file
  5. Click “Stop recording” 

shutdown timer macros

Now you can use your shortcut anywhere to open your TextEdit file, which will start the power schedule you’ve assigned. 

How to disable a shutdown timer

Knowing how to set a shutdown timer for Mac is great, but you should, of course, also know how to disable a shutdown timer. 

To disable a shutdown timer, you need to use the sudo kill pid command, where pid is the reference number given to you after you’ve set the timer command in Terminal for the first time: 

  1. Open Terminal 
  2. Type sudo kill 434 (or your exact pid number)
  3. Press Return

disable a shutdown timer

Note: If you don’t remember the pid number, just use sudo killall shutdown instead.

Useful shutdown alternatives for Mac

Before you create your Mac shutdown timer, you should consider whether you need to actually shut down your Mac at all. 

Putting your Mac in sleep mode might be a much better option: 

  • Your Mac can sync and receive app updates for Mail, Calendar, Notes, and other apps while sleeping
  • You can resume work instantly
  • Energy savings from shutting down are minimal 
  • Sleep mode doesn’t affect your Mac’s longevity

So there are practically no benefits to shutting your Mac down. 

Instead, you should try to find an easy way to put your Mac to sleep, which you can do in two clicks with apps like Quit All and One Switch. 

Quit All is a nifty utility that lets you quit all the active apps at once, so you can reset your workspace. It lives in your menu bar and works flawlessly with just one click. 

quit all the active apps at once

One Switch is another widely useful utility that enables you to keep the most important operational switches in one spot, from locking your keyboard to locking your screen, or putting your display to sleep. You can customize all actions as you see fit, and create your own workflow. 

macOS switches in one spot

So the ideal way to end your day on Mac can be clicking once on Quit All to shut down all apps and then clicking on One Switch to put your Mac to sleep — all within your menu bar. 

Master your Mac’s power schedule

As you can see, there are more than a few ways to set a shutdown timer for your Mac, from doing so with Energy Saver to using Almighty and Terminal. You can also create completely custom shortcuts with Keysmith. However, the most convenient option for everyday users would be to combine Quit All and One Switch to put their Macs to sleep. 

Best of all, Almighty, Keysmith, One Switch, and Quit All are available to you for seven days absolutely free through the trial of Setapp, a platform with more than 230 top-of-the-line Mac apps out there. Download all these apps at no cost and test them out today for yourself!

Get 230+ Mac apps for any job

Sign up to Setapp and try them for free.