How to install ffmpeg on my n8n instance running in Docker desktop on my Mac

Hi, i have a question, I can’t seem to find he answer to. I’m self hosting n8n on my local machine, a Mac, using Docker desktop. so far so good.

i have a workflow that require ffmpeg to run but I don’t know how to install ffmpeg on to my instance of n8n running in docker desktop on my local Mac.

i’m am NOT tech savvy, so I’m a little lost here. does anyone have the answer ?

Hi @Meier-dk

You’ll need to create a custom Docker image with ffmpeg installed,

Here’s how to do it step by step since you have Docker Desktop installed:

1. Create a Dockerfile

Create a new folder on your Mac, for example n8n-with-ffmpeg and inside it create a file called Dockerfile containing:

FROM docker.n8n.io/n8nio/n8n:latest

USER root
RUN apt-get update && apt-get install -y ffmpeg
USER node

2. Build your custom Docker image

Open a terminal, go to the folder where your Dockerfile is:

cd ~/Desktop/n8n-with-ffmpeg

and then run:

docker build -t n8n-with-ffmpeg .

This creates a new Docker image called n8n-with-ffmpeg

3. Run your container using the new image

Now, you can start using n8n using your custom image, use the same configuration you normally use, but replace docker.n8n.io/n8nio/n8n with n8n-with-ffmpeg:

docker volume create n8n_data

docker run -it --rm \
 --name n8n \
 -p 5678:5678 \
 -e GENERIC_TIMEZONE="<YOUR_TIMEZONE>" \
 -e TZ="<YOUR_TIMEZONE>" \
 -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \
 -e N8N_RUNNERS_ENABLED=true \
 -v n8n_data:/home/node/.n8n \
 n8n-with-ffmpeg
1 Like

Hi Mohamed3nan.

okay i will try and se if i can get it to work :slight_smile:

THX very much for the help :slight_smile:

build docker n8n-ffmpeng image. GitHub - skyjilygao/n8n-ffmpeg

mini n8n-with-ffmpeg % docker build -t n8n-with-ffmpeg .

[+] Building 9.7s (5/5) FINISHED docker:desktop-linux

=> [internal] load build definition from Dockerfile 0.0s

=> => transferring dockerfile: 142B 0.0s

=> [internal] load metadata for docker.n8n.io/n8nio/n8n:latest 9.5s

=> [internal] load .dockerignore 0.0s

=> => transferring context: 2B 0.0s

=> CACHED [1/2] FROM docker.n8n.io/n8nio/n8n:latest@sha256:aba343e23c1c757c535c73f33f1b7a5c940b1495d8910bf6cde9c2b5e4ac53a7 0.0s

=> ERROR [2/2] RUN apt-get update && apt-get install -y ffmpeg 0.2s

------

[2/2] RUN apt-get update && apt-get install -y ffmpeg:

0.143 /bin/sh: apt-get: not found

------

Dockerfile:4

--------------------

2 |

3 | USER root

4 | >>> RUN apt-get update && apt-get install -y ffmpeg

5 | USER node

6 |

--------------------

ERROR: failed to build: failed to solve: process “/bin/sh -c apt-get update && apt-get install -y ffmpeg” did not complete successfully: exit code: 127

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/yhtegigx5o9qss6kuajgnlcd7

this bug

This is old method, and not working like this rn,

please look here: