Cleaning up linux server space

Here are some steps to go through to keep your Ubuntu Server clean.

  • Clear the systemd journal logs: sudo journalctl --vacuum-time=2d
  • Clear the apt cache: sudo apt clean
  • Autoremove unused packages: sudo apt autoremove
  • Manually check big directories with ncdu
  • Remove unused docker images: sudo docker image prune -a

This works with most debian derivates like debian itself, raspbian, etc.