Skip to content
statance
MenuClose
← All troubleshooting guides

Why did my Linux server reboot?

Linux

Check when it rebooted with last -x reboot and uptime, then read the end of the previous boot’s log with journalctl -b -1 -e. A clean shutdown sequence means something asked for the reboot (unattended-upgrades, a person, a script, the cloud provider); a log that just stops points at power loss, a hardware fault, a kernel panic or a watchdog.

Symptoms

  • Uptime is shorter than expected
  • Services were briefly unreachable
  • Your monitoring shows the server down and back up

How to diagnose it

  1. See reboot and shutdown times

    Lists reboots and the shutdowns that preceded them.

    last -x reboot shutdown | head uptime -s
  2. Read the end of the previous boot

    Requires a persistent journal (/var/log/journal exists).

    journalctl --list-boots | tail -3 journalctl -b -1 -e --no-pager | tail -50
  3. Check for automatic update reboots

    Ubuntu and Debian can reboot after security updates.

    grep -i reboot /etc/apt/apt.conf.d/50unattended-upgrades less /var/log/unattended-upgrades/unattended-upgrades.log
  4. Look for kernel or hardware errors

    Machine check (MCE), panic or watchdog messages before the log ends point at hardware or kernel problems.

    journalctl -b -1 -k -p err --no-pager | tail -30

Common causes and fixes

unattended-upgrades automatic reboot

Set Unattended-Upgrade::Automatic-Reboot-Time to a quiet hour, or disable automatic reboots and schedule them yourself.

Cloud provider maintenance or host failure

Check your provider’s event history (AWS scheduled events, provider status page) for that time.

Kernel panic or hardware fault

Configure kdump to capture crash dumps, run memtest on physical machines, and check SMART and IPMI logs.

No persistent journal so the cause is lost

Create the journal directory so logs survive reboots.

sudo mkdir -p /var/log/journal && sudo systemctl restart systemd-journald

Prevent it happening again

  • Alert on down (server stopped reporting) so every reboot is noticed.
  • Statance shows pending security updates and “reboot required” so planned reboots can be scheduled.
  • Enable persistent journald logging on every server.

Set it up: Linux monitoring · Ubuntu monitoring.

FAQ

How do I see the last reboot time in Linux?

Run uptime -s or last reboot.

Why is journalctl -b -1 empty?

The journal is not persistent, so logs from previous boots are lost. Create /var/log/journal to keep them.

Related guides

Get alerted before this becomes an outage.

Install the agent in one line. Statance watches CPU, memory, disk and services, and its AI assistant helps find the cause.