I’ve logged into the server (“droplet”) using Putty and the root username and password. Now I would like to know how much disk space is remaining that is available to me. How can I find this out?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hey DigitalOcean Community,
I hope you’re all doing well! I came across this question and I wanted to share a quick guide on how you can easily check the available disk space on your DigitalOcean Droplet. Let’s dive in!
Step 1: Log into Your Droplet
First things first, grab your favorite SSH client. Connect to your Droplet using the root username and the IP address of your Droplet:
Step 2: The Magical
df
CommandOnce you’re in, your best friend is the
df
command. This command shows you the amount of disk space that is free on your server’s file systems. Just typedf
and hit Enter. Want to make things more readable? Go fordf -h
to get the output in a human-friendly format, displaying sizes in GBs, MBs, etc.Understanding the Output
Here’s a quick rundown of what you’re looking at:
Bonus Tip: Checking Specific Directories
Sometimes, you might want to check how much space a specific directory or file is using. For this, turn to the
du
command. For example,du -sh /var/log
gives you the size of the/var/log
directory in an easy-to-read format.Don’t Forget About Inodes
If you suspect inode exhaustion (a less common, but tricky issue),
df -i
is your go-to command to check inode usage.And that’s pretty much it! Regularly monitoring your disk space is key to avoiding any nasty surprises. I hope this guide helps you keep your Droplet in top shape. As always, if you have any questions or need a bit of extra help, feel free to drop a comment below - I’m here to help!
Happy coding,
Bobby
df -h will report disk space, it doesn’t show RAM usage. The line you want for how much disk space you’re using is likely /dev/vda. For instant on mine I see: <br> <br>/dev/vda 20G 2.0G 17G 11% / <br> <br>The second column shows total space, third column how much you’re using, fourth amount free and fifth percent used. <br> <br>To see how much RAM you’re using run: <br> <br>free -m <br>
Since the
df -h
was not detailed enough, and I needed each folder’s size and find out where the biggest folder is, I used the tutorial of https://serverpilot.io/community/articles/how-to-determine-what-is-using-disk-space.htmlsudo apt-get install ncdu
sudo ncdu /
Done.
You can even navigate into the folders to get more details!