Updated: 22 October 2026 · Applies to: Ubuntu 26.04 (FFmpeg 8.0.1), Ubuntu 24.04 (FFmpeg 6.1.1) and Debian 13 (FFmpeg 7.1.5), tested; Linux Mint 22.x and LMDE 7 use the same packages
FFmpeg is in the standard package repositories of Ubuntu, Debian and Linux Mint, so you install it with apt in two commands: refresh the package lists, then install the ffmpeg package.
sudo apt update sudo apt install ffmpeg
Then check that it works:
ffmpeg -version
Output on Ubuntu 26.04 (first line):
ffmpeg version 8.0.1-3ubuntu2 Copyright (c) 2000-2025 the FFmpeg developers
The package also installs ffprobe (shows what is inside a media file) and ffplay (a simple player that needs a desktop).
Which FFmpeg version you get
- Ubuntu 26.04 LTS: FFmpeg 8.0.1, from the
universecomponent. - Ubuntu 24.04 LTS: FFmpeg 6.1.1, from
universe. - Debian 13: FFmpeg 7.1.5, from
main. - Linux Mint 22.x: according to Linux Mint, every 22.x release is built on Ubuntu 24.04 (Noble), so you get the same FFmpeg 6.1.1 package. LMDE 7 is built on Debian 13 and gets the Debian package.
Ubuntu 16.04 and 18.04 and Linux Mint 19, which the older version of this guide covered, are past the end of their standard support. They no longer get security updates, so upgrade to a current release before you put FFmpeg on a server.
Step by step on a server
- Log in over SSH as root or as a user with sudo rights.
- Refresh the package lists:
sudo apt update
- Install FFmpeg. On a server without a desktop,
--no-install-recommendsskips optional desktop extras. In our tests it cut the Ubuntu 24.04 install from 291 to 198 packages, and on Debian 13 encoding with libx264, AAC and MP3 worked normally after a minimal install:sudo apt install --no-install-recommends ffmpeg
- Confirm the encoders you need are there, for example H.264, H.265, AAC and MP3:
ffmpeg -hide_banner -encoders | grep -E "libx264|libx265|aac|libmp3lame"
Output on Ubuntu 26.04 and Debian 13 (the matching lines):
V....D libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264) V....D libx264rgb libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264) V....D libx265 libx265 H.265 / HEVC (codec hevc) A....D aac AAC (Advanced Audio Coding) A....D libmp3lame libmp3lame MP3 (MPEG audio layer 3) (codec mp3)
Error: Unable to locate package ffmpeg
apt shows this when it has no package lists yet, which is common on a fresh VPS or container. Ubuntu 24.04 prints it like this:
E: Unable to locate package ffmpeg
Ubuntu 26.04 prints:
Error: Unable to locate package ffmpeg
Refresh the lists and install again:
sudo apt update sudo apt install ffmpeg
If it still fails on Ubuntu, check where apt would take FFmpeg from:
apt-cache policy ffmpeg
An empty Candidate: line means the universe component is switched off. Open /etc/apt/sources.list.d/ubuntu.sources and make sure every Components: line includes universe. On a default Ubuntu 24.04 or 26.04 install the line looks like this:
Components: main universe restricted multiverse
Save the file, then run the two commands above (update, then install) again.
Quick examples
Convert a video to MP4 with H.264 video and AAC audio, the format most browsers and phones play:
ffmpeg -i input.mov -c:v libx264 -crf 23 -c:a aac -b:a 128k output.mp4
Extract the audio track as a 192 kbit/s MP3:
ffmpeg -i output.mp4 -vn -c:a libmp3lame -b:a 192k audio.mp3
Resize to 1280 pixels wide and keep the aspect ratio (-2 keeps the height an even number, which H.264 needs):
ffmpeg -i output.mp4 -vf scale=1280:-2 -c:a copy small.mp4
Save one frame at 2 seconds as a thumbnail:
ffmpeg -ss 2 -i output.mp4 -frames:v 1 thumb.jpg
Show the streams in a file:
ffprobe -v error -show_entries stream=codec_name,width,height -of compact small.mp4
Output:
stream|codec_name=h264|width=1280|height=720 stream|codec_name=aac
Encoding is heavy on the CPU. On a VPS that also runs websites, start long jobs with low priority so the sites stay responsive:
nice -n 19 ffmpeg -i input.mov -c:v libx264 -crf 23 -c:a aac output.mp4
In scripts and cron jobs, add -nostdin (and -y to overwrite existing output). Without it FFmpeg can stop at an "Overwrite? [y/N]" question or read input meant for the rest of your script. For example:
ffmpeg -nostdin -y -i input.mov -c:v libx264 -crf 23 -c:a aac output.mp4
Remove FFmpeg
sudo apt remove ffmpeg sudo apt autoremove
Other Linux systems and cPanel
- AlmaLinux and Rocky Linux: FFmpeg is not in the standard repositories. It comes from RPM Fusion, which needs EPEL and CRB. Follow How to Install FFmpeg on Linux: Ubuntu, Debian, AlmaLinux.
- Fedora: installing
ffmpegfrom the Fedora repositories gives the limitedffmpeg-freebuild without the H.264 and HEVC encoders; the full build comes from RPM Fusion. See How to Install FFmpeg on Fedora: ffmpeg-free or Full FFmpeg from RPM Fusion. - cPanel servers: see How to Install FFmpeg on a cPanel Server (Quick Guide).
Official documentation: ffmpeg documentation and Ubuntu ffmpeg packages.