wp-admin » Installation failed: Could not create directory.

Installation failed: Could not create directory.

When installing new plugins the error is displayed: Installation failed: Could not create directory.

image 2 - Installation failed: Could not create directory.
Installation failed: Could not create directory.

How to fix the Installation failed: Could not create directory. error

This error usually occurs because WordPress doesn’t have writing permissions for the folder.

To make sure this is the case, navigate to Tools > Site Health and look for permission issues:

image 3 - Installation failed: Could not create directory.
permission issues wordpress

According to this, WordPress is not allowed to edit any of the files, only to read them. This will cause errors when running updates, installing new plugins, or saving configuration that needs to write to the files.

To fix this, first, check and fix file permissions using the commands:

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

This will set necessary file & folder permissions.


If this does not resolve the issue, make sure that WordPress *(system user that runs the PHP process) has both read & write access to all WordPress files.

ps aux | grep httpd

This command will display currently running Apache processes and you can see under which user it is running:

image 4 1024x192 - Installation failed: Could not create directory.
nobody user

Then change the owner of the folder to that user:

chown nobody -R WPFOLDERNAME

If this still doesn’t resolve the issue, you can configure WordPress to use FTP instead of PHP for file uploads, by editing thr “wp-config.php” file.

Edit the wp-config.php file and insert this code above the “That’s all…” line:

define(‘FS_METHOD’, ‘ftpext’);
define(‘FTP_BASE’, ‘/pathtorootofyourblog/’);
define(‘FTP_USER’, ‘ftpusername’);
define(‘FTP_PASS’, ‘ftppassword’);
define(‘FTP_HOST’, ‘yoursite.com’);
define(‘FTP_SSL’, false);

Make sure to replace BASE, USER, PASS, and HOST information with your FTP user.

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended