When migrating your Cloud Server to a VPS, you need at least 100 MB of free space in both the root (/) and boot (/boot) directories. Without enough free space, the migration may fail.
This guide will show you how to check available storage, remove unnecessary files, clear old logs, and uninstall unused programs to optimize your Linux Cloud Server.
Step 1: Check Available Storage Space
Before making changes, check how much space is currently available using:
This command displays storage usage in a human-readable format (MB, GB).
To check how much space individual directories are using, run:
Step 2: Empty Log Files
Log files grow over time and can consume significant storage. You can clear them if they are no longer needed.
View Large Log Files
To list log files by size, run:
Clear Unnecessary Log Files
To empty a log file while keeping the file structure intact, use:
For example:
⚠️ Warning: Always review log files before clearing them, as they may contain important system data.
Step 3: Remove Old Plesk Backups
If you use Plesk to manage your server, it might have multiple old backups that take up space.
We recommend reviewing and deleting outdated backups to free up additional storage.
Follow Plesk’s backup removal instructions to safely delete unnecessary backups.
Step 4: Find and Delete Large Files
To locate large files, use the following command:
Example output:
Delete Unnecessary Files
To delete a single file, use:
To delete multiple files, run:
To delete read-only files, use:
To delete all files within a directory, run:
Step 5: Uninstall Unused Programs
Unused applications take up space and should be removed.
For CentOS 7
For CentOS Stream 8/9, Rocky Linux 8/9, AlmaLinux 8/9
For Debian / Ubuntu
Step 6: Delete Old Kernels
Over time, old Linux kernels accumulate, using valuable space. To check your current kernel version, run:
List All Installed Kernels
For Debian / Ubuntu:
For CentOS, Rocky Linux, AlmaLinux:
⚠️ Make sure at least one stable kernel remains installed to prevent system instability.
Remove Old Kernels
For Debian / Ubuntu:
For CentOS, Rocky Linux, AlmaLinux:
Step 7: Verify Available Storage Space
Once cleanup is complete, confirm that enough space has been freed up by running:
If additional space is needed, repeat the above steps to find and remove more unnecessary files.
Final Thoughts
Regularly cleaning up your Linux Cloud Server improves performance, ensures smooth migrations, and prevents storage-related issues. By following these steps, you can free up space and keep your system running efficiently.
🚀 Try these steps today to optimize your storage!
💬 Have questions? Drop them in the comments below!