Making a Linux home server sleep on idle and wake on demand — the simple way 2023-04-16 in linux, backup, networking, wireshark, ruby, wake-on-lan, efficiency, homelab It began with what seemed like a final mundane touch to my home server setup for hosting Time Machine backups: I wanted it to automatically sleep when idle and wake up again when needed. You know, sleep on idle — hasn’t Windows had that built in since like Windows 98? How hard could it be to configure on a modern Ubuntu install? To be fair, I wanted more than just sleep on idle, I also wanted wake on request — and that second bit turns out to be the hard part. There were a bunch of dead ends, but I stuck out it to find something that “just works” without the need to manually turn on the server for every backup. Join me on the full adventure further down, or cut to the chase with the setup instructions below. tl;dr Home Server PC- High power consumption!- Ubuntu Linux- Mostly sleeps, wakes up on demandWake-on-LAN: unicast packetsRaspberry Pi (or similar)- Low power consumption- Ubuntu Linux- Always-onSSHAFP...Network servicesNetwork servicesARP Stand-inAvahi...Time machine backupsARP queries for HomeServermDNS queries for Home Server Outcome: Server automatically suspends to RAM when idle Server automatically wakes when needed by anything else on the network, including SSH, Time Machine backups, etc. You’ll need: An always-on Linux device on the same network as your server, e.g. a Raspberry Pi A network interface device for your server that supports wake-on-LAN with unicast packets On the server: Enable wake-on-LAN with unicast packets (not just magic packets), make it persistent sudo ethtool -s eno1 wol ug sudo tee /etc/networkd-dispatcher/configuring.d/wol << EOF #!/usr/bin/env bash ethtool -s eno1 wol ug || true EOF sudo chmod 755 /etc/networkd-dispatcher/configuring.d/wol Set up a cron job to sleep on idle (replace /home/ubuntu with your desired script location) tee /home/ubuntu/auto-sleep.sh << EO...
First seen: 2025-09-02 20:52
Last seen: 2025-09-03 07:54