Version: 1.X.X
How To Free Up Disk Space
Low disk space can affect server stability and performance. This guide helps you identify and free up disk space on your HiTechCloud server.
1. Check Disk Usage
Start by checking how much space is currently used:
df -h
To find large directories:
du -h / | sort -hr | head -n 20
2. Clean Up Docker
Docker can quickly consume space with unused containers, images, volumes, and networks.
- To remove unused Docker data:
docker system prune
- To also remove unused volumes (use with caution):
docker system prune --volumes
🧼 Note: This only removes resources not actively in use. Review the list before confirming.
- View what's taking space:
docker system df
3. Clear Logs
Log files often grow large over time:
- Delete rotated/compressed logs:
rm -f /var/log/*.gz /var/log/*.1
- Truncate current logs:
truncate -s 0 /var/log/syslog
truncate -s 0 /var/log/auth.log
4. Remove Unused Packages
Free space by removing orphaned packages:
- For Debian/Ubuntu:
apt autoremove
apt clean
- For CentOS/RHEL:
yum autoremove
yum clean all