master
Kratos (PHP Wake-on-LAN)
A simple PHP web app to wake configured machines on your network.
Requirements
- Linux server
- PHP 7.4+ (PHP 8.x also works)
- A web server (Apache or Nginx) or PHP built-in server for local use
wakeonlancommand installed on the serverpingcommand available on the server
Install dependencies on Debian/Ubuntu:
sudo apt update
sudo apt install -y php php-cli wakeonlan iputils-ping
Configuration
- Copy this project to your server.
- Edit
hosts.phpand set your own hosts:mac_address: device MAC addressip_address: device IP addressfriendly_name: name shown in the UI
Run locally (quick test)
From the project directory:
php -S 0.0.0.0:8080
Then open:
http://<server-ip>:8080/
Deploy as a PHP application
Option 1: Apache
- Put this project in your web root (example:
/var/www/kratos). - Ensure Apache and PHP are installed.
- Create a vhost pointing
DocumentRootto the project folder. - Enable the site and reload Apache.
Example minimal Apache vhost:
<VirtualHost *:80>
ServerName kratos.local
DocumentRoot /var/www/kratos
<Directory /var/www/kratos>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/kratos_error.log
CustomLog ${APACHE_LOG_DIR}/kratos_access.log combined
</VirtualHost>
Enable and reload:
sudo a2ensite kratos.conf
sudo systemctl reload apache2
Option 2: Nginx + PHP-FPM
- Put this project in
/var/www/kratos. - Install
nginxandphp-fpm. - Create an Nginx server block and point it to the project root.
- Reload Nginx.
Example minimal Nginx config:
server {
listen 80;
server_name kratos.local;
root /var/www/kratos;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
}
Notes
- The web server user must be allowed to run
wakeonlanandping. - If status checks always fail, verify firewall rules and ICMP availability.
- Keep this app on your trusted local network or behind authentication/VPN.
Description
Languages
PHP
71.2%
CSS
28.8%