Skip to content

Why did my server crash? A log-first post-mortem runbook

A server that crashed once will almost certainly crash again unless you find out why. That is the whole point of a post-mortem: not to assign blame, but to turn one bad night into a written cause and a fix that holds. Generic lists of crash causes help with a hunch, not at 3 a.m. when a store is down and you have to find the actual reason.

Here is the runbook we follow. It is log-first, it is ordered, and it assumes you have shell access and roughly an hour before someone asks for an answer.

First, define what actually happened

“The server crashed” covers four very different failures, and each one leaves evidence in a different place. Before you touch a log, decide which one you are chasing:

  • A single service died (nginx, MySQL, PHP-FPM) but the box stayed up.
  • The kernel panicked and the machine rebooted itself.
  • Resources ran out (RAM, disk, or file descriptors) and the OOM killer started shooting processes.
  • The host or hypervisor pulled the plug, and nothing on the guest is at fault at all.

Run uptime first. If the box has been up for three minutes and the incident was an hour ago, it rebooted, and you are looking at a panic, a hardware event, or a host action. If uptime spans the whole incident, the machine never went down and a service is your culprit. This one command saves you from reading the wrong logs for twenty minutes.

Read the logs in the right order

The timeline is your best friend. Line up timestamps from three sources and the story usually tells itself. Start with the kernel ring buffer and the system journal, narrowed to the incident window:

  • journalctl --since "2026-07-15 02:00" --until "2026-07-15 03:00": everything the system recorded in that hour.
  • journalctl -k -b -1: kernel messages from the previous boot, which survive a reboot and often hold the panic trace.
  • dmesg -T | grep -i -E "oom|killed process|panic|error": the loud events, with human-readable timestamps.

If you see “Out of memory: Killed process,” you have your answer and you can skip straight to the memory section. If the previous boot’s kernel log ends mid-sentence with no shutdown message, that is a hard lockup or a host-side kill, not a software crash on your side.

One catch: journalctl -b -1 only shows the previous boot if the journal is kept on disk. If /var/log/journal does not exist on the server, logs from before the reboot are gone. Create that directory (or set Storage=persistent in journald.conf) today, so the next crash leaves a trace. And if the guest’s logs simply stop, check your provider’s status page and the server’s console log in their panel: a host-side restart or migration leaves nothing on the server itself.

Rule out the boring causes before the exotic ones

A common “mystery crash” is simply a full disk. A database that cannot write its files will stop accepting connections, and the symptom looks like a database crash when the real problem is df showing 100%. A database that is slow rather than stopped is a different animal, usually a MariaDB config that never got tuned on CyberPanel. Check disk and inodes before anything clever:

  • df -h and df -i: space and inodes, because you can run out of inodes with gigabytes free.
  • free -m plus the OOM check above: memory pressure.
  • grep -i error /var/log/mysql/error.log (or the equivalent for your service): the service’s own account of its death.

Most crashes that look mysterious come down to a full disk, a runaway process eating memory, or a bad config pushed in a deploy an hour earlier. Hardware faults and kernel bugs are real, but check the cheap causes first.

Tie the cause to a change

Servers rarely fail at random. Something moved: a deploy, a package update, a cron job, a traffic spike. Once you have a suspected cause, look for what changed near the timestamp. last reboot gives you the reboot history. Your package manager log (/var/log/dpkg.log or /var/log/yum.log) tells you if an update landed just before. Your deploy log or Git history tells you if code shipped. Correlation is not proof, but a crash that starts ninety seconds after a config reload is not a coincidence.

Write it down while it is fresh

The post-mortem is a short document, not a saga. We keep ours to five fields: what happened, the timeline, the root cause, the immediate fix, and the change that stops a repeat. That last field is the only one that matters in six months. “Restarted MySQL” is not a fix; “added disk alerting at 80% and moved backups off the data volume” is. If the write-up does not end with a change to configuration, monitoring, or process, the same crash is already scheduled.

We run this exact process as part of our Linux server restoration work, and we hand the written post-mortem to the client at the end. If you would rather not be the one reading kernel logs at 3 a.m., that is what we are for. If the box has been unstable for a while and you want to get ahead of it, the five signs your VPS needs an audit is a good gut-check, and the Linux server hardening checklist covers the preventative side once the immediate fire is out.

The short version

Catching the next crash sooner is far easier when a lightweight cron-and-Slack monitor is already watching disk, memory, and services for you.

Check uptime to learn whether the box rebooted. Read the kernel log and journal for the incident window. Rule out full disk and out-of-memory before anything exotic. Tie the cause to a change. Then write five fields and, most importantly, the one change that keeps it from happening twice. Do that every time and your servers get quieter, which is the only metric that counts.

Common questions

How do I find out why my Linux server crashed?

Run uptime to see whether it rebooted, then read the journal for the incident window and the kernel log from the previous boot (journalctl -k -b -1). Look for out-of-memory kills, a full disk, and the failing service’s own error log, then check what changed just before: a deploy, an update or a cron job.

How can I tell if the OOM killer ran?

Search the kernel log for it: dmesg -T | grep -i "killed process" for the current boot, or journalctl -k -b -1 | grep -i oom for the previous one. The line names the process that was killed and how much memory it held.

Why did my server reboot by itself?

Usually a kernel panic, an out-of-memory condition that took down something essential, automatic updates that needed a reboot, or the hosting provider restarting or moving the server. If the previous boot’s log ends without a shutdown message, look at the provider’s side first.

What should a server post-mortem include?

Five things: what happened, the timeline, the root cause, the immediate fix, and the change that stops a repeat, such as a new alert, a config change or a moved backup. Without that last one, the same crash is only a matter of time.

Start here

Hit this one
yourself?

If any of the above is happening on your stack, send us the symptoms. We triage the same working day and quote before we start.

Which layer is on fire?
Your details stay with us. Always.