How to Set Up Automatic Restart of your Mac After an Unexpected Shutdown

This article explains how you can set your Mac to restart automatically after a power outage.

A lot of things (weather conditions, wild animals, human errors, equipment failure, etc) can cause a power outage. When this occurs, your Mac will be forced to shut down unexpectedly. Unless you turn on your Mac by pressing the power button, your computer will remain powered off. And this can be bad for you, for example, because you may work remotely and need to access your Mac remotely.

There is a way. In fact there are two ways to do this:

  • Use Terminal
  • Use Energy Saver


You can use Terminal to set your Mac to automatically turn on after a power outage. Terminal offers a lot of customizations. Here is how:

Open Terminal on your Mac (Applications/Utilities folder). Use one of these commands (enter the command and hit enter, enter your passcode if asked):

Please note that if the % sign is already pre-typed in the Terminal app, do not enter it. Otherwise, Terminal will give you error messages like “command not found” etc.

Check this see if automatic restart is enabled

Enter the following command to see if your Mac is set to restart after a power failure. The result will say on or off.

% sudo systemsetup -getrestartpowerfailure
Check to see if automatic restart enabled

Enable or disable Mac to restart after a power failure

If you want to enable this, enter this code and hit enter:

% sudo systemsetup -setrestartpowerfailure on

And, enter this to disable it:

% sudo systemsetup -setrestartpowerfailure off
Turn off and on Automatic Restart

Check to see how long Mac waits to restart after a power failure

You can set a time in seconds before the computer starts. You can see if this is set:

% sudo systemsetup -getWaitForStartupAfterPowerFailure
Wait time after a power failure

How to set how long Mac waits to restart after a power failure

You can set a time. This must be 0 (zero) or a multiple of 30 seconds, such as 60 etc:

% sudo systemsetup -setWaitForStartupAfterPowerFailure seconds

seconds is the number, for example:

% sudo systemsetup -setWaitForStartupAfterPowerFailure 30

Energy Saver

You can use Energy Saver to do this too. But, unlike the Terminal method explained above, this method does not offer a lot of customizations. Here is how:

Open System Preferences and click Energy Saver.

And then ensure that “Start up automatically after a power failure” is selected.

Start up automatically

See also

Dr. Serhat Kurt worked as a Senior Technology Director. He holds a doctoral degree (or doctorate) from the University of Illinois at Urbana / Champaign and a master’s degree from Purdue University. Here is his LinkedIn profile.

Thank you for choosing to leave a comment.

Please note the following:

  • All comments are moderated.
  • Your email will NOT be published nor shared.
  • All SPAM comments will be deleted.
  • Please see our comment policy page for more info.

Leave a Comment