Question

How can I tell how much disk space is available on my Droplet?

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?

Show comments

Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
December 26, 2023
Accepted Answer

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:

https://docs.digitalocean.com/products/droplets/how-to/connect-with-ssh/

Step 2: The Magical df Command

Once 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 type df and hit Enter. Want to make things more readable? Go for df -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:

  • Filesystem: This is where you’ll see the name of the file system or partition.
  • Size: Total size - pretty straightforward.
  • Used: How much space has already been used.
  • Available: The real MVP - this tells you how much space you’ve got left.
  • Use%: A handy percentage showing how much of the file system is used.
  • Mounted on: Shows where the file system is mounted in your directory structure.

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.html

  1. SSH into your server
  2. Run the installer sudo apt-get install ncdu
  3. Run the tool sudo ncdu /

Done.

You can even navigate into the folders to get more details!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel