Fix a full root disk on Ubuntu WordPress servers

ubuntulinuxhostingwordpressops

Random 500s, failed deploys, or services refusing to restart? A full root filesystem (/) often shows up exactly like that. This guide walks through a fast triage and the highest-impact cleanup steps so you can reclaim space without breaking the stack.

Quick triage

Common high-impact cleanup targets

1) Logs

2) Package cache

3) Old kernels

4) Orphaned packages

Validate services after cleanup

FAQ

What’s the first thing to check when the disk is full?
Run df -h to confirm which filesystem is full, then sudo du -xhd1 / | sort -h to see which top-level directories use the most space. Usually /var (logs, caches, WordPress) is the main culprit.

Is it safe to run apt clean on a production server?
Yes. It only removes downloaded package files from the local cache. It does not remove installed software or configs.

Should I remove all old kernels?
Keep the currently running kernel and at least one older one as a fallback. Remove only kernels you’ve confirmed are not in use.