Skip to content
Alavps Blog
Menu
  • Home
  • Hosting
    • Shared Hosting
    • Cloud Hosting
    • VPS Hosting
  • Domains
  • Blog
  • Contact
Menu

How to Clean Up Your VPS Utilizing ncdu to Track Disk Usage

Posted on July 2, 2025July 1, 2025 by alavpsblog

Is Your VPS Running Low on Space and You’ve Been Deleting Files, Yet Your Disk Is Still Nearly Full? But where is all this storage going? To understand where all that space may be going, use ncdu like an expert to track disk usage like never before.

Have you been struggling to identify what’s eating up your server’s hard drive space? Well, help is at hand: the ncdu tool provides an effective solution.

Let’s dive into what ncdu is, its benefits, and how to utilize it effectively on a VPS server.

What Is ncdu and Why Should You Utilize It?

Table of Contents

  • What Is ncdu and Why Should You Utilize It?
  • Install ncdu on Your VPS
    • For Ubuntu/Debian:
    • For CentOS/RHEL:
    • For Fedora:
    • For Arch Linux:
  • Using ncdu to Analyze Disk Usage
  • Real-World Example: Cleaning Out /var
  • Bonus Feature: Exclude Mount Points or Directories
  • Alternate: Create and Save a Report to Share
  • Final Thoughts

ncdu stands for NCurses Disk Usage. It’s a fast, text-based disk usage viewer that runs in your terminal. It makes viewing disk usage simple and far more insightful than using the du command alone.

Instead of scrolling through endless lines of output, ncdu provides an easily navigable interface that displays which folders or files are taking up the most space.

Why it is awesome:

  • Lightweight but effective — no bloated GUI required.
  • Works with nearly every Linux distro.
  • Makes finding large files a snap!

Install ncdu on Your VPS

Installation takes just seconds. Open up a terminal session and enter these commands based on your Linux distribution:

For Ubuntu/Debian:

sudo apt update
sudo apt install ncdu

For CentOS/RHEL:

sudo yum install epel-release
sudo yum install ncdu

For Fedora:

sudo dnf install ncdu

For Arch Linux:

sudo pacman -S ncdu

Using ncdu to Analyze Disk Usage

Once installed, just run:

ncdu /

This tells ncdu to inspect all files on your server’s root directory (that’s everything).

If you only want to scan a particular folder — for example, your home directory or /var — simply run:

ncdu /var

You’ll see a text-based interface showing folders ranked by size. Use the arrow keys to navigate:

  • Up/Down: Navigate through the list
  • Right: Enter a directory
  • Left: Go back
  • d: Delete selected file or folder
  • q: Quit

⚠ Warning: Be cautious with the d key — once something is deleted, it’s gone for good. Only delete items you’re absolutely sure about.

Real-World Example: Cleaning Out /var

One of the biggest space hogs on most servers is the /var directory. Logs, caches, and package managers love to dump data here — and it often gets forgotten.

Try this:

ncdu /var

You might find massive log files in /var/log or old package archives in /var/cache/apt. With ncdu, cleaning them up is fast and simple.

Bonus Feature: Exclude Mount Points or Directories

Want to skip over mounted drives or external filesystems? Use the -x flag to stay within a single filesystem:

ncdu -x /

This is especially helpful if you don’t want network drives or external disks included in your scan.

Alternate: Create and Save a Report to Share

You can even generate a portable report using:

ncdu -o report.json /

Then open it later (or send it to someone else) using:

ncdu -f report.json

Final Thoughts

Optimizing disk space on a VPS doesn’t need to be complicated. With ncdu, you get a visual breakdown of what’s consuming your drive — and you can clean it up with just a few keystrokes.

So the next time your VPS runs low on space, don’t panic. Fire up ncdu and take back control of your storage like a pro.

Happy cleaning!

Posted in How tosTagged clean up VPS, disk usage, Linux VPS, ncdu, ncdu tutorial, server maintenance, VPS optimization

Post navigation

Basic Steps to Follow After Purchasing a Linux VPS

Related Post

  • How to Create Studio Ghibli Style AI Images on ChatGPT for Free
  • How to Install Dual OS Windows 10 and Linux?
  • How To Use SMTP Ports: 25, 465, and 587
  • How CPU Cores Impact Your Website's Speed and Reliability? How CPU Cores Impact Your Website’s Speed and Reliability?
  • How to Deploy Laravel on Ubuntu With Apache: A Comprehensive Guide
  • How to Install Calibre Server & Calibre Web on Ubuntu 22.04 How to Install Calibre Server & Calibre Web on Ubuntu 22.04
  • How To Install LAMP On Ubuntu 16.04 With A Single Command
  • How to Install cPanel on a VPS Server Using PuTTY? How to Install cPanel on a VPS Server Using PuTTY?
  • How To Install Third-Party Apps on My Windows VPS? How To Install Third-Party Apps on My Windows VPS?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Hosting Advice
  • How tos
  • security tips
  • SSL
  • Tutorials
  • VPS Hosting
  • VPS Tips
  • Website Security
  • Website Tips
  • WordPress

Recent Posts

  • How to Clean Up Your VPS Utilizing ncdu to Track Disk Usage
  • Basic Steps to Follow After Purchasing a Linux VPS
  • How to Create Studio Ghibli Style AI Images on ChatGPT for Free
  • 5 Free GPU Server for Students in 2025
  • How to Install Dual OS Windows 10 and Linux?
  • How To Use SMTP Ports: 25, 465, and 587
  • How CPU Cores Impact Your Website’s Speed and Reliability?
  • Brazil VPS Hosting – What You Need to Know Before Spending Your Money
  • How to Deploy Laravel on Ubuntu With Apache: A Comprehensive Guide
  • How to Install Calibre Server & Calibre Web on Ubuntu 22.04

Table Of ContentToggle Table of ContentToggle

  • What Is ncdu and Why Should You Utilize It?
  • Install ncdu on Your VPS
    • For Ubuntu/Debian:
    • For CentOS/RHEL:
    • For Fedora:
    • For Arch Linux:
  • Using ncdu to Analyze Disk Usage
  • Real-World Example: Cleaning Out /var
  • Bonus Feature: Exclude Mount Points or Directories
  • Alternate: Create and Save a Report to Share
  • Final Thoughts
Blog Update By Alavps