Source: Quora

Errors on your WordPress site may inconvenience you and your users. You may not be able to provide a key feature or functionality if you receive the error “Installation failed: Could not create directory”.

It is relatively simple to fix this error. You can quickly get your WordPress plugin or theme running in minutes by tweaking a few settings.

This post will discuss the reasons for this error and other related issues. In the following sections, we will show you three ways to resolve the “Installation failed: couldn’t create directory” error so you can complete your installation or update.

Let’s begin!

Why Does WordPress Show “Installation Failed: Could Not Create Directory.” Error?

Installing WordPress might fail if you encounter the error “Installation Failed: Could Not Create Directory.” in one of three situations:

  1. If you install a theme or plugin through your WordPress dashboard
  2. When updating them
  3. When you attempt to upload files to your server’s wp-content directory

Each scenario has the exact root cause. As we move forward, let’s examine each situation in turn.

Diagnosing the Error

The majority of the time, changing your permissions will solve the problem. It would be a good idea howeke sure your proposed solution can actually solve your problem before you begin.

Two methods are outlined below to determine whether a permissions-related error is occurring on your site.

1. Check your website’s health with the WordPress Site Health Tool

Site Health was introduced with WordPress 5.2. In addition to performance test results, security checks, and WordPress configuration data, Site Health provides valuable information regarding your WordPress site.

In your WordPress dashboard, it is located under Tools > Site Health. Click on the Info tab to view your file permissions.

Continue scrolling down until you reach the last section, Filesystem Permissions.

The plugin and theme directories are listed there as other essential WordPress files. Each should have the “Writable” label:

Your permissions may not be configured correctly if you see “Not writable” listed next to the problematic folders. This means you’ll need to alter the permissions of the file.

2. Review your server’s error log

The error log on your server is another option. If you use this approach, you will be able to see any errors that have occurred, not just incorrect file permissions. Your hosting account should provide you with access to your logs.

In the sidebar of your MyKinsta dashboard, you can click on Sites if you’re a Kinsta customer. Select the site whose installation failed because the directory could not be created. Next, choose the Logs tab:

The error.log should be selected from the drop-down menu. This should allow you to see any recent errors on your server, including insufficient storage or incorrect file permissions, both of which might cause the installation error.

Your options are to correct your file permissions or upgrade your hosting plan if necessary if you see an error listed.

The Solution

The “Installation failed: Could not create directory error” is caused by your site’s permissions settings. Resetting them will resolve the issue. Your server must be connected via File Transfer Protocol (FTP), so you’ll need an FTP client.

A backup of your site’s files is always a good idea before making any changes in case problems arise, and the site needs to be restored. Get your FTP credentials by visiting your hosting account.

You may want to know that some hosting providers offer tools that you can use instead of FTP/SFTP. The File Manager can be found in your hosting account by logging in, choosing the site experiencing the error and selecting File Manager.

Conclusion

You and your users benefit from the features of your WordPress site’s plugins and themes. It can be frustrating to experience an error while installing or updating one. Hopefully, this article helps!