Support article
Low disk space on your HDD/SSD! Find and remove large files
It's normal for this to be confusing at first: suddenly your website stops loading or email stops arriving, and the reason is usually that the disk has filled up...
It’s normal for this to be confusing at first: suddenly your website stops loading or email stops arriving, and the reason is usually that the disk has filled up. Don’t worry — it’s rarely necessary to upgrade to a larger plan right away; most of the time it’s “junk” files or logs that we can clean up. 🧹 Here I’ll explain how to regain control of your storage, whether you’re on Linux or Windows.On Linux (VPS or Dedicated Servers) 🐧If you manage your own server via SSH, finding the “culprit” behind a full disk is very easy.1. Log in with permissionsTo view files across the entire system, you need privileges. Run this when logging in:sudo -i2. Find the 10 largest filesUse this command to scan your disk. Be patient — if you have a lot of data, it may take a couple of minutes: ⏳“Bash
find / -type f -exec du -ah {} + | sort -rh | head -n 10
3. What can you delete? 🗑️
You’ll see a list of file paths. Normally, the ones you can safely delete are:
.tar.gzor.zipfiles: Old backups you no longer need..logfiles: Error logs that have grown too large.tmpfolders: Temporary files from old processes.
To delete a specific file, use:
rm filename
On Windows 🪟
In Windows environments, space usually fills up due to forgotten downloads or temporary files from system updates.
- Use a visual tool: I recommend TreeSize Free. It’s lightweight, free, and very intuitive. 📊
- Scan your drive: When you open it, select your disk (C:). You’ll see graphically which folders are “eating up” your GB.
- Clean carefully: You can delete old program installers or user files, but never touch the /Windows folder or you could damage the operating system. ⚠️
The miHosting “Pro-Tip” 💡
Before deleting a very large log file (.log), don’t just remove it outright. Use the command truncate -s 0 file.log. This empties the file’s contents but keeps it “alive.” Why? Because some Linux services fail if the file they’re trying to write to suddenly disappears. With truncate, you free up the space and the server keeps running happily. ✅
Let’s recap the key points:
- Identify before deleting: Make sure it’s not a vital database file.
- Check the logs: If a log file is huge, your website probably has an error that’s repeating thousands of times.
- Prevention: Always keep at least 10% free space so that cache services work properly.