Deploy N8N (w/ FFmpeg)

n8n + FFmpeg [Oct '26] (Video Automation/Workers/Execute Command) Self Host

Deploy N8N (w/ FFmpeg)

Just deployed

/bitnami

Primary

n8nio/n8n

Just deployed

/var/lib/postgresql/data

Worker

n8nio/n8n

Just deployed

Deploy and Host n8n with FFmpeg on Railway (self hosted video and audio automation)

n8n is an open source workflow automation platform, and FFmpeg is the standard tool for processing video and audio. Together they let you cut clips, convert formats, generate thumbnails and normalize audio inside your workflows, without paying a rendering API per video. The problem: the official n8n Docker image does not ship FFmpeg, and n8n Cloud does not allow the Execute Command node at all. This template solves it by deploying self hosted n8n in queue mode with FFmpeg and ffprobe already installed on the workers.

About Hosting n8n with FFmpeg (n8n Docker, queue mode)

Running FFmpeg from n8n requires a self hosted instance where you control the container. On a production setup that means n8n in queue mode: a main instance for the editor and webhooks, workers that execute the workflows, Redis as the job queue and PostgreSQL for storage. FFmpeg must be installed where the workflows actually run, which in queue mode is the worker, not the main instance.

This template deploys four services, connected over Railway's private network at deploy time:

  • Primary: n8n editor, REST API and webhooks, exposed on an HTTPS domain.
  • Worker: executes workflows, with FFmpeg and ffprobe installed.
  • Redis: job queue between Primary and Worker.
  • PostgreSQL: workflows, credentials and execution history.

Why Deploy n8n with FFmpeg on Railway

Railway bills by resource usage, not by workflow execution or by video rendered. A worker that sits idle most of the day costs very little, and when you need more throughput you scale workers without touching the editor.

OptionWith n8n + FFmpeg on RailwayWith the other option
n8n CloudExecute Command and FFmpeg availableExecute Command not available on any plan
Rendering APIsPay only for compute, unlimited rendersPay per video, per minute or per credit
Zapier / MakeFull media processing inside the workflowNo FFmpeg, priced per task or operation
Manual install (VPS)Queue mode and FFmpeg wired in one clickYou build images, configure Redis, proxy and TLS

Common Use Cases for n8n with FFmpeg

  • Short-form content automation: cut long videos into clips for YouTube Shorts, Reels and TikTok.
  • Vertical video conversion: turn 16:9 into 9:16 with padding or crop.
  • Thumbnails and previews: extract a frame or build a GIF preview at any timestamp.
  • Podcast and audio workflows: normalize loudness, convert formats, trim silence.
  • Media quality checks: read duration, resolution, codec and bitrate with ffprobe before publishing.
  • Upload pipelines: transcode user uploads to a standard format before storing them.
  • AI video pipelines: stitch AI-generated images, voiceovers and subtitles into a final video.

Dependencies for n8n with FFmpeg Hosting

Deployment Dependencies

  • PostgreSQL for workflows, credentials and execution history.
  • Redis for the queue mode job queue.
  • Worker service with FFmpeg and ffprobe.

Implementation Details

The template runs the official n8nio/n8n image for both Primary and Worker, with EXECUTIONS_MODE=queue. The worker installs FFmpeg and ffprobe on startup, so it is always available where executions run. Database, Redis and the shared N8N_ENCRYPTION_KEY are wired automatically, so workers can read the credentials created in the editor.

Why FFmpeg does not work on a normal n8n install

Three separate things block FFmpeg in n8n, and most people hit them in sequence:

  1. The official image has no FFmpeg. Running it returns "ffmpeg: not found".
  2. n8n Cloud blocks the Execute Command node. There is no workaround on Cloud.
  3. n8n 2.0 disables Execute Command by default. Setups that worked on 1.x stop working after upgrading, until the node is re-enabled through NODES_EXCLUDE.

How to use FFmpeg in an n8n workflow

FFmpeg works on files on disk, not on n8n binary data, so the pattern is always the same:

  1. Read/Write Files from Disk writes the incoming binary to a path such as /tmp/input.mp4.
  2. Execute Command runs the FFmpeg command.
  3. Read/Write Files from Disk reads the output file back into binary data.
  4. A final Execute Command removes the temporary files.

The whole execution runs on the same worker, so files written in one step are available in the next.

TaskFFmpeg command
Thumbnail at 3sffmpeg -y -i /tmp/in.mp4 -ss 3 -frames:v 1 /tmp/thumb.jpg
Trim without re-encodingffmpeg -y -ss 10 -to 40 -i /tmp/in.mp4 -c copy /tmp/clip.mp4
Normalize audioffmpeg -y -i /tmp/in.mp3 -af loudnorm /tmp/out.mp3
Extract audioffmpeg -y -i /tmp/in.mp4 -vn -acodec mp3 /tmp/audio.mp3
Metadata as JSONffprobe -v quiet -print_format json -show_format -show_streams /tmp/in.mp4

Is n8n free? (n8n license and pricing)

The n8n Community Edition is free to self host under the n8n Sustainable Use License, with no execution limits. n8n Cloud starts at $24 per month and does not allow Execute Command on any plan, so FFmpeg workflows are only possible when self hosting.

Monthly cost of self hosting n8n with FFmpeg on Railway

A typical project costs around $3-5 per month with usage-based billing. Video transcoding is CPU and memory heavy, so projects that process long videos cost more than ones that only extract thumbnails or metadata.

Troubleshooting n8n FFmpeg errors

"ffmpeg: not found" when testing a workflow: manual executions run on Primary, and FFmpeg lives on the Worker. Set OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true on Primary so tests run where FFmpeg is installed.

The Execute Command node does not appear: n8n 2.x excludes it by default. Adjust NODES_EXCLUDE and redeploy.

Read/Write Files rejects the path: check N8N_RESTRICT_FILE_ACCESS_TO and write inside an allowed folder.

Worker crashes on long videos: transcoding needs memory. Increase the worker's resources or add worker replicas instead of raising concurrency.

Disk fills up over time: clean temporary files at the end of every workflow.

Frequently Asked Questions (FAQs)

Does n8n Cloud support FFmpeg? No. n8n Cloud does not allow the Execute Command node, so FFmpeg requires a self hosted instance.

Why did Execute Command stop working after upgrading to n8n 2.0? n8n 2.0 disables the node by default through NODES_EXCLUDE. It has to be re-enabled explicitly.

Do I need a custom Docker image to use FFmpeg with n8n? Not with this template. FFmpeg and ffprobe are already installed on the worker.

Why is FFmpeg installed on the worker and not on the main instance? In queue mode the worker executes the workflows, so that is where Execute Command runs.

Can I add more workers? Yes. Duplicate the worker service or add replicas. Each one pulls jobs from the same Redis queue.

Is Execute Command safe to enable? It runs shell commands inside the container, so only enable it if you trust everyone with editor access.

Can I use yt-dlp or ImageMagick too? Yes, by installing them on the worker the same way FFmpeg is installed.

Related templates

[Updated Oct '26]


Template Content

More templates in this category

View Template
N8N Main + Worker
Deploy and Host N8N with Inactive worker.

jakemerson
121
View Template
Evolution API with n8n
Automate WhatsApp workflows with Evolution API, n8n, and Postgres.

codestorm
96
View Template
Postgres Backup
Cron-based PostgreSQL backup to bucket storage

Railway Templates
870