How to Fix the “Installation Failed: Could Not Create Directory.” Error in WordPress

Are you trying to fix the “installation failed: Could not create directory.” error on WordPress?

Great! You’ve come to the right place.

“Installation failed, could not create directory.” is a relatively common error message that many WordPress users encounter.

Throughout this post, we’ll examine what causes this error and other issues associated with it.

Then we will show you how to resolve the “Installation failed: could not create directory” error message so that your installation or update can be completed.

Let’s get the troubleshooting started!

What Is “Installation Failed: Could Not Create Directory”?

This error may occur due to an incorrect configuration of your WordPress files and folders permissions. File permissions must be set correctly in order for WordPress to create a plugin directory or theme folder.

In all cases, the underlying cause is the same and you can resolve it using the same troubleshooting methods. 

What Causes the “Installation Failed: Could Not Create Directory.” Error in WordPress

You might encounter the “Installation Failed: Could Not Create Directory.” error in WordPress in the following situations:

  1. After installing a new theme or plugin in the WordPress dashboard
  2. During an update of plugin or theme
  3. When uploading files to the wp-content directory on your server

1. New Theme or Plugin Installation issue

You can add a theme or plugin to your WordPress site, it creates a new folder in which its files are stored when you add a theme or plugin.

Nevertheless, if the plugin or theme doesn’t have permissions to write to the root directory of your website, it won’t be able to complete this task. When this happens, you’ll see an error such as “Installation failed: could not create directory.”

By showing you this error, your server is telling you that adding the plugin or theme to your site is not allowed. Generally, this problem occurs on newly developed WordPress sites.

It’s important to note that there is a similar, less common cause for this error. If your server is running out of disk space to store your site’s files, it may show this same message because it has no room for the new plugin or theme.

2. Updating an Existing Plugin

It is not uncommon to see an error very similar to the one we described above when attempting to upgrade a WordPress theme or plugin that has already been installed on your site. 

It usually says, “Update failed: cannot create directory.”.

The causes of this problem are similar. Whenever you update a plugin or theme, WordPress needs to rewrite its files on the server. If you don’t have enough space or your permissions are incorrect, the process will not be able to access or upload the right files.

Both issues have the same cause, therefore, their solutions are also the same.

We will come to it in the paragraphs.

3. Uploading Files Directly to The wp-content Directory of WordPress

Hosting providers implement server permissions as a security feature to prevent unauthorized parties from making changes to your site.

Nevertheless, if they are not configured correctly, they can lock you out of your own files.

Thus, even if you upload plugins or themes directly to the wp-content directory on your server to get around the “Installation failed: could not create directory.” error in your WordPress dashboard, the problem will likely persist. The problem is not with your installation of WordPress, but with your server.

You will need to adjust your server’s settings to fix the problem.

Fixing the “Installation Failed: Could Not Create Directory” Error in WordPress?

Fortunately, this error is relatively easy to fix.  It is important, however, that you check whether that solution is capable of solving your problem before you start working on it. So let’s go to the WordPress health check section of your site.

Step 1: Go the WordPress Site Health Check Tool

WordPress has a native health check system. Within it, you will find a wealth of useful information about the health of your website.

From your WordPress dashboard, navigate to Tools > Site Health and click on info.

Finally, scroll all the way down to the last section “Filesystem Permissions”.

All should be listed as writable. You will see “Not writable” next to the problematic folders if your permissions are not configured correctly. Then your file permissions need to be corrected.

We will show you how!

Step 2: Create Backup

The first step is to create a backup of your entire website so that if anything goes wrong, you can restore it back to its original state.

You can easily create a backup of your website with WP Umbrella.

backup your site with WP Umbrella

Install WP Umbrella from your WordPress admin, activate the plugin and create an account.

Then go to WP Umbrella’s application, click on your project and go to the backup tab.

From here, click on backup now and wait for your backup to be ready! Now let’s troubleshoot this!

Step 3 : Editing Folder Permissions With Your FTP Client

In order to connect remotely, you need to launch the FileZilla application and provide your server’s credentials.

Next, right-click (mouse) on the public_html folder and then, select the folders wp_contentwp_includes, and wp_admin.

Right-click on them and choose File Permissions:

editing file permissions

Make sure the following options are set:

  • Owner Permissions: Read, Write, Execute.
  • Group Permissions: Read, Execute.
  • Public Permissions: Read, Execute.
  • Numeric value: 755.
  • Apply to directories only.

You can now try to install or update the plugin/theme again on your website.

Alternative: Edit FTP Permissions In The “wp-config.php” File

In case the first option does not work, you might try changing the FTP permissions through the “wp-config.php” file. It is a very simple process.

  1. Open your web hosting account and click “File Manager”, or use your FTP client to access it.
  2. Navigate to the root directory of your website and open the “wp-config.php” file.
  3. Add the following code to your “wp-config.php” file:
define(‘FS_METHOD’, ‘ftpext’);
define(‘FTP_BASE’, ‘/pathtorootofyoursite/’);
define(‘FTP_USER’, ‘ftpusername’);
define(‘FTP_PASS’, ‘ftppassword’);
define(‘FTP_HOST’, ‘yoursite.com’);
define(‘FTP_SSL’, false);

Please ensure the information in brackets is replaced with yours.

  1. Save the “wp-config.php” file.

Go back to your dashboard and try again to install or update the plugin. Everything should work this time.

We hope this article helped you to fix this WordPress error. You might also be interested by our article on how to fix the” Destination Folder Already Exists ” error in WordPress.