Troubleshot rebooting Mac mini server
The first thing is to get into the console app / system log and trace the shutdown cause and timing of the restarts. Then you would look to see if there are hangs or crashes in /Library/Logs/DiagnosticReports prior to those events.


The reason for Previous shutdown cause: -128
Shutdown cause: -104


Depending on your interest in scripting shell to collect matches from log files, here’s an example of using those log files to find events like needles in a very large, long and confusing haystack.


Improvement to &#39;grep -h &quot;BSD process name&quot; /Library/Logs/DiagnosticReports/* | sort | uniq -c&#39;


Most likely, you will see a pattern (or see there is no pattern once you get 25 restarts logged and cataloged) and can remove the hardware, software or look into what is the logged reason.