Ffmpeg
senior11223344
HOBBYOP

4 months ago

How to install ffmpeg..pls help

$10 Bounty

4 Replies

Status changed to Awaiting Railway Response Railway 4 months ago


Can you provide more context? What are you trying to install it into?


error403op
FREE

4 months ago

Add in Dockerfile

RUN apt install ffmpeg -y


xtigin
PRO

4 months ago

Add this to your Dockerfile (correct and complete):

RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*

Do not use apt install alone — you must run apt-get update first.

This works for Debian/Ubuntu-based images (including most Railway default images).


grandmaster451
HOBBY

4 months ago

xtigin's answer is correct for Debian/Ubuntu-based images. Just to add some more context depending on your setup:

If you're using Railway's Nixpacks (no custom Dockerfile), you can add ffmpeg via the nixpacks.toml config:

[phases.setup]

nixPkgs = ["ffmpeg"]

Or set the environment variable: NIXPACKS_PKGS=ffmpeg

If you're on Alpine Linux:

RUN apk add --no-cache ffmpeg

If you're on Debian/Ubuntu (Dockerfile):

RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*

The rm -rf /var/lib/apt/lists/* at the end cleans the apt cache to keep your image size smaller — good practice for production images.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...