When using a Mac Mini as a headless server, prevent it from sleeping:
sudo pmset -a sleep 0 displaysleep 0 disksleep 0
sudo pmset -a autorestart 1
This automatically reboots the Mac Mini if power is lost and restored.
pmset -g
For headless operation, enable auto-login so the Mac boots straight to the desktop:
System Settings → Users & Groups → Automatic Login → select your account
Enable SSH for remote management:
System Settings → General → Sharing → Remote Login → ON
Then connect via: ssh username@hostname