The ProblemYouâre in the middle of installing a new plugin like Yoast SEO or a heavy theme like Avada when WordPress suddenly hits a wall. Instead of a success message, you see a frustrating alert: Installation failed: Could not create directory.
This error is a red flag that your server's PHP process lacks the authority to write new data to the wp-content folder. It is a common headache that pops up after you migrate to a new host, restore a backup, or tighten server security settings.
Why This Happens- Incorrect Permissions: Your folders are locked down too tightly, preventing the server from adding new files.- Ownership Mismatch: The files belong to a user like 'root' or 'ftpuser,' but the web server (www-data) is trying to modify them.- Zero Disk Space: Your hosting plan is maxed out. Even a 20GB SSD can fill up quickly with old backups or massive log files.- Broken Temp Folder: WordPress can't find a safe place to unpack the plugin files before moving them to their final home.## Step-by-Step Fixes### 1. Reset Directory PermissionsWordPress follows a strict rule: folders should be 755 and files should be 644. If your wp-content/plugins folder is set to 555 (read-only), the installation will fail every time.
Log into your server via SSH and head to your WordPress root directory. Run these two commands to fix the entire site at once:
# Set all directories to 755
find . -type d -exec chmod 755 {} \;
# Set all files to 644
find . -type f -exec chmod 644 {} \;
If you only want to target the specific trouble spots, use these instead:
chmod 755 wp-content/plugins
chmod 755 wp-content/themes
chmod 755 wp-content/uploads
2. Fix File OwnershipPermissions don't matter if the web server doesn't 'own' the folders. If you uploaded files via FTP using a personal account, the web server (often www-data or apache) might be treated as an outsider.
Check who owns your files by running ls -la. If you see 'root' listed next to your folders, you need to hand control back to the web server.
# For Ubuntu or Debian (Nginx/Apache)
sudo chown -R www-data:www-data /var/www/html/wp-content
# For CentOS or RHEL
sudo chown -R apache:apache /var/www/html/wp-content
3. Check for Full Disk SpaceSometimes the 'permission' error is actually a 'no room left' error. Use the df command to see how much breathing room your server has:
df -h
Look at the Use% column. If your primary partition shows 100%, youâll need to delete old error logs or staging sites. Don't forget to check your Inodes (the total number of files allowed) with df -i. If you have millions of tiny session files, you might run out of Inodes before you run out of gigabytes.
4. Define a Custom Temporary DirectoryIf your server's global /tmp folder is restricted or full, WordPress will fail during the 'unzipping' phase. You can bypass this by creating a private temp folder inside your WordPress installation.
- Create a new folder named
tempinsidewp-content.- Open yourwp-config.phpfile.- Paste this line right above the 'That's all, stop editing!' comment:``` define('WP_TEMP_DIR', dirname(FILE) . '/wp-content/temp/');
Ensure this new `temp` folder also has `755` permissions so WordPress can actually use it.
## Testing the FixTo verify the solution, try a 'stress test' with a tiny plugin:
- Navigate to **Plugins > Add New**.- Search for 'Hello Dolly' (itâs less than 100KB).- Click **Install Now**.If it installs instantly, you've successfully cleared the bottleneck.
## Pro-Tips for SecurityNever set your permissions to `777`. While it might solve the error, itâs like leaving your front door wide open; anyone on the server can read, write, or delete your files. Stick to `755` for safety.
Calculating octal values for permissions can be confusing. I use the [Unix Permissions Calculator](https://toolcraft.app/en/tools/developer/unix-permissions) to visualize exactly what access I'm giving to the owner versus the public. Itâs a great way to double-check your work before applying changes to a live production server.
If you're on a shared hosting plan without SSH access, don't worry. You can perform these same steps using the 'File Manager' in cPanel. Just right-click the folder, select 'Change Permissions,' and ensure the numeric value is 755.

