Installation failed: Could not create directory 📝 WordPress

WordPress: Installation failed: Could not create directory (plugin/theme install or update)

WordPress can’t write to wp-content/plugins, themes or upgrade — ownership/permissions or disk space.

Seen on: WordPress

Meaning

Plugin/theme installs unpack into wp-content/upgrade first. If those folders are owned by another user (e.g. root after an FTP/SSH upload) or the disk is full, installation fails.

Common causes

  • wp-content/plugins, themes or upgrade not writable by PHP
  • Folder created by root/another user
  • Disk full
  • Security hardening (DISALLOW_FILE_MODS)

⚡ Quick fix

  1. Fix ownership of wp-content to the PHP user
  2. Create wp-content/upgrade with correct ownership
  3. Free disk space

Detailed fix by platform

Linux

  1. bash
    sudo chown -R www-data:www-data /var/www/html/wp-content
    sudo -u www-data mkdir -p /var/www/html/wp-content/upgrade
    df -h /var/www

How to diagnose

  1. Owner — Folder owners
  2. Disk — Free space
  3. Config — DISALLOW_FILE_MODS / FS_METHOD

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.