a year ago
Hi,
I want to install ffmpeg along with n8n, how can I do that?
60 Replies
a year ago
If you're looking to use tools like FFmpeg alongside your n8n workflows on Railway, you'll need to customize the deployment environment. By default, the official n8n Docker image doesn’t include additional utilities like FFmpeg, but with a custom Dockerfile, it's straightforward to add them and deploy a fully integrated solution.
To get started, create a Dockerfile that extends the official n8n image and installs FFmpeg using standard Debian package management. Here's an example:
FROM n8nio/n8n:1.93.0 # Install ffmpeg and other optional tools USER root RUN apt-get update && apt-get install -y \ ffmpeg \ curl \ wget \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Switch back to n8n user to maintain security best practices USER node
This configuration ensures that the n8n environment stays intact while enabling access to powerful tools like FFmpeg. After creating the Dockerfile, push it to a GitHub repository and connect that repo to a new service in Railway. Railway will detect the Dockerfile and automatically build and deploy your customized container.
Don't forget to configure your environment variables in Railway as well. At a minimum, you should set:
N8N_ENCRYPTION_KEY: a persistent encryption key to retain credentials across redeploysDATABASE_URL: a connection string to a persistent PostgreSQL database- Any other
N8N_configuration variables required for your workflows
Once deployed, FFmpeg will be available within your container. You can use it in n8n workflows via the Execute Command node or custom scripts.
By combining FFmpeg and n8n in a single Railway deployment, you unlock a range of possibilities—like video/audio processing, automation with media files, or advanced integrations. This method gives you full control over your environment without sacrificing the simplicity and scalability Railway offers.
You can install ffmpeg and n8n by creating a nixpacks file or a railpack file, here is an example using nixpacks:
# nixpacks.toml file
[phases.setup]
nixPkgs = ['ffmpeg', 'n8n']You can find other nix packages on https://search.nixos.org/packages
a year ago
Hey, to install using Railpack (the new Railway build system, you're probably already on it) just specify the following environment variable:
RAILPACK_PACKAGES=ffmpega year ago
In your service settings there is a Variables tab. set it there
I found the variable section and added, deployed. but still getting the error
{
"errorMessage": "Command failed: ffmpeg\n/bin/sh: ffmpeg: not found\n",
"errorDetails": {},
"n8nDetails": {
"nodeName": "Execute Command",
"nodeType": "n8n-nodes-base.executeCommand",
"nodeVersion": 1,
"itemIndex": 0,
"time": "6/16/2025, 11:12:21 AM",
"n8nVersion": "1.97.1 (Self Hosted)",
"binaryDataMode": "default",
"stackTrace": [
"NodeOperationError: Command failed: ffmpeg",
"/bin/sh: ffmpeg: not found",
"",
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_12b981d6b49d407a163f4d5244314033/node_modules/n8n-nodes-base/nodes/ExecuteCommand/ExecuteCommand.node.ts:102:12)",
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_openai@4.78.1_encoding@0.1.13_zod@3.24.1_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1185:9)",
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_openai@4.78.1_encoding@0.1.13_zod@3.24.1_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1534:27",
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_openai@4.78.1_encoding@0.1.13_zod@3.24.1_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2098:11"
]
}
}
a year ago
No, on Railway
a year ago
you are messing with n8n variables, those are unrelated
a year ago
Hi! Are you using a n8n template by chance?
a year ago
cc:@qveera
a year ago
If you are using this template: https://railway.com/deploy/r2SNX_
You will need to create a custom dockerfile for the worker and include ffmpeg there.
I'm currently at my work office but would be happy to assist you later, a lot of users have this same issue so it will help for future threads.
a year ago
a year ago
there's a little how to in the readme
a year ago
try it and tell me how it goes
Thanks for your file, but we need to have worker and also redis and postgres right?
a year ago
You deploy this template: https://railway.com/deploy/r2SNX_
a year ago
And switch the Worker service to the Dockerfile from the repo I linked
a year ago
You can also link my repo if you don't want to create one yourself
====================
Starting Healthcheck
====================
Path: /healthz
Retry window: 5m0s
Attempt #1 failed with service unavailable. Continuing to retry for 4m55s
Attempt #2 failed with service unavailable. Continuing to retry for 4m43s
Attempt #3 failed with service unavailable. Continuing to retry for 4m31s
Attempt #4 failed with service unavailable. Continuing to retry for 4m22s
Attempt #5 failed with service unavailable. Continuing to retry for 4m3s
Attempt #6 failed with service unavailable. Continuing to retry for 3m37s
Attempt #7 failed with service unavailable. Continuing to retry for 2m56s
Seeing these errors on the main n8n
a year ago
nope
a year ago
want me to record a video of the entire process?
a year ago
https://github.com/qveera/n8n-docker something wrong witht his?
a year ago
looks fine
a year ago
U add it to your repo and include it in your dockerfile
a year ago
it
ADD noto-serif-condensed-black-italic.ttf /home/node/
This is how I need to do it?
In my locker docker which has only one n8n instance, I kept the file here and it is working

How can I access the files created by my automation ? I create some temp files and I need to delete them at the end of the automation. Normally when something fails, it does not delete the fails.
a year ago
Hmm, can you access it directly through n8n? otherwise u would need to use the Filebrowser template but considering your usecase it would be a hassle to do so.
a year ago
!s
Status changed to Solved medim • 11 months ago

