This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

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

Updated on May 30, 2022

5 Min Read
wordpress installation failed could not create directory

Trying to resolve an “installation failed: Could not create directory.” error in WordPress?

All right! You’re in the right place.

WordPress is a great CMS, and building a WordPress website is a simple matter. But fixing WordPress errors can be a frustrating experience for an individual. Because there’s no one single fix for many of them. And so you’ll need to troubleshoot for the actual reason behind the issue to resolve it.

In this article, I’m assuming that you are fixing the could not create directory error in WordPress on your own. To do so, follow my instructions carefully. But before diving into the troubleshooting process, let’s try to understand the possible reasons behind a could not create directory error.

What is the “Installation Failed: Could Not Create Directory” Error?

It’s a file permission issue that happens because of improper site configurations and settings. WordPress cannot create a folder/directory for your plugin or theme if your file permission isn’t set correctly.

Sometimes the issue occurs when you’re updating your plugin/theme or uploading image files. The error will then appear as: update failed: could not create directory. However, the main reason is the same for all cases, and you can fix it with the same troubleshooting methods.

Managed WordPress Hosting Starting From $10/Month

Run quick disk cleanups & manage all server-related issues easily on the intuitive cloud hosting platform.

Why Does the “Installation Failed: Could Not Create Directory” Error Occur?

There are two reasons behind the could not create a directory error.

Reason #1: You Don’t Have the Right Permissions

Your hosting may set up some security permissions to protect the server and site folders from unwanted changes. This could deny you the authority to change your server and site structure.

A new plugin or theme creates a directory (with the plugin or theme name) in the wp-content folder during the installation process. Proper permission is needed to set up the file structure. Similarly, the plugin or theme needs permission to add a new version and remove outdated ones for the update process.

The permission mode is divided into three parts: write, read, and execute, where each has its numeric value to define the permission for user, group, and world.

In this article, I will show you how to set permission for your files and folders to avoid this error. For more information on what is recommended for WordPress, go here.

Reason #2: Lack of Disk Space

Sometimes, you may encounter this error due to high memory usage and no disk space. That’s why you’re always recommended to host your websites on a dedicated cloud hosting platform, where you can quickly scale up the server size with a few clicks.

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

Let’s look at some troubleshooting methods and some techniques to quickly fix and avoid creating directory errors in WordPress.

1. Create a Backup

First create a backup for your whole website, so if something goes wrong during the process, you can just restore it to the way it was.

You can create a backup for your WordPress site through: a hosting backup, a WordPress plugin, and a manual method. Learn how to back up a WordPress site with this step-by-step guide.

2. Disk Usage Optimization

As I mentioned, sometimes you may encounter this error due to low disk space. So, you need to monitor your server specs and check the memory section. If your server memory is full, you can scale your server size, or run a disk optimization that will help you delete unnecessary files and folders. This creates space for your plugin/theme installation.

Cloudways lets you run a disk cleanup in a few clicks through the server management panel.

Run Cleanup

If your server has enough memory space and you are still encountering a could not create directory error, you need to continue troubleshooting.

3. Resetting File and Folder Permissions

I will reset my file and folder permission directly from the Cloudways management panel. If this feature is not available on your current hosting, you can skip this method and move to the next step, where I’ve performed the setting file permission process via an FTP client like FileZilla.

Reset File and Folder Permission

The beauty of a managed cloud hosting platform is that it offers all the essential features and is specially designed to provide a hassle-free hosting experience. On Cloudways, go under the application management panel > application settings > general. Go to reset file/folder permission to reset the file ownership.

Once you click on the reset button, the directories permission will be reset to 774 and files permission to 664. For more details, check out this piece on resetting files and folder permission.

4. Setting File Permissions via an FTP Client

This step will show you how to change the files and folder permission via an FTP client like FileZilla. If you haven’t already installed the FileZilla FTP client, here’s the download link.

First launch the FileZilla application and provide your server’s access credentials to connect remotely. Go to the public_html folder > right-click (mouse) and click file permissions.

open file permission

Set 755 in the numeric value field > select recurse into subdirectories > apply to directories only and click ok.

wordpress folder permission

Repeat the same actions for file permission and set 644 in the numeric value field > select recurse into subdirectories > apply to files only and click ok.

wordpress file permission

When you set the file and folder permission, clear your cache and try to install/upgrade your plugin/theme again.

5. Monitor Application Logs

It’s good practice to consistently view and monitor your application access and error logs. You can view the process details for every running request and error. Most reputable hosting providers offer log monitoring features on their platform, and I hope it’s also available in your case.

Logs

If your website isn’t working fine and has issues, this feature will let you know those errors. On Cloudways, there’s a search and filter available to view your last 1000 recent logs. You can also view other HTTP status code logs like 403, 404, 501, and more.

Summary

I hope this article helped you understand what the installation failed: could not create directory error is, and how to fix the file permission issue. If you know another way to resolve this error, please let us know in the comment section below.

Frequently Asked Questions

Q: How can I fix the “unable to create directory” error?

A: There are four ways to fix the installation failed: could not create directory error.

  • Disk Usage Optimization
  • Resetting File and Folder Permission
  • Setting File Permission via FTP Client
  • Monitor Application Logs

You can check out the ‘How to Fix’ part of this article for details.

Q: What causes a “could not create directory” error in WordPress?

A: There are two reasons for the could not create directory error.

  1. Your hosting set up security permissions to protect the server and site folders from unwanted changes, and in the process took away your authority.
  2. It could be due to high memory usage and no disk space.
Share your opinion in the comment section. COMMENT NOW

Share This Article

Customer Review at

“Beautifully optimized hosting for WordPress and Magento”

Arda Burak [Agency Owner]

Farhan Ayub

Farhan is a community manager at Cloudways. He loves to work with WordPress and has a passion for web development. Mostly, he spends his time interacting with the people in the WordPress community. Apart from his work life, Farhan spends his time gaming and playing sports. Feel free to contact him at [email protected]

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!