Ffmpeg
senior11223344
HOBBYOP

17 days ago

How to install ffmpeg..pls help

$10 Bounty

4 Replies

Status changed to Awaiting Railway Response Railway 17 days ago


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


error403op
PRO

17 days ago

Add in Dockerfile

RUN apt install ffmpeg -y


xtigin
PRO

17 days 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
FREE

17 days 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.


Loading...