How to Use the macOS systemsetup Command to Manage System Settings

The Power Management Problem

If you are setting up a Mac Mini to act as a dedicated file server for a small office, it cannot behave like a normal laptop. If a normal MacBook sits idle for twenty minutes, the operating system will put the hard drive to sleep to save battery power. If it loses power during a thunderstorm, it will remain turned off until a human physically presses the power button.

A server cannot afford to sleep, and it cannot wait for a human to turn it back on. You can change these behaviors by clicking through the graphical “Energy Saver” and “Displays” menus in System Settings, but if you are configuring a fleet of fifty Macs over a remote SSH connection, you cannot use a mouse. To aggressively alter the foundational hardware behaviors of a Mac directly from the command line, you must use the systemsetup command.

Step 1: Open the Terminal

Because the systemsetup command physically dictates how the motherboard manages electricity and network hardware, almost every single command requires absolute root administrator privileges.

  1. Press Command + Space to open Spotlight Search.
  2. Type Terminal and press Enter.

Step 2: Preventing Sleep Mode

To ensure your Mac Mini file server never goes to sleep, you must override three different power timers: the display timer, the hard disk timer, and the computer sleep timer.

To check the current status of these timers, you can use the -get arguments:

sudo systemsetup -getsleep

If the terminal says it will sleep after 20 minutes, you must force it to “Never” sleep using the -set arguments.

sudo systemsetup -setsleep Never
sudo systemsetup -setdisplaysleep Never
sudo systemsetup -setharddisksleep Never

The Mac is now mathematically prohibited from entering a low-power state. It will remain running at full capacity 24 hours a day, 7 days a week, ensuring the office file share never drops offline.

Step 3: Auto-Booting After Power Failure

If a thunderstorm knocks out the power to the office building on a Saturday night, the Mac Mini will turn off. When the power comes back on five minutes later, the Mac will remain turned off until you drive to the office on Monday morning and press the power button.

You can use systemsetup to reprogram the physical logic board to automatically boot up the exact millisecond electricity flows back into the power cable.

sudo systemsetup -setrestartfreeze on
sudo systemsetup -setrestartpowerfailure on

The -setrestartpowerfailure command handles the thunderstorm scenario. The -setrestartfreeze command tells the Mac to automatically reboot itself if the operating system ever completely freezes or panics, completely eliminating the need for human intervention.

Step 4: Setting the Time Zone

If you are managing logs for a server, the timestamps must be perfectly accurate. If you shipped the Mac Mini from New York to a branch office in London, the computer’s internal clock will be completely wrong.

You can instantly dump a list of every valid time zone in the world:

sudo systemsetup -listtimezones

Once you find the correct formatted name (e.g., “Europe/London”), you can forcefully inject it into the system.

sudo systemsetup -settimezone "Europe/London"

The system clock instantly shifts to match British time, ensuring all of your automated cron jobs and server logs fire at the exact correct moment. By mastering systemsetup, you elevate a standard consumer Mac into a highly resilient, self-managing server.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.