| .github/workflows | ||
| templates | ||
| .env | ||
| .env.sample | ||
| go.mod | ||
| go.sum | ||
| handlers.go | ||
| main.go | ||
| README.md | ||
| utils.go | ||
WOL Server - Wake-on-LAN Control Panel for Raspberry Pi
A lightweight web-based Wake-on-LAN control panel designed for Raspberry Pi that lets you remotely power on and shut down your network devices.
Features
- Simple Web Interface: Boot and shut down your server with a clean, responsive UI
- Status Monitoring: Check if your target device is online
- Raspberry Pi Optimized: Built specifically for ARM processors found in all Raspberry Pi models
- Secure Shutdown: Password-protected shutdown functionality
- Lightweight: Minimal resource usage ideal for running on even the oldest Pi models
- Easy Setup: Simple installation process with clear instructions
Installation
Prerequisites
- Raspberry Pi (any model) running Raspberry Pi OS
- Network connection
- Basic knowledge of SSH/terminal
Option 1: One-Command Installation
-
Download the latest release on your local machine from the Releases page
-
Transfer the package to your Raspberry Pi using SCP:
scp wol-server.tar.gz pi@your-pi-ip:~/ -
SSH into your Raspberry Pi:
ssh pi@your-pi-ip -
Install with a single command:
tar -xzf wol-server.tar.gz && ./install.sh -
Access the web interface at:
http://your-pi-ip:8080
Option 2: Manual Installation
If you prefer a manual approach or encounter issues with the automated install:
-
Create installation directory:
mkdir -p ~/wol-server/templates -
Transfer and install program files:
# Copy the executable cp wol-server-arm6 ~/wol-server/wol-server chmod +x ~/wol-server/wol-server # Copy template files cp templates/* ~/wol-server/templates/ # Create .env file cat > ~/wol-server/.env << EOL SERVER_NAME=pippo SERVER_USER=root MAC_ADDRESS=aa:bb:cc:dd:ee:ff PORT=8080 EOL -
Install service:
sudo cp wol-server.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable wol-server sudo systemctl start wol-server -
Install required dependencies:
sudo apt-get update sudo apt-get install -y wakeonlan sshpass
Configuration
The application can be configured by editing the .env file in the installation directory:
nano ~/wol-server/.env
Available Configuration Options
| Setting | Description | Default |
|---|---|---|
SERVER_NAME |
Hostname/IP of target server | pippo |
SERVER_USER |
SSH username for shutdown | root |
MAC_ADDRESS |
MAC address for Wake-on-LAN | aa:bb:cc:dd:ee:ff |
PORT |
Web interface port | 8080 |
After changing configuration, restart the service:
sudo systemctl restart wol-server
Usage
Accessing the Interface
Open a web browser and navigate to:
http://your-pi-ip:8080
Features
- Status Checking: The interface shows the current status (Online/Offline)
- Booting: Click the "Boot" button to send a WOL magic packet
- Shutting Down: Click "Shutdown" and enter your SSH password when prompted
Maintenance
Checking Service Status
sudo systemctl status wol-server
Viewing Logs
sudo journalctl -u wol-server -f
Updating
To update to a newer version:
- Download and transfer the latest release
- Stop the service:
sudo systemctl stop wol-server - Extract the new files:
tar -xzf wol-server.tar.gz - Run the install script:
./install.sh
Troubleshooting
Service Won't Start
Check for template errors:
ls -la ~/wol-server/templates/
Verify the .env file exists:
cat ~/wol-server/.env
Boot Command Not Working
- Ensure
wakeonlanis installed:which wakeonlan || sudo apt-get install wakeonlan - Verify the MAC address is correct in your .env file
- Make sure the target device is properly configured for Wake-on-LAN
Shutdown Not Working
- Verify
sshpassis installed:which sshpass || sudo apt-get install sshpass - Check that the SERVER_USER setting in .env is correct
- Ensure SSH access is working between your Pi and the target server
Advanced Configuration
Running on a Different Port
Edit the .env file:
echo "PORT=8181" >> ~/wol-server/.env
Multiple Target Machines
To control multiple devices, you can install multiple instances:
# Create a second instance
mkdir -p ~/wol-server2/templates
cp -r ~/wol-server/templates/* ~/wol-server2/templates/
cp ~/wol-server/wol-server ~/wol-server2/
# Different config
cat > ~/wol-server2/.env << EOL
SERVER_NAME=server2
SERVER_USER=admin
MAC_ADDRESS=aa:bb:cc:dd:ee:ff
PORT=8081
EOL
# Create a new service
sudo cp /etc/systemd/system/wol-server.service /etc/systemd/system/wol-server2.service
sudo sed -i 's|/home/pi/wol-server|/home/pi/wol-server2|g' /etc/systemd/system/wol-server2.service
sudo systemctl daemon-reload
sudo systemctl enable wol-server2
sudo systemctl start wol-server2
Project Information
Designed for use with Raspberry Pi to provide a simple way to manage servers and devices on your local network. The web interface makes it easy to power on and off machines without having to remember MAC addresses or commands.
Contributing
Contributions are welcome! Feel free to submit pull requests or open issues to help improve this project.
License
This project is licensed under the MIT License - see the LICENSE file for details.
