# Fix "Unable to create directory"
Source: https://docs.webgee.com/en/hosting/wordpress/resolving-the-unable-to-create-directory-error-in-wordpress



**"Unable to create directory"** appears when uploading media, updating a plugin
or theme, or installing WordPress. WordPress cannot write where it needs to.
Applies to all shared and reseller hosting.

There are three causes. Work through them in this order — permissions is the
usual one, but a full disk produces the same message and no amount of
permission-fixing will help.

## 1. Check disk space [#1-check-disk-space]

If the account is at its disk quota, nothing can be written anywhere. Check
**Disk Usage** in cPanel before changing anything else. See
[Monitor disk usage with cPanel](/en/hosting/monitoring-disk-usage-with-cpanel).

## 2. Correct file permissions [#2-correct-file-permissions]

Use cPanel's **File Manager** or an FTP client.

1. Go to `/wp-content/`.
2. Select the `/uploads/` directory and open **File Permissions** (**Change
   Permissions** in File Manager).
3. Set directories to **755**.
4. Tick **Recurse into subdirectories** and apply to **directories only**.
5. Repeat for files, setting them to **644**, applied to **files only**.

Directories and files need different values, which is why this is two passes.
`755` on a directory means the owner can write and others can list it; `644` on
a file means the owner can write and others can read it.

<Callout type="warn">
  Never set anything to `777`. It permits any process on the server to write to
  your files, and it is the permission malware looks for. It is also not a fix —
  if `755` does not work, ownership is wrong, and that needs support rather than
  a looser permission.
</Callout>

## 3. Check the upload path [#3-check-the-upload-path]

A wrong path in WordPress makes it try to write somewhere that does not exist.

1. In WordPress, go to **Settings** → **Media**.
2. Under **Uploading Files**, check **Store uploads in this folder**.
3. It should be `wp-content/uploads`, or empty. If it holds an absolute path
   from another server — something beginning `/home/olduser/` — that is the
   problem.
4. Correct it and **Save Changes**.

This is common after a migration. If the field is not shown, the value is set in
`wp-config.php` as `UPLOADS` and must be corrected there instead.

## Verify [#verify]

Upload a small image through **Media** → **Add New**. If it succeeds, retry
whatever failed originally.

## If it still fails [#if-it-still-fails]

The files are probably owned by the wrong user, which happens when files are
extracted or restored as a different account. Ownership cannot be changed from
cPanel — contact support with the affected path.

## Related [#related]

* [Monitor disk usage with cPanel](/en/hosting/monitoring-disk-usage-with-cpanel)
* [Reset WordPress permalinks](/en/hosting/wordpress/how-to-reset-your-wordpress-permalinks)
