2 months ago
Hi,
I want to install ffmpeg along with n8n, how can I do that?
1 Replies
2 months 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 databaseAny 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
2 months 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=ffmpeg
2 months 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/nodemodules/n8n/nodemodules/.pnpm/n8n-nodes-base@file+packages+nodes-base@aws-sdk+credential-providers@3.808.0asn1.js@512b981d6b49d407a163f4d5244314033/nodemodules/n8n-nodes-base/nodes/ExecuteCommand/ExecuteCommand.node.ts:102:12)",
" at WorkflowExecute.runNode (/usr/local/lib/nodemodules/n8n/nodemodules/.pnpm/n8n-core@file+packages+coreopenai@4.78.1encoding@0.1.13zod@3.24.1/nodemodules/n8n-core/src/execution-engine/workflow-execute.ts:1185:9)", " at /usr/local/lib/nodemodules/n8n/nodemodules/.pnpm/n8n-core@file+packages+coreopenai@4.78.1encoding@0.1.13zod@3.24.1/nodemodules/n8n-core/src/execution-engine/workflow-execute.ts:1534:27",
" at /usr/local/lib/nodemodules/n8n/nodemodules/.pnpm/n8n-core@file+packages+coreopenai@4.78.1encoding@0.1.13zod@3.24.1/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2098:11"
]
}
}
2 months ago
No, on Railway
2 months ago
you are messing with n8n variables, those are unrelated
2 months ago
Hi! Are you using a n8n template by chance?
2 months ago
cc:@qveera
2 months 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.
2 months ago
2 months ago
there's a little how to in the readme
2 months 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?
2 months ago
You deploy this template: https://railway.com/deploy/r2SNX_
2 months ago
And switch the Worker
service to the Dockerfile from the repo I linked
2 months 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
2 months ago
nope
2 months ago
want me to record a video of the entire process?
2 months ago
https://github.com/qveera/n8n-docker something wrong witht his?
2 months ago
looks fine
2 months ago
U add it to your repo and include it in your dockerfile
2 months 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.
2 months 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 month ago
!s
Status changed to Solved medim • about 2 months ago