On any shared Linux server — file servers, web hosting, VPS platforms, or multi-tenant environments — uncontrolled disk usage by individual users or groups can exhaust storage, degrade performance for everyone, and cause service outages. Disk quotas solve this problem by enforcing per-user and per-group limits on disk space and file count.

This guide compares three self-hosted Linux disk quota management approaches: the quota tools (traditional CLI suite), quotatool (command-line quota editor), and Webmin (web-based system administration with quota module).

How Linux Disk Quotas Work

Linux disk quotas operate at the filesystem level, not the user level. The filesystem tracks block usage (disk space) and inode usage (file count) for each user and group, then enforces limits defined by the administrator.

Quota Types

TypeScopeUse Case
User quotaPer-user limitsLimit individual user storage
Group quotaPer-group limitsLimit department or team storage
Project quotaPer-project limits (XFS)Limit storage per project directory
Directory quotaPer-directory limits (ZFS/Btrfs)Limit storage per directory tree

Soft vs Hard Limits

Limit TypeBehavior
Soft limitWarns user when exceeded; allows grace period before enforcement
Hard limitAbsolute ceiling — no writes permitted beyond this point
Grace periodTime allowed to reduce usage below soft limit (default: 7 days)

When a user exceeds their soft limit, they receive warnings but can continue writing. Once the grace period expires (or the hard limit is reached), writes are blocked with EDQUOT errors.

Filesystem Support

FilesystemUser QuotaGroup QuotaProject QuotaQuota Format
ext4YesYesNovfsv0/vfsv1
XFSYesYesYesXFS native
BtrfsYes (via qgroups)YesNoBtrfs qgroups
ZFSYes (via userquota)YesNoZFS native
F2FSLimitedLimitedNoF2FS native

Enabling Quotas on ext4

Before managing quotas, you must enable them at the filesystem level.

Step 1: Mount with Quota Options

Edit /etc/fstab to add quota mount options:

1
/dev/sda1  /home  ext4  defaults,usrquota,grpquota  0  2

Or for newer systems using project quotas:

1
/dev/sda1  /home  ext4  defaults,prjquota  0  2

Step 2: Remount and Initialize

1
2
3
4
5
6
7
8
# Remount the filesystem
sudo mount -o remount /home

# Create quota files (ext4 only, XFS does this automatically)
sudo quotacheck -cugm /home

# Enable quotas
sudo quotaon /home

Step 3: Verify Quota Status

1
2
3
4
5
# Check if quotas are enabled
quota -v

# Check filesystem quota status
sudo quotastats

Tool Comparison Overview

Featurequota ToolsquotatoolWebmin Quota Module
InterfaceCommand-line (CLI)Command-line (CLI)Web browser
PackagequotaquotatoolWebmin (built-in)
Set Limitsedquota (interactive)quotatool (one-liner)Web form
View Usagequota, repquotaquotatool -qWeb dashboard
Batch OperationsShell loops + setquotaScript-friendlyBulk edit via web
Remote ManagementSSH + CLISSH + CLIHTTPS web interface
User Self-ServiceNoNoNo
Graphs/ChartsNoNoYes (RRD-based)
AlertsManual (warnquota)NoEmail alerts
Multi-ServerManual per-serverManual per-serverWebmin cluster mode
Learning CurveMediumLowLow
Docker SupportVia host mountVia host mountVia Webmin container

quota Tools — The Traditional CLI Suite

The quota package is the standard Linux quota management toolkit, included in virtually every distribution. It provides several complementary tools for different aspects of quota management.

Installation

1
2
3
4
5
6
7
8
# Debian/Ubuntu
sudo apt install quota quotatool

# RHEL/Fedora/CentOS
sudo dnf install quota

# Arch Linux
sudo pacman -S quota-tools

Key Commands

CommandPurpose
edquotaEdit user/group quotas (opens editor)
setquotaSet quotas non-interactively (scriptable)
quotaDisplay user quota usage
repquotaReport quotas for all users on a filesystem
quotacheckScan filesystem and build quota files
quotaon / quotaoffEnable/disable quota enforcement
warnquotaSend email warnings to over-quota users
quotastatsDisplay kernel quota statistics

Setting User Quotas

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Interactive editor (opens vi/nano)
sudo edquota -u username

# Example editor output:
# Disk quotas for user john (uid 1001):
#   Filesystem  blocks   soft   hard   inodes  soft  hard
#   /dev/sda1   524288  1048576 2097152  1024  5000  10000

