Building a Wake-on-LAN Server with Raspberry Pi
Building a Wake-on-LAN Server with Raspberry Pi Wake-on-LAN lets you power on a sleeping PC remotely. A Pi relay lets you trigger this from outside your home network. Prerequisites On the target PC: 1. Enable Wake-on-LAN in BIOS 2. Enable in OS network adapter Power Management settings 3. Note the MAC address (ipconfig /all on Windows) Install WOL Tool bash sudo apt install wakeonlan -y Send a Magic Packet bash wakeonlan AA:BB:CC:DD:EE:FF Remote Wake from Outside Your Network SSH into your Pi via Tailscale (or WireGuard), then run the wakeonlan command. That's it — the Pi is on your LAN and can reach the target. Simple Web UI with Flask python from flask import Flask import subprocess app = Flask(name) TARGETS = { "desktop": "AA:BB:CC:DD:EE:FF", "nas": "11:22:33:44:55:66", } @app.route('/wake/<device>') def wake(device): mac = TARGETS.get(device) if mac: subprocess.run(['wakeonlan', mac]) return f"Waking {device}..." return "Unknown device", 404 if name == 'main': app.run(host='0.0.0.0', port=5000) Access: http://raspberrypi.local:5000/wake/desktop Scheduled Wake with Cron bash Wake desktop at 8am weekdays 0 8 1-5 pi wakeonlan AA:BB:CC:DD:EE:FF
Related Guides
- Raspberry Pi: Complete Headless Setup Guide (No Monitor Needed)
- Automated Plant Watering System with Raspberry Pi
- Setting Up Nginx as a Reverse Proxy on Raspberry Pi
- Running Home Assistant on a Raspberry Pi 4
- Auto-Backup Your Raspberry Pi SD Card to a Network Share
- Kiosk Mode on Raspberry Pi: Boot Straight to a Webpage
- MQTT and Node-RED on Raspberry Pi: Visual Automation for ESP32 Sensor Networks
- Self-Hosted CI/CD Runner on a Raspberry Pi: GitHub Actions and Gitea Actions