Knowledge
Reclaim disk space on Ubuntu server
#Hosting
Your server disk space can clog up very quickly with a lot of unneeded files. Let's find out how to reclaim your precious disk space back.
Published by Mark van Eijk on August 24, 2022 · 1 minute read
There are a few ways that make it possible to reclaim diskspace right away on a server. This is very handy when your server is low on diskspace. Let's dive in!
Shrink log files
Using this command, we can shrink logfiles within a specific size. In this example we shrink all system log files to have a maximum size of 500 MB:
sudo journalctl --vacuum-size=500M
This article will be updated with more examples in the future
If the disk is already full, start with no space left on device. On Docker hosts, prune unused Docker data to claw back space.
Subscribe to our newsletter
Do you want to receive regular updates with fresh and exclusive content to learn more about web development, hosting, security and performance? Subscribe now!
More in #Hosting
- How to get top processes with highest memory usage
- How to get top processes with highest CPU usage
- How to add Swap Space on Ubuntu servers
- Disable unnecessary and unused PHP versions (FPM pools)
- How to check Ubuntu version
- Zero downtime deployments using PHP-FPM and nginx