# Writing file using Execute Command

**URL:** <https://community.n8n.io/t/writing-file-using-execute-command/23791>\
**Category:** Questions\
**Tags:** execute-command\
**Created:** [March 6, 2023, 9:21am UTC](https://community.n8n.io/t/writing-file-using-execute-command/23791 "2023-03-06T09:21:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ampersanda](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ampersanda/32/23027_2.png) [@ampersanda](https://community.n8n.io/u/ampersanda)\
**Post date:** [March 6, 2023, 9:21am UTC](https://community.n8n.io/t/writing-file-using-execute-command/23791/1 "2023-03-06T09:21:29Z")

</div>

## Describe the issue/error/question

I’m trying to run `youtube-dl` on modified n8n docker file, but when I tested it it says permission denied. I guess it’s expected because when I tried using `touch` command, it’s also return the same thing.

Is there any way to achieve this?

## What is the error message (if any)?

`ERROR: Command failed: youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=code ERROR: unable to open for writing: [Errno 13] Permission denied: 'video-title.webm.part'`

## Please share the workflow

## Share the output returned by the last node

```auto
NodeOperationError: Command failed: youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=code
ERROR: unable to open for writing: [Errno 13] Permission denied: 'video-title.webm.part'

    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/ExecuteCommand/ExecuteCommand.node.js:76:27)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:658:28)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:590:53

```

## Information on your n8n setup

- \*\*n8n version:_0.218.0_
- **Database you’re using (default: SQLite):**
- **Running n8n with the execution process [own(default), main]:**
- \*\*Running n8n via [Docker, npm, n8n.cloud, desktop app]:_Docker_

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [March 6, 2023, 4:44pm UTC](https://community.n8n.io/t/writing-file-using-execute-command/23791/2 "2023-03-06T16:44:24Z")

</div>

Hey @ampersanda,

Welcome to the community 🎉

Have you added a volume to your container for writing files to? Step 5 on this page: [Docker Compose - n8n Documentation](https://docs.n8n.io/hosting/installation/server-setups/docker-compose/#5-create-docker-compose-file) has a part that talks about adding a volume for writing files to.

The quick version is you would need to use a directory that can be written to so in your command you would have to specify an output folder or cd into a different directory.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [June 4, 2023, 4:44pm UTC](https://community.n8n.io/t/writing-file-using-execute-command/23791/3 "2023-06-04T16:44:51Z")

</div>

Closed on June 4, 2023, 4:44pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
