Automatic Wake-on-LAN for macOS
Automatically wake your server, desktop, or any WoL-enabled device when your Mac wakes from sleep.
Thanks to feedback from the community: Using WoL with a NAS that stores critical data may not be ideal. Here's why:
- Availability: If you need remote access, a sleeping NAS won't be reachable
- Drive health: Frequent spin-up/down cycles can reduce drive lifespan
- Reliability: WoL can fail due to network issues or power settings
- Backups: Scheduled backup jobs may fail if NAS is asleep
- RAID: Array maintenance and rebuilds need consistent uptime
Better use cases for this tool:
- Home servers (media, development, testing)
- Desktop computers you want to wake remotely
- Lab/test machines that don't store critical data
- Any device where convenience > 24/7 availability
For NAS with important data: Consider keeping it awake 24/7. The power cost is worth the reliability.
I built this to automatically wake devices when opening my MacBook, eliminating the manual step of using WoL apps. While I originally designed it for my NAS, community feedback helped me realize it's better suited for non-critical devices where convenience matters more than constant availability.
brew tap dgeske/tap
brew install wake-my-nas
wake-my-nas --discover # Find your device's MAC address
wake-my-nas --edit # Set MAC (IP optional)
wake-my-nas-install-service # DoneYour device now wakes automatically when your Mac wakes.
Security Note: macOS will show wake-my-nas as "item from unidentified developer" in Login Items (System Settings). This is normal for open-source scripts that aren't code-signed. The script is open source - you can review the code at any time.
Find your device on the network:
wake-my-nas --discoverWhen you run wake-my-nas --edit, set these values:
TARGET_MAC="00:11:22:33:44:55" # Required: Your device's MAC address
TARGET_IP="192.168.1.100" # Optional: Skip if device already awake
EXPECTED_SSID="YourHomeNetwork" # Optional: Only run on this Wi-Fi
EXPECTED_SUBNET="192.168.1" # Optional: Only run on this subnetEnable Wake-on-LAN on your device:
- Synology NAS: Control Panel → Hardware & Power → Enable Wake on LAN
- Other devices: Check BIOS/network settings
- Must be connected via Ethernet (Wi-Fi doesn't support WoL)
tail -f /tmp/wake-my-nas.loglaunchctl unload ~/Library/LaunchAgents/com.github.wake-my-nas.plist
rm ~/Library/LaunchAgents/com.github.wake-my-nas.plist
brew uninstall wake-my-nas- Mac wakes (lid open, power button, etc.)
- Checks if you're on the right network
- Pings device to see if already awake
- Sends WoL packet only if needed
Wake-on-LAN, WoL, server automation, automatic wake, Mac sleep wake, LaunchAgent, magic packet, home server, macOS automation, desktop wake, remote wake
Thanks to the r/synology community for valuable feedback about NAS reliability and helping refine the use cases for this tool.
Public domain. Do whatever you want.