# Non-interactive (scriptable)
sudo setquota -u username 1048576 2097152 5000 10000 /home

The values are:

  • blocks: Current usage (1K blocks, read-only in editor)
  • soft limit: Warning threshold (in 1K blocks)
  • hard limit: Absolute maximum (in 1K blocks)
  • inodes: Current file count (read-only)
  • soft limit: Warning file count
  • hard limit: Maximum file count

Setting Group Quotas

1
2
3
4
5
# Interactive
sudo edquota -g developers

# Non-interactive
sudo setquota -g developers 5242880 10485760 50000 100000 /home

Viewing Quota Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Individual user
quota -u username

# All users on a filesystem
sudo repquota /home

# Human-readable summary
sudo repquota -s /home

# Check specific user quota status
quota -v username

Automated Warnings

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Install and configure warnquota
sudo apt install quota

# Configure /etc/warnquota.conf
cat /etc/warnquota.conf
# SUBJECT: WARNING: You are exceeding your disk quota
# CC: admin@example.com
# FROM: quota-admin@example.com

# Run warning checks
sudo warnquota

Docker Deployment

Quota management requires host filesystem access:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
version: "3.8"
services:
  quota-manager:
    image: ubuntu:24.04
    cap_add:
      - SYS_ADMIN
    volumes:
      - /home:/home
      - /etc/fstab:/etc/fstab:ro
    command: |
      apt update && apt install -y quota &&
      quotaon /home &&
      repquota -s /home
    restart: "no"

quotatool — The Scriptable One-Liner

quotatool is a command-line utility designed specifically for setting quotas from scripts and automation. Unlike edquota (which opens an interactive editor), quotatool accepts all parameters as command-line arguments.

Installation

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Debian/Ubuntu
sudo apt install quotatool

# RHEL/Fedora
sudo dnf install quotatool

# Build from source
git clone https://github.com/quotatool/quotatool.git
cd quotatool
./configure && make && sudo make install

Setting Quotas

1
2
3
4
5
6
7
8
# Set block soft limit to 1GB, hard limit to 2GB
sudo quotatool -u username -bq 1G -l 2G /home

# Set inode soft limit to 5000, hard limit to 10000
sudo quotatool -u username -iq 5000 -l 10000 /home

# Set both block and inode limits
sudo quotatool -u username -bq 1G -l 2G -iq 5000 -l 10000 /home

Bulk Operations

quotatool shines when setting quotas for many users:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Set 5GB soft / 10GB hard for all users in a file
while read user; do
    quotatool -u "$user" -bq 5G -l 10G /home
done < user-list.txt

# Set quotas based on CSV input
# Format: username,soft_block,hard_block,soft_inode,hard_inode
while IFS=, read user soft_b hard_b soft_i hard_i; do
    quotatool -u "$user" -bq "$soft_b" -l "$hard_b" -iq "$soft_i" -l "$hard_i" /home
done < quotas.csv

# Query quota for a user
quotatool -u username -q /home

Quota Report

1
2
3
4
5
# Show all users quotas
quotatool -a -q /home

# Show only users over their soft limit
quotatool -a -q /home | grep -v "within"

Webmin Quota Module — The Web Interface

Webmin is a web-based system administration tool that includes a comprehensive quota management module. It provides a graphical interface for viewing and editing quotas, plus usage graphs and email alerts.

Installation

1
2
3
4
5
6
7
8
9
# Debian/Ubuntu
wget https://download.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
echo "deb https://download.webmin.com/download/repository sarge contrib" | sudo tee /etc/apt/sources.list.d/webmin.list
sudo apt update
sudo apt install webmin

# RHEL/Fedora
sudo dnf install webmin

Accessing the Quota Module

  1. Navigate to https://your-server:10000/
  2. Log in as root
  3. Go to SystemDisk Quotas
  4. Select the filesystem to manage

Features

The Webmin quota module provides:

  • User quota editor: Set soft and hard limits via web form
  • Group quota editor: Set group-wide limits
  • Usage graphs: Visual charts of quota consumption over time
  • Bulk operations: Apply the same limits to multiple users
  • Email alerts: Configure notifications when users approach limits
  • Quota reports: Export usage reports in CSV format
  • Grace period management: Adjust grace periods per filesystem

Docker Deployment for Webmin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
version: "3.8"
services:
  webmin:
    image: webmin/webmin:latest
    restart: unless-stopped
    ports:
      - "10000:10000"
    volumes:
      - /home:/home
      - /etc:/etc:ro
      - webmin-data:/etc/webmin
    environment:
      - WEBMIN_PASSWORD=admin123
    cap_add:
      - SYS_ADMIN
    privileged: true

volumes:
  webmin-data:

Comparing Workflow Efficiency

Taskquota ToolsquotatoolWebmin
Set one user quotaedquota -u (editor)quotatool -u (one-liner)Web form click
Set 100 user quotasShell loop + setquotaShell loop + quotatoolBulk upload CSV
View all quotasrepquota -s (terminal)quotatool -a -qWeb dashboard
Send warningswarnquota (manual)Not availableAutomatic email
Historical trendsNot availableNot availableRRD graphs
Remote managementSSH requiredSSH requiredHTTPS browser

Why Self-Host Disk Quota Management?

Running your own quota management infrastructure ensures that storage limits are enforced locally, without depending on external services or cloud provider APIs. This matters for several reasons.

Complete control over policies: Self-hosted quota management lets you define exactly who gets what limits, with per-user, per-group, and (on XFS) per-project granularity. You can implement tiered storage policies — giving developers 50 GB, QA teams 20 GB, and shared projects 100 GB — without any external dependency. For storage capacity planning and usage analysis, see our disk usage analyzer comparison for complementary tools that work alongside quota enforcement.

No cloud dependency: Cloud storage quotas (AWS EBS volume limits, GCP persistent disk quotas) are controlled by the provider and cannot be customized per-user. Self-hosted Linux quotas give you fine-grained control that cloud providers do not offer. When managing multi-tenant storage, combine quota enforcement with backup strategies — our Docker volume backup guide covers automated backup of quota-managed volumes. For filesystem-level replication and disaster recovery, our storage replication guide covers keeping quota data synchronized across servers.

Audit and compliance: Self-hosted quota systems maintain detailed usage logs that can be audited for compliance. The repquota output provides a complete snapshot of every user storage consumption at any point in time, suitable for chargeback billing, capacity planning, and regulatory reporting.

Cost control: On self-hosted infrastructure, storage is a finite resource. Quotas prevent any single user or application from consuming disproportionate space, ensuring fair allocation across all services. This is especially important on servers running multiple workloads — databases, web applications, and file sharing — where one runaway process can starve others.

FAQ

What is the difference between soft and hard quota limits?

A soft limit is a warning threshold — when a user exceeds it, they receive warnings but can continue writing data. A grace period (typically 7 days) gives them time to reduce usage. A hard limit is an absolute ceiling — once reached, no more writes are permitted and the user gets EDQUOT (Disk quota exceeded) errors. Think of soft limit as a yellow light and hard limit as a red light.

Which filesystem supports quotas best?

XFS has the most complete quota support, including user, group, and project quotas with native kernel integration. ext4 supports user and group quotas via the quota subsystem (requires enabling mount options). Btrfs uses qgroups (quota groups) which are powerful but have a different configuration model. ZFS has native user and group quota properties settable via zfs set userquota@username=10G pool/dataset. For most self-hosted servers, ext4 or XFS with the standard quota tools is the simplest approach.

Can quotas be set on Docker containers?

Docker does not natively support filesystem quotas on container overlay filesystems. However, you can enforce storage limits using the --storage-opt size=10G flag (requires the devicemapper storage driver), or by mounting a quota-enabled host directory into the container and managing quotas on the host filesystem. For ZFS-backed Docker hosts, you can set per-dataset quotas that apply to container data directories.

How do I find users who are close to their quota limits?

Use repquota to generate a report and filter:

1
2
3
4
5
6
7
8
# Show all users with usage
sudo repquota -s /home

# Show users over their soft limit
sudo repquota /home | awk '$4 > $5 && $4 < $6 {print $1}'

# Show users at or over their hard limit
sudo repquota /home | awk '$4 >= $6 {print $1}'

What happens when a user exceeds their quota?

When a user exceeds their soft limit, they receive warnings (if warnquota is configured) but can continue writing. When they hit their hard limit, any attempt to write more data fails with EDQUOT error. Applications handle this differently — some show “disk full” errors, others silently drop data. It is critical to monitor quota usage and alert administrators before hard limits are reached.

Can I set quotas on NFS-mounted directories?

Yes, but with limitations. NFSv4 supports quota propagation from the server to clients, but the quota must be set on the server filesystem. The client sees the quota but cannot modify it. NFSv3 does not propagate quotas at all — the client has no visibility into server-side limits. For multi-server environments, manage quotas on the central storage server (NFS export host) rather than individual clients.