Want to install FFMPEG and other tools along with n8n
qveera
FREEOP

a year ago

Hi,

I want to install ffmpeg along with n8n, how can I do that?

Solved$10 Bounty

60 Replies

qveera
FREEOP

a year ago

3afdc61f-aba6-4d5e-a61d-e78e8fe708d1


joao-atlaas
HOBBY

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 redeploys
  • DATABASE_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.


qveera
FREEOP

a year ago

Any update?


cicerorph
HOBBY

a year ago

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']

cicerorph
HOBBY

a year ago

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=ffmpeg

qveera
FREEOP

a year ago

Where I need to speicify it?


a year ago

In your service settings there is a Variables tab. set it there


qveera
FREEOP

a year ago

You mean this one?

1384043096001740800


qveera
FREEOP

a year ago

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"

]

}

}


qveera
FREEOP

a year ago

Not working

1384074173374271498


qveera
FREEOP

a year ago

Is there any video tutorials?


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


qveera
FREEOP

a year ago

Yes, I am using n8n template


qveera
FREEOP

a year ago

@Medim


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.


qveera
FREEOP

a year ago

Thank You So Much @Medim , please let me know when we can connect



a year ago

there's a little how to in the readme


a year ago

try it and tell me how it goes


qveera
FREEOP

a year ago

Sure


qveera
FREEOP

a year ago

Thanks for your file, but we need to have worker and also redis and postgres right?


qveera
FREEOP

a year ago

@Medim


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


qveera
FREEOP

a year ago

Thanks @Medim , do you know how to create custom templates like that?


qveera
FREEOP

a year ago

Deployed the template



qveera
FREEOP

a year ago

Seems like I need to have my own github


qveera
FREEOP

a year ago

I will create it now


a year ago

You can also link my repo if you don't want to create one yourself


qveera
FREEOP

a year ago

====================

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


qveera
FREEOP

a year ago

Are you not getting?


a year ago

nope


a year ago

want me to record a video of the entire process?



qveera
FREEOP

a year ago

Thank You So Much @Medim , it helped


qveera
FREEOP

a year ago

https://github.com/qveera/n8n-docker something wrong witht his?


a year ago

looks fine


qveera
FREEOP

a year ago

Thank you so much it is working now


qveera
FREEOP

a year ago

how can I add a file to the docker?


qveera
FREEOP

a year ago

I need to add a file to which I use in my content creation


qveera
FREEOP

a year ago

it is a font file


a year ago

U add it to your repo and include it in your dockerfile


a year ago

it


qveera
FREEOP

a year ago

GOt it


qveera
FREEOP

a year ago

I want to keep it inside the worker


qveera
FREEOP

a year ago

ADD noto-serif-condensed-black-italic.ttf /home/node/

This is how I need to do it?


qveera
FREEOP

a year ago

In my locker docker which has only one n8n instance, I kept the file here and it is working

1384370864321204235


qveera
FREEOP

a year ago

Is it possible to see the folders and files of railway?


qveera
FREEOP

a year ago

Able to add it


qveera
FREEOP

a year ago

thanks bro


qveera
FREEOP

a year ago

You are the saviour


qveera
FREEOP

a year ago

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.


qveera
FREEOP

a year ago

Sure


a year ago

!s


Status changed to Solved medim 11 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...