Wake-on-LAN over Tailscale: wake your computer from your phone
How Wake-on-LAN works and why it stops at your router, how to wake a computer from anywhere through an always-on relay in your tailnet, setup on Windows, Linux and macOS, and a checklist.
Your computer at home is asleep, and you need it — to grab a file, start a build, or let a coding agent get to work. Wake-on-LAN can switch it on remotely, but the classic “magic packet” only works on the local network. Here is how to make it work from anywhere with Tailscale, how to set up the computer on Windows, Linux and macOS, and what to check when it does not wake.
1. How Wake-on-LAN works
A sleeping or powered-off computer keeps its network card on standby. The card listens
for one specific frame: the magic packet — six bytes of
FF followed by the card's MAC address repeated sixteen times. When it sees
it, it wakes the machine.
The packet is a broadcast on the local network. Routers do not forward broadcasts, and the sleeping computer is not running Tailscale or anything else that could receive a packet from outside. So you cannot wake it directly from your phone over the internet.
2. Why Tailscale alone cannot wake a sleeping computer
Tailscale connects devices that are running. The sleeping computer's
tailscaled is asleep with it, so its tailnet address leads nowhere. The fix
is a relay on the same home network — a device that is always on, is in
your tailnet, and sends the magic packet on your behalf:
- a Raspberry Pi or any small Linux box,
- a NAS (Synology, QNAP and others run Tailscale and often have WoL built in),
- a router with Tailscale or a WoL page in its admin interface (OpenWrt, many FRITZ!Box and ASUS models).
The phone reaches the relay over Tailscale; the relay wakes the computer over the local network.
3. Prepare the computer you want to wake
Use Ethernet. Wake-on-LAN over Wi-Fi exists on some hardware, but it is unreliable enough that it is not worth debugging. Note the MAC address of the wired network card — you will need it.
In the BIOS/UEFI (desktops especially), turn on the option called Wake on LAN, Power On By PCI-E or similar, and turn off deep power saving modes such as ErP, which cut power to the network card.
Windows:
- Device Manager → Network adapters → your Ethernet card → Properties.
- Power Management: check Allow this device to wake the computer and Only allow a magic packet to wake the computer.
- Advanced: set Wake on Magic Packet to Enabled.
- To wake from full shutdown, turn off Fast startup (Control Panel → Power Options → Choose what the power buttons do). Waking from sleep works without this.
Linux:
# check: "Wake-on: g" means magic packet is on
sudo ethtool eth0 | grep Wake-on
# turn it on permanently with NetworkManager
nmcli connection show
sudo nmcli connection modify "Wired connection 1" 802-3-ethernet.wake-on-lan magic
macOS: System Settings → Energy (or Battery → Options on a laptop) → Wake for network access. Macs wake from sleep this way; they do not power on from a full shutdown.
4. Set up an always-on relay
Run these commands on the relay, not on the computer you want to wake. The relay is a second device. It stays powered on, it is on the same network as your computer, and it keeps working while your computer sleeps. The computer you want to wake is the one whose MAC address you use below; it does not run any of these commands.
On a Raspberry Pi or another Linux box on the same network:
sudo apt install wakeonlan
# install Tailscale and enable Tailscale SSH so you can reach it from the phone
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up --ssh
The MAC address AA:BB:CC:DD:EE:FF is the computer's address,
not the relay's. Find it on the computer you want to wake (see the section above).
Test it from the relay itself while the computer sleeps:
wakeonlan AA:BB:CC:DD:EE:FF
If it wakes, save it as a one-word script so you do not have to type the MAC address on a phone keyboard:
echo 'wakeonlan AA:BB:CC:DD:EE:FF' | sudo tee /usr/local/bin/wake-dev
sudo chmod +x /usr/local/bin/wake-dev
A Pi that already runs your always-on tasks is a fine relay — see running Claude Code on a Raspberry Pi or VPS.
5. Wake your computer from your phone
With the Tailscale app connected on the phone, open an SSH client (see Tailscale SSH from your phone) and run the script on the relay:
ssh you@relay wake-dev
Most SSH clients let you save that as a snippet or shortcut, so waking the computer is
one tap. On iOS you can put it into a Shortcuts action with Run Script over
SSH. Give the computer half a minute, then tailscale status shows it
online again.
6. Wake-on-LAN not working: checklist
- Wrong MAC: it must be the wired card, not Wi-Fi, and not a virtual adapter (Docker, VPN, Hyper-V).
- Works from sleep but not from shutdown: Fast startup on Windows, ErP in the BIOS, or a Mac (which does not support it).
- Works once, then stops: on Linux the setting was not saved — use
the NetworkManager command above rather than a one-off
ethtool -s. - Different subnet: the relay must be on the same network segment as the computer; a guest network will not do.
- Laptop: many laptops only wake on LAN when plugged into power, and some only with their own docking station.
7. Or: do not let it sleep at all
If you wake the computer so that an AI agent can work, it usually makes more sense to keep it awake while the agent works and let it sleep otherwise. Our guide keeping your computer awake shows how on macOS, Windows and Linux. With coden, the Server simply carries on after the computer wakes — whether from Wake-on-LAN or because you opened the lid. Open the app, or tap Connect if it still shows the Server as unavailable, and you are back in. Work the Agent was doing at the moment the computer fell asleep does not finish, though, so give it the task again.
Do you see it differently? Write to support@coden-app.com.