| templates | ||
| .dockerignore | ||
| .gitignore | ||
| app.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| README.md | ||
| requirements.txt | ||
Wake-on-LAN Web Manager
A Flask-based web application to manage and wake machines on your local network using Wake-on-LAN (WoL) packets.
Features
- 📋 Machine List: View all registered machines with their current status (online/offline)
- ⚡ Wake Machines: Send WoL packets to offline machines with a single click
- ➕ Add/Edit Machines: Manage machine configurations (name, IP, MAC address)
- 🔍 Status Monitoring: Automatic ping-based status checking every 10 seconds
- 🎨 Modern UI: Clean, responsive interface with modal dialogs
- 🐳 Docker Support: Easy containerized deployment
Prerequisites
For running locally:
- Python 3.8 or higher
- Network access to the machines you want to wake
For Docker:
- Docker installed on your system
Installation
Option 1: Running Locally
- Install dependencies:
pip install -r requirements.txt
- Run the application:
python app.py
- Open your browser and navigate to:
http://localhost:5100
Option 2: Using Docker
- Build the Docker image:
docker build -t wol-manager .
- Run the container:
docker run -d \
--name wol-manager \
--network host \
-v wol-data:/app/data \
wol-manager
Note: The --network host flag is important for WoL packets to work correctly on your local network.
- Open your browser and navigate to:
http://localhost:5100
Option 3: Using Docker Compose
- Start the application:
docker-compose up -d
- Open your browser and navigate to:
http://localhost:5100
Usage
Adding a Machine
- Click the "+ New Machine" button
- Enter the machine details:
- Machine Name: A friendly name (e.g., "Living Room PC")
- IP Address: The machine's IP address (e.g., "192.168.1.100")
- MAC Address: The machine's MAC address (e.g., "AA:BB:CC:DD:EE:FF")
- Click "Save"
Waking a Machine
- Wait for the status indicator to update (or refresh the page)
- Machines that are offline will show a red indicator
- Click the "Wake" button next to the offline machine
- The WoL packet will be sent to the machine
Editing a Machine
- Click the "Edit" button next to any machine
- Update the details as needed
- Click "Save"
Deleting a Machine
- Click the "Delete" button next to any machine
- Confirm the deletion
How It Works
- Status Checking: The app pings each machine every 10 seconds to determine if it's online
- Wake-on-LAN: When you click "Wake", a magic packet is sent to the machine's MAC address
- Data Storage: Machine configurations are stored in a JSON file (
machines.json)
Network Requirements
For Wake-on-LAN to work:
- Target machines must have WoL enabled in BIOS/UEFI
- Network adapters must support WoL
- Machines should be connected via Ethernet (WiFi WoL is less reliable)
- The app must be running on the same local network as the target machines
Data Persistence
When using Docker, machine data is stored in a Docker volume named wol-data. This ensures your machine configurations persist across container restarts.
Reverse Proxy Support
If you're running the app behind a reverse proxy (like nginx) with a URL prefix, you need to:
- Configure nginx to strip the prefix when proxying to the backend:
location /c/ {
proxy_pass http://localhost:5100/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
- Set the
URL_PREFIXenvironment variable so the frontend knows what base path to use:
With Docker:
docker run -d \
--name wol-manager \
--network host \
-e URL_PREFIX=/c \
-v wol-data:/app/data \
wol-manager
With Docker Compose:
Edit docker-compose.yml and set:
environment:
- URL_PREFIX=/c
Running locally:
export URL_PREFIX=/c
python app.py
The app will then be accessible at https://yourserver.com/c/. The URL_PREFIX variable tells the frontend JavaScript where to make API calls, while nginx strips the prefix before forwarding to the Flask backend.
Troubleshooting
WoL not working?
- Verify WoL is enabled in the machine's BIOS
- Check that the MAC address is correct
- Ensure the machine is on the same network
- Try using
--network hostwith Docker
Status always showing offline?
- Check firewall settings (ICMP/ping must be allowed)
- Verify the IP address is correct
- Some machines may not respond to ping when sleeping
Technology Stack
- Backend: Python, Flask
- Frontend: HTML, CSS, JavaScript
- Libraries: wakeonlan, subprocess (for ping)
- Containerization: Docker
License
MIT License - Feel free to use and modify as needed.