Tips > Ops & Security

Monitor Disk Space for Binary Data Growth

n8n stores binary data (file attachments, images, API response bodies) on the filesystem by default, under the `/home/node/.n8n` volume.

n8n writes binary data to the filesystem by default, so file-heavy workflows can fill the disk and crash PostgreSQL. A cron shell script checks the volume's usage and posts a Slack alert once it passes a threshold, such as 80 percent. Pair it with execution-data pruning, or move binary storage to S3, to slow the growth.

Why does binary data fill up disk on self-hosted n8n?

n8n stores binary data (file attachments, images, API response bodies) on the filesystem by default, under the /home/node/.n8n volume. Workflows that process files -- such as email attachment handlers, PDF generators, or image pipelines -- can consume gigabytes of disk space per day. Without monitoring, the disk fills up, PostgreSQL crashes (it needs disk for WAL files), and n8n stops functioning.

Real-world example: You set up a disk space alert that fires when usage exceeds 80%, giving you time to clean up or expand storage before a crisis.

How do you alert on disk usage with a cron script?

A shell script checks the data volume and posts to Slack when usage crosses the threshold:

#!/usr/bin/env bash
set -euo pipefail

THRESHOLD=80
SLACK_WEBHOOK_URL="${SLACK_WEBHOOK_URL}"
HOSTNAME=$(hostname)

# Check disk usage for the n8n data volume mount point

USAGE=$(df /var/lib/docker/volumes | tail -1 | awk '{print $5}' | tr -d '%')

if [ "${USAGE}" -ge "${THRESHOLD}" ]; then
  DISK_INFO=$(df -h /var/lib/docker/volumes | tail -1)

  curl -s -X POST "${SLACK_WEBHOOK_URL}" \
    -H 'Content-Type: application/json' \
    -d "{
      \"text\": \"DISK ALERT on ${HOSTNAME}: Docker volume storage is at ${USAGE}% capacity.\n\`\`\`${DISK_INFO}\`\`\`\nAction required: prune old executions or expand storage.\"
    }"
fi

Schedule it with cron:


# Check disk space every 15 minutes

*/15 * * * * /opt/scripts/disk-monitor.sh

How do you slow disk growth in n8n?

Configure n8n to automatically prune old execution data to slow disk growth:

services:
  n8n:
    environment:
      # Prune execution data older than 7 days

      EXECUTIONS_DATA_PRUNE: "true"
      EXECUTIONS_DATA_MAX_AGE: 168  # hours

      # Store binary data in the database instead of filesystem (optional)

      # This consolidates storage but increases database size

      # N8N_BINARY_DATA_MODE: default

Tip: Binary Data in S3. For high-volume workflows, configure n8n to store binary data in S3 instead of the local filesystem. Set N8N_BINARY_DATA_MODE=s3 along with the appropriate S3 credentials. This moves the storage growth problem to S3, which scales automatically.

Monitoring disk space with automated alerts prevents the single most common cause of unplanned n8n outages on self-hosted instances.

Related: Set a Unique Encryption Key and Back It Up · Configure Payload Size and Binary Data Mode for Large Files

Showcase builds

19 complete workflows from my own projects, each with its n8n workflow JSON to import. Showcase entries link the file at the end of the article.

See the showcase builds

Keep reading

190 entries grouped by topic, from first workflow to queue mode. Free, no signup.

Browse the encyclopedia

Need it built?

I design, build and run n8n systems for clients. Every engagement starts with a $1,500 diagnostic audit, credited toward the build.

Book an introductory call