<p>I understand now within the context of you are using docker. Since docker creates a new file system separate from your computer's file system, you will want to run these commands on the docker instance. </p>

<p>I do not use docker regularly, but I believe you can use <code>docker attach</code> while the droplet is running to access the droplet's file system.</p>

<p>You will want to set the parent folder to have higher privileges. Try this command: </p>

<pre><code>chmod 774 craftcms-assets
</code></pre>

<p>Privileges are composed of three numbers: self, group, and world. There are also three access levels: read, write, and execute. 7 will give access to read, write, and execute. You will want to use 7 for your own commands (self) and for craft's commands (group), but not for the general public (world).</p>

<p>Hope this helps!</p>

CC BY-SA 4.0
2019-08-27T21:48:33.933Z
Ok I tried that, and I'm still getting the error.
BBaysinger
CC BY-SA 4.0
2019-08-27T22:02:37.803Z
it's the same error? can you make sure that the web and repo folders have 774 also
Clark Nelson
CC BY-SA 4.0
2019-08-27T22:04:00.713Z
Hm. Yup, same error. Changed both of those, and it's still not working.
BBaysinger
CC BY-SA 4.0
2019-08-27T22:07:51.870Z
Realized Docker Compose could have something to do with it. Updated my question.
BBaysinger
CC BY-SA 4.0
2019-08-28T14:05:52.983Z
@BBaysinger I've updated my answer with docker information!
Clark Nelson
CC BY-SA 4.0
2019-08-27T21:45:33.767Z
2019-08-28T14:05:17.437Z
2019-08-28T14:05:17.437Z
Clark Nelson
<p>Since this is the top result on Google for this error, I wanted to add that what fixed it for me (a non-docker user) was <strong>setting the permissions for the &quot;/assets/images&quot; directory to 775</strong>.</p>
<p>Craft's documentation says to set certain folders to 774, but evidently it needs that Public Execution permission for the system to recognize it.</p>

CC BY-SA 4.0
2021-03-23T14:13:29.403Z
2021-03-23T14:13:29.403Z
FirstAidChris
<p>In Craft 3.2.10, I'm getting this error message when I try to upload an image asset:</p>

<blockquote>
  <p>Upload failed. The error message was: “Impossible to create the root
  directory "/Users/me/Work/Client/repo/web/craftcms-assets/project-slide-photos". mkdir():
  Permission denied”</p>
</blockquote>

<p>I've made the permissions for <code>project-slide-photos</code> to 777 and 774, and likewise tried both for the parent directory. Is it trying to create a directory that's already there? I tried removing <code>project-slide-photos</code> also, and it still doesn't work.</p>

<p>What do I need to do to make my assets upload into this directory?</p>

<p>Edit: Wondering if using Docker Compose could have something to do with this:</p>

<p><code>docker-compose.yml</code>:</p>

<pre><code>version: '3'
services:
    web:
        image: 'flipbox/php:72-apache'
        ports:
            - '80:80'
            - '443:443'

        volumes:
            - '.:/var/www/html/'
        environment:
            ENVIRONMENT: dev
            DB_SERVER: db
            DB_USER: craft
            DB_PASSWORD: craft
            DB_DATABASE: craft
            XDEBUG_ON: "yes"
            XDEBUG_HOST: "host.docker.internal"
            XDEBUG_IDEKEY: "PHPSTORM"
            APACHE_DOCUMENT_ROOT: "/var/www/html/web"
    db:
        image: 'mysql:5.7'
        restart: always
        ports:
            - '3306:3306'

        volumes:
            # Location to import a database dump. 
            - ./src:/docker-entrypoint-initdb.d
            # Location of the generated mysql files.
            - ./mysql:/var/lib/mysql

        environment:
            MYSQL_ROOT_PASSWORD: password
            MYSQL_DATABASE: craft
            MYSQL_USER: craft
            MYSQL_PASSWORD: craft
</code></pre>

<assets><upload><volumes>
Error on upload: "Impossible to create the root directory..."
# Error on upload: "Impossible to create the root directory..."

(Asked by: username_0 on 2019-08-27)

In Craft 3.2.10, I'm getting this error message when I try to upload an image asset:

Upload failed. The error message was: “Impossible to create the root
  directory "/Users/me/Work/Client/repo/web/craftcms-assets/project-slide-photos". mkdir():
  Permission denied”

I've made the permissions for project-slide-photos to 777 and 774, and likewise tried both for the parent directory. Is it trying to create a directory that's already there? I tried removing project-slide-photos also, and it still doesn't work.
What do I need to do to make my assets upload into this directory?
Edit: Wondering if using Docker Compose could have something to do with this:
docker-compose.yml:
version: '3'
services:
    web:
        image: 'flipbox/php:72-apache'
        ports:
            - '80:80'
            - '443:443'

        volumes:
            - '.:/var/www/html/'
        environment:
            ENVIRONMENT: dev
            DB_SERVER: db
            DB_USER: craft
            DB_PASSWORD: craft
            DB_DATABASE: craft
            XDEBUG_ON: "yes"
            XDEBUG_HOST: "host.docker.internal"
            XDEBUG_IDEKEY: "PHPSTORM"
            APACHE_DOCUMENT_ROOT: "/var/www/html/web"
    db:
        image: 'mysql:5.7'
        restart: always
        ports:
            - '3306:3306'

        volumes:
            # Location to import a database dump. 
            - ./src:/docker-entrypoint-initdb.d
            # Location of the generated mysql files.
            - ./mysql:/var/lib/mysql

        environment:
            MYSQL_ROOT_PASSWORD: password
            MYSQL_DATABASE: craft
            MYSQL_USER: craft
            MYSQL_PASSWORD: craft

**Tags:** assets, upload, volumes


---

## 2 answers

### Answer by username_1 on 2019-08-27. Score: 4 | Accepted answer

I understand now within the context of you are using docker. Since docker creates a new file system separate from your computer's file system, you will want to run these commands on the docker instance. 
I do not use docker regularly, but I believe you can use docker attach while the droplet is running to access the droplet's file system.
You will want to set the parent folder to have higher privileges. Try this command: 
chmod 774 craftcms-assets

Privileges are composed of three numbers: self, group, and world. There are also three access levels: read, write, and execute. 7 will give access to read, write, and execute. You will want to use 7 for your own commands (self) and for craft's commands (group), but not for the general public (world).
Hope this helps!

> **Comments:**
> **username_0**: Ok I tried that, and I'm still getting the error.  
> **username_1**: it's the same error? can you make sure that the web and repo folders have 774 also  
> **username_0**: Hm. Yup, same error. Changed both of those, and it's still not working.  
> **username_0**: Realized Docker Compose could have something to do with it. Updated my question.  
> **username_1**: @username_0 I've updated my answer with docker information!  

---

### Answer by username_2 on 2021-03-23. Score: 2

Since this is the top result on Google for this error, I wanted to add that what fixed it for me (a non-docker user) was **setting the permissions for the "/assets/images" directory to 775**.

Craft's documentation says to set certain folders to 774, but evidently it needs that Public Execution permission for the system to recognize it.


---